diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/Azure.ResourceManager.AppNetwork.sln b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/Azure.ResourceManager.AppNetwork.sln new file mode 100644 index 000000000000..5ac0e545726d --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/Azure.ResourceManager.AppNetwork.sln @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.AppNetwork", "src\Azure.ResourceManager.AppNetwork.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.AppNetwork.Tests", "tests\Azure.ResourceManager.AppNetwork.Tests.csproj", "{5E0E0E1A-3E3F-4C3A-8B1A-2B3C4D5E6F70}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {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 + {5E0E0E1A-3E3F-4C3A-8B1A-2B3C4D5E6F70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E0E0E1A-3E3F-4C3A-8B1A-2B3C4D5E6F70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E0E0E1A-3E3F-4C3A-8B1A-2B3C4D5E6F70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E0E0E1A-3E3F-4C3A-8B1A-2B3C4D5E6F70}.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/appnetwork/Azure.ResourceManager.AppNetwork/CHANGELOG.md b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/CHANGELOG.md new file mode 100644 index 000000000000..26ffc1121312 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/CHANGELOG.md @@ -0,0 +1,17 @@ +# Release History + +## 1.0.0-beta.1 (2026-03-26) + +### Features Added + +This package 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. + +This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/Directory.Build.props b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/README.md b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/README.md new file mode 100644 index 000000000000..894fe884add4 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure App Network management client library for .NET + +Azure App Network (AppLink) is a service that enables connectivity, observability, and upgrade management for applications running across Azure Kubernetes clusters. + +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 App Network management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.AppNetwork --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://docs.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/ diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/api/Azure.ResourceManager.AppNetwork.net10.0.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/api/Azure.ResourceManager.AppNetwork.net10.0.cs new file mode 100644 index 000000000000..f8238c37d065 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/api/Azure.ResourceManager.AppNetwork.net10.0.cs @@ -0,0 +1,458 @@ +namespace Azure.ResourceManager.AppNetwork +{ + public partial class AppLinkCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppLinkCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string appLinkName, Azure.ResourceManager.AppNetwork.AppLinkData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string appLinkName, Azure.ResourceManager.AppNetwork.AppLinkData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string appLinkName, 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 appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string appLinkName, 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 AppLinkData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? AppLinkProvisioningState { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.AppLinkData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppLinkMemberCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string appLinkMemberName, Azure.ResourceManager.AppNetwork.AppLinkMemberData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string appLinkMemberName, Azure.ResourceManager.AppNetwork.AppLinkMemberData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string appLinkMemberName, 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 appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string appLinkMemberName, 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 AppLinkMemberData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppLinkMemberResource() { } + public virtual Azure.ResourceManager.AppNetwork.AppLinkMemberData 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 appLinkName, string appLinkMemberName) { 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.Pageable GetAppLinkUpgradeHistories(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAppLinkUpgradeHistoriesAsync(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.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.AppNetwork.Models.AppLinkMemberPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AppLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppLinkResource() { } + public virtual Azure.ResourceManager.AppNetwork.AppLinkData 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 appLinkName) { 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 GetAppLinkMember(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppLinkMemberAsync(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppNetwork.AppLinkMemberCollection GetAppLinkMembers() { 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.AppNetwork.AppLinkData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.AppNetwork.Models.AppLinkPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppNetwork.Models.AppLinkPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class AppNetworkExtensions + { + public static Azure.Response GetAppLink(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetAppLinkAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetAppLinkAvailableVersionsByLocation(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAppLinkAvailableVersionsByLocationAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkMemberResource GetAppLinkMemberResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkResource GetAppLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkCollection GetAppLinks(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetAppLinks(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAppLinksAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AzureResourceManagerAppNetworkContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerAppNetworkContext() { } + public static Azure.ResourceManager.AppNetwork.AzureResourceManagerAppNetworkContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } +} +namespace Azure.ResourceManager.AppNetwork.Mocking +{ + public partial class MockableAppNetworkArmClient : Azure.ResourceManager.ArmResource + { + protected MockableAppNetworkArmClient() { } + public virtual Azure.ResourceManager.AppNetwork.AppLinkMemberResource GetAppLinkMemberResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppNetwork.AppLinkResource GetAppLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableAppNetworkResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableAppNetworkResourceGroupResource() { } + public virtual Azure.Response GetAppLink(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppLinkAsync(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppNetwork.AppLinkCollection GetAppLinks() { throw null; } + } + public partial class MockableAppNetworkSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableAppNetworkSubscriptionResource() { } + public virtual Azure.Pageable GetAppLinkAvailableVersionsByLocation(Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAppLinkAvailableVersionsByLocationAsync(Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAppLinks(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAppLinksAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.AppNetwork.Models +{ + public partial class AppLinkAvailableVersion : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkAvailableVersion() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkAvailableVersionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkAvailableVersionProperties() { } + public System.Collections.Generic.IList FullyManagedVersionsReleaseChannels { get { throw null; } } + public string KubernetesVersion { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList SelfManagedVersionDetailVersions { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkClusterType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkClusterType(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType Aks { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType left, Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType left, Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkConnectivityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkConnectivityProfile() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility? EastWestGatewayVisibility { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateConnectSubnetResourceId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkEastWestGatewayVisibility : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkEastWestGatewayVisibility(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility External { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility Internal { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility left, Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility left, Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkMemberPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberPatch() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberProperties(Azure.Core.ResourceIdentifier metadataResourceId) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType? ClusterType { get { throw null; } set { } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile ConnectivityProfile { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier MetadataResourceId { get { throw null; } set { } } + public string ObservabilityMetricsEndpoint { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile UpgradeProfile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberUpdateProperties() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile ConnectivityProfile { get { throw null; } set { } } + public string ObservabilityMetricsEndpoint { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile UpgradeProfile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkPatch() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState left, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState left, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkReleaseChannelInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkReleaseChannelInfo() { } + public string ReleaseChannel { get { throw null; } } + public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkUpgradeHistory : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkUpgradeHistory() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistory System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistory System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkUpgradeHistoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkUpgradeHistoryProperties() { } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string FromVersion { get { throw null; } } + public string InitiatedBy { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset StartOn { get { throw null; } } + public string ToVersion { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkUpgradeMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkUpgradeMode(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode FullyManaged { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode SelfManaged { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkUpgradeProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkUpgradeProfile(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode mode) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel? FullyManagedUpgradeReleaseChannel { get { throw null; } set { } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode Mode { get { throw null; } set { } } + public string SelfManagedUpgradeVersion { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkUpgradeReleaseChannel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkUpgradeReleaseChannel(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel Rapid { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel Stable { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkVersionInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkVersionInfo() { } + public System.Collections.Generic.IList Upgrades { get { throw null; } } + public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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 ArmAppNetworkModelFactory + { + public static Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersion AppLinkAvailableVersion(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties AppLinkAvailableVersionProperties(string kubernetesVersion = null, System.Collections.Generic.IEnumerable fullyManagedVersionsReleaseChannels = null, System.Collections.Generic.IEnumerable selfManagedVersionDetailVersions = null, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? provisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkData AppLinkData(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.AppNetwork.Models.AppLinkProvisioningState? appLinkProvisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkMemberData AppLinkMemberData(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.AppNetwork.Models.AppLinkMemberProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch AppLinkMemberPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties AppLinkMemberProperties(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType? clusterType = default(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType?), Azure.Core.ResourceIdentifier metadataResourceId = null, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile upgradeProfile = null, string observabilityMetricsEndpoint = null, Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile connectivityProfile = null, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? provisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkPatch AppLinkPatch(System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo AppLinkReleaseChannelInfo(string releaseChannel = null, string version = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistory AppLinkUpgradeHistory(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties AppLinkUpgradeHistoryProperties(System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string initiatedBy = null, string fromVersion = null, string toVersion = null, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? provisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo AppLinkVersionInfo(string version = null, System.Collections.Generic.IEnumerable upgrades = null) { throw null; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/api/Azure.ResourceManager.AppNetwork.net8.0.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/api/Azure.ResourceManager.AppNetwork.net8.0.cs new file mode 100644 index 000000000000..f8238c37d065 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/api/Azure.ResourceManager.AppNetwork.net8.0.cs @@ -0,0 +1,458 @@ +namespace Azure.ResourceManager.AppNetwork +{ + public partial class AppLinkCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppLinkCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string appLinkName, Azure.ResourceManager.AppNetwork.AppLinkData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string appLinkName, Azure.ResourceManager.AppNetwork.AppLinkData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string appLinkName, 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 appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string appLinkName, 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 AppLinkData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? AppLinkProvisioningState { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.AppLinkData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppLinkMemberCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string appLinkMemberName, Azure.ResourceManager.AppNetwork.AppLinkMemberData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string appLinkMemberName, Azure.ResourceManager.AppNetwork.AppLinkMemberData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string appLinkMemberName, 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 appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string appLinkMemberName, 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 AppLinkMemberData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppLinkMemberResource() { } + public virtual Azure.ResourceManager.AppNetwork.AppLinkMemberData 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 appLinkName, string appLinkMemberName) { 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.Pageable GetAppLinkUpgradeHistories(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAppLinkUpgradeHistoriesAsync(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.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.AppNetwork.Models.AppLinkMemberPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AppLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppLinkResource() { } + public virtual Azure.ResourceManager.AppNetwork.AppLinkData 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 appLinkName) { 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 GetAppLinkMember(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppLinkMemberAsync(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppNetwork.AppLinkMemberCollection GetAppLinkMembers() { 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.AppNetwork.AppLinkData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.AppNetwork.Models.AppLinkPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppNetwork.Models.AppLinkPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class AppNetworkExtensions + { + public static Azure.Response GetAppLink(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetAppLinkAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetAppLinkAvailableVersionsByLocation(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAppLinkAvailableVersionsByLocationAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkMemberResource GetAppLinkMemberResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkResource GetAppLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkCollection GetAppLinks(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetAppLinks(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAppLinksAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AzureResourceManagerAppNetworkContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerAppNetworkContext() { } + public static Azure.ResourceManager.AppNetwork.AzureResourceManagerAppNetworkContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } +} +namespace Azure.ResourceManager.AppNetwork.Mocking +{ + public partial class MockableAppNetworkArmClient : Azure.ResourceManager.ArmResource + { + protected MockableAppNetworkArmClient() { } + public virtual Azure.ResourceManager.AppNetwork.AppLinkMemberResource GetAppLinkMemberResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppNetwork.AppLinkResource GetAppLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableAppNetworkResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableAppNetworkResourceGroupResource() { } + public virtual Azure.Response GetAppLink(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppLinkAsync(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppNetwork.AppLinkCollection GetAppLinks() { throw null; } + } + public partial class MockableAppNetworkSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableAppNetworkSubscriptionResource() { } + public virtual Azure.Pageable GetAppLinkAvailableVersionsByLocation(Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAppLinkAvailableVersionsByLocationAsync(Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAppLinks(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAppLinksAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.AppNetwork.Models +{ + public partial class AppLinkAvailableVersion : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkAvailableVersion() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkAvailableVersionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkAvailableVersionProperties() { } + public System.Collections.Generic.IList FullyManagedVersionsReleaseChannels { get { throw null; } } + public string KubernetesVersion { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList SelfManagedVersionDetailVersions { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkClusterType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkClusterType(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType Aks { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType left, Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType left, Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkConnectivityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkConnectivityProfile() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility? EastWestGatewayVisibility { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateConnectSubnetResourceId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkEastWestGatewayVisibility : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkEastWestGatewayVisibility(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility External { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility Internal { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility left, Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility left, Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkMemberPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberPatch() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberProperties(Azure.Core.ResourceIdentifier metadataResourceId) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType? ClusterType { get { throw null; } set { } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile ConnectivityProfile { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier MetadataResourceId { get { throw null; } set { } } + public string ObservabilityMetricsEndpoint { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile UpgradeProfile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberUpdateProperties() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile ConnectivityProfile { get { throw null; } set { } } + public string ObservabilityMetricsEndpoint { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile UpgradeProfile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkPatch() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState left, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState left, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkReleaseChannelInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkReleaseChannelInfo() { } + public string ReleaseChannel { get { throw null; } } + public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkUpgradeHistory : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkUpgradeHistory() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistory System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistory System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkUpgradeHistoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkUpgradeHistoryProperties() { } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string FromVersion { get { throw null; } } + public string InitiatedBy { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset StartOn { get { throw null; } } + public string ToVersion { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkUpgradeMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkUpgradeMode(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode FullyManaged { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode SelfManaged { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkUpgradeProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkUpgradeProfile(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode mode) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel? FullyManagedUpgradeReleaseChannel { get { throw null; } set { } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode Mode { get { throw null; } set { } } + public string SelfManagedUpgradeVersion { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkUpgradeReleaseChannel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkUpgradeReleaseChannel(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel Rapid { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel Stable { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkVersionInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkVersionInfo() { } + public System.Collections.Generic.IList Upgrades { get { throw null; } } + public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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 ArmAppNetworkModelFactory + { + public static Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersion AppLinkAvailableVersion(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties AppLinkAvailableVersionProperties(string kubernetesVersion = null, System.Collections.Generic.IEnumerable fullyManagedVersionsReleaseChannels = null, System.Collections.Generic.IEnumerable selfManagedVersionDetailVersions = null, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? provisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkData AppLinkData(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.AppNetwork.Models.AppLinkProvisioningState? appLinkProvisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkMemberData AppLinkMemberData(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.AppNetwork.Models.AppLinkMemberProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch AppLinkMemberPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties AppLinkMemberProperties(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType? clusterType = default(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType?), Azure.Core.ResourceIdentifier metadataResourceId = null, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile upgradeProfile = null, string observabilityMetricsEndpoint = null, Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile connectivityProfile = null, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? provisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkPatch AppLinkPatch(System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo AppLinkReleaseChannelInfo(string releaseChannel = null, string version = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistory AppLinkUpgradeHistory(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties AppLinkUpgradeHistoryProperties(System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string initiatedBy = null, string fromVersion = null, string toVersion = null, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? provisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo AppLinkVersionInfo(string version = null, System.Collections.Generic.IEnumerable upgrades = null) { throw null; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/api/Azure.ResourceManager.AppNetwork.netstandard2.0.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/api/Azure.ResourceManager.AppNetwork.netstandard2.0.cs new file mode 100644 index 000000000000..f8238c37d065 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/api/Azure.ResourceManager.AppNetwork.netstandard2.0.cs @@ -0,0 +1,458 @@ +namespace Azure.ResourceManager.AppNetwork +{ + public partial class AppLinkCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppLinkCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string appLinkName, Azure.ResourceManager.AppNetwork.AppLinkData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string appLinkName, Azure.ResourceManager.AppNetwork.AppLinkData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string appLinkName, 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 appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string appLinkName, 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 AppLinkData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? AppLinkProvisioningState { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.AppLinkData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppLinkMemberCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string appLinkMemberName, Azure.ResourceManager.AppNetwork.AppLinkMemberData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string appLinkMemberName, Azure.ResourceManager.AppNetwork.AppLinkMemberData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string appLinkMemberName, 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 appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string appLinkMemberName, 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 AppLinkMemberData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppLinkMemberResource() { } + public virtual Azure.ResourceManager.AppNetwork.AppLinkMemberData 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 appLinkName, string appLinkMemberName) { 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.Pageable GetAppLinkUpgradeHistories(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAppLinkUpgradeHistoriesAsync(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.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkMemberData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.AppNetwork.Models.AppLinkMemberPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AppLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppLinkResource() { } + public virtual Azure.ResourceManager.AppNetwork.AppLinkData 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 appLinkName) { 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 GetAppLinkMember(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppLinkMemberAsync(string appLinkMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppNetwork.AppLinkMemberCollection GetAppLinkMembers() { 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.AppNetwork.AppLinkData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.AppLinkData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.AppNetwork.Models.AppLinkPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppNetwork.Models.AppLinkPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class AppNetworkExtensions + { + public static Azure.Response GetAppLink(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetAppLinkAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetAppLinkAvailableVersionsByLocation(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAppLinkAvailableVersionsByLocationAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkMemberResource GetAppLinkMemberResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkResource GetAppLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkCollection GetAppLinks(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetAppLinks(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAppLinksAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AzureResourceManagerAppNetworkContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerAppNetworkContext() { } + public static Azure.ResourceManager.AppNetwork.AzureResourceManagerAppNetworkContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } +} +namespace Azure.ResourceManager.AppNetwork.Mocking +{ + public partial class MockableAppNetworkArmClient : Azure.ResourceManager.ArmResource + { + protected MockableAppNetworkArmClient() { } + public virtual Azure.ResourceManager.AppNetwork.AppLinkMemberResource GetAppLinkMemberResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppNetwork.AppLinkResource GetAppLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableAppNetworkResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableAppNetworkResourceGroupResource() { } + public virtual Azure.Response GetAppLink(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppLinkAsync(string appLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppNetwork.AppLinkCollection GetAppLinks() { throw null; } + } + public partial class MockableAppNetworkSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableAppNetworkSubscriptionResource() { } + public virtual Azure.Pageable GetAppLinkAvailableVersionsByLocation(Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAppLinkAvailableVersionsByLocationAsync(Azure.Core.AzureLocation location, string kubernetesVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAppLinks(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAppLinksAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.AppNetwork.Models +{ + public partial class AppLinkAvailableVersion : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkAvailableVersion() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkAvailableVersionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkAvailableVersionProperties() { } + public System.Collections.Generic.IList FullyManagedVersionsReleaseChannels { get { throw null; } } + public string KubernetesVersion { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList SelfManagedVersionDetailVersions { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkClusterType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkClusterType(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType Aks { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType left, Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType left, Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkConnectivityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkConnectivityProfile() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility? EastWestGatewayVisibility { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateConnectSubnetResourceId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkEastWestGatewayVisibility : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkEastWestGatewayVisibility(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility External { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility Internal { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility left, Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility left, Azure.ResourceManager.AppNetwork.Models.AppLinkEastWestGatewayVisibility right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkMemberPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberPatch() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberProperties(Azure.Core.ResourceIdentifier metadataResourceId) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType? ClusterType { get { throw null; } set { } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile ConnectivityProfile { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier MetadataResourceId { get { throw null; } set { } } + public string ObservabilityMetricsEndpoint { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile UpgradeProfile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkMemberUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkMemberUpdateProperties() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile ConnectivityProfile { get { throw null; } set { } } + public string ObservabilityMetricsEndpoint { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile UpgradeProfile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkPatch() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState left, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState left, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkReleaseChannelInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkReleaseChannelInfo() { } + public string ReleaseChannel { get { throw null; } } + public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkUpgradeHistory : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkUpgradeHistory() { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistory System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistory System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppLinkUpgradeHistoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkUpgradeHistoryProperties() { } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string FromVersion { get { throw null; } } + public string InitiatedBy { get { throw null; } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset StartOn { get { throw null; } } + public string ToVersion { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkUpgradeMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkUpgradeMode(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode FullyManaged { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode SelfManaged { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkUpgradeProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppLinkUpgradeProfile(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode mode) { } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel? FullyManagedUpgradeReleaseChannel { get { throw null; } set { } } + public Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeMode Mode { get { throw null; } set { } } + public string SelfManagedUpgradeVersion { get { throw null; } set { } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AppLinkUpgradeReleaseChannel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppLinkUpgradeReleaseChannel(string value) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel Rapid { get { throw null; } } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel Stable { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel right) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel (string value) { throw null; } + public static implicit operator Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel left, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeReleaseChannel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppLinkVersionInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AppLinkVersionInfo() { } + public System.Collections.Generic.IList Upgrades { get { throw null; } } + public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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 ArmAppNetworkModelFactory + { + public static Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersion AppLinkAvailableVersion(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkAvailableVersionProperties AppLinkAvailableVersionProperties(string kubernetesVersion = null, System.Collections.Generic.IEnumerable fullyManagedVersionsReleaseChannels = null, System.Collections.Generic.IEnumerable selfManagedVersionDetailVersions = null, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? provisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkData AppLinkData(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.AppNetwork.Models.AppLinkProvisioningState? appLinkProvisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.AppLinkMemberData AppLinkMemberData(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.AppNetwork.Models.AppLinkMemberProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkMemberPatch AppLinkMemberPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.AppNetwork.Models.AppLinkMemberUpdateProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkMemberProperties AppLinkMemberProperties(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType? clusterType = default(Azure.ResourceManager.AppNetwork.Models.AppLinkClusterType?), Azure.Core.ResourceIdentifier metadataResourceId = null, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeProfile upgradeProfile = null, string observabilityMetricsEndpoint = null, Azure.ResourceManager.AppNetwork.Models.AppLinkConnectivityProfile connectivityProfile = null, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? provisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkPatch AppLinkPatch(System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkReleaseChannelInfo AppLinkReleaseChannelInfo(string releaseChannel = null, string version = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistory AppLinkUpgradeHistory(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkUpgradeHistoryProperties AppLinkUpgradeHistoryProperties(System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string initiatedBy = null, string fromVersion = null, string toVersion = null, Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState? provisioningState = default(Azure.ResourceManager.AppNetwork.Models.AppLinkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppNetwork.Models.AppLinkVersionInfo AppLinkVersionInfo(string version = null, System.Collections.Generic.IEnumerable upgrades = null) { throw null; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/assets.json b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/assets.json new file mode 100644 index 000000000000..d3acb3f71c08 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/appnetwork/Azure.ResourceManager.AppNetwork", + "Tag": "" +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/metadata.json b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/metadata.json new file mode 100644 index 000000000000..38a65558b75c --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/metadata.json @@ -0,0 +1,5 @@ +{ + "apiVersions": { + "Microsoft.AppLink": "2025-08-01-preview" + } +} \ No newline at end of file diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Azure.ResourceManager.AppNetwork.csproj b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Azure.ResourceManager.AppNetwork.csproj new file mode 100644 index 000000000000..c0550c387329 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Azure.ResourceManager.AppNetwork.csproj @@ -0,0 +1,9 @@ + + + This is the Azure.ResourceManager.AppNetwork client library for developing .NET applications with rich experience. + SDK Code Generation Azure.ResourceManager.AppNetwork + 1.0.0-beta.1 + Azure.ResourceManager.AppNetwork + true + + diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkCollection.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkCollection.cs new file mode 100644 index 000000000000..a1a3091afdf8 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkCollection.cs @@ -0,0 +1,580 @@ +// 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.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppNetwork +{ + /// + /// 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 GetAppLinks method from an instance of . + /// + public partial class AppLinkCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _appLinksClientDiagnostics; + private readonly AppLinks _appLinksRestClient; + + /// Initializes a new instance of AppLinkCollection for mocking. + protected AppLinkCollection() + { + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AppLinkCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + TryGetApiVersion(AppLinkResource.ResourceType, out string appLinkApiVersion); + _appLinksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppNetwork", AppLinkResource.ResourceType.Namespace, Diagnostics); + _appLinksRestClient = new AppLinks(_appLinksClientDiagnostics, Pipeline, Endpoint, appLinkApiVersion ?? "2025-08-01-preview"); + ValidateResourceId(id); + } + + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), id); + } + } + + /// + /// Create an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_CreateOrUpdate. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// 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 AppLink. + /// Resource create parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string appLinkName, AppLinkData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + Argument.AssertNotNull(data, nameof(data)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkCollection.CreateOrUpdate"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, appLinkName, AppLinkData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + AppNetworkArmOperation operation = new AppNetworkArmOperation( + new AppLinkOperationSource(Client), + _appLinksClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_CreateOrUpdate. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// 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 AppLink. + /// Resource create parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string appLinkName, AppLinkData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + Argument.AssertNotNull(data, nameof(data)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkCollection.CreateOrUpdate"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, appLinkName, AppLinkData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + AppNetworkArmOperation operation = new AppNetworkArmOperation( + new AppLinkOperationSource(Client), + _appLinksClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletion(cancellationToken); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetAsync(string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkCollection.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, appLinkName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response Get(string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkCollection.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, appLinkName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AppLink resources by resource group. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks. + /// + /// + /// Operation Id. + /// AppLinks_ListByResourceGroup. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new AppLinksGetByResourceGroupAsyncCollectionResultOfT(_appLinksRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new AppLinkResource(Client, data)); + } + + /// + /// List AppLink resources by resource group. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks. + /// + /// + /// Operation Id. + /// AppLinks_ListByResourceGroup. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new AppLinksGetByResourceGroupCollectionResultOfT(_appLinksRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new AppLinkResource(Client, data)); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> ExistsAsync(string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkCollection.Exists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, appLinkName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(AppLinkData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((AppLinkData)null, result); + break; + default: + throw new RequestFailedException(result); + } + 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.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response Exists(string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkCollection.Exists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, appLinkName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(AppLinkData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((AppLinkData)null, result); + break; + default: + throw new RequestFailedException(result); + } + 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.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetIfExistsAsync(string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkCollection.GetIfExists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, appLinkName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(AppLinkData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((AppLinkData)null, result); + break; + default: + throw new RequestFailedException(result); + } + if (response.Value == null) + { + return new NoValueResponse(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkResource(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.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual NullableResponse GetIfExists(string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkCollection.GetIfExists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, appLinkName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(AppLinkData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((AppLinkData)null, result); + break; + default: + throw new RequestFailedException(result); + } + if (response.Value == null) + { + return new NoValueResponse(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + /// The cancellation token to use. + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkData.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkData.Serialization.cs new file mode 100644 index 000000000000..2c7973c7bdc9 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkData.Serialization.cs @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.AppNetwork.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + /// AppLink resource. + public partial class AppLinkData : TrackedResourceData, IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkData() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkData)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkData)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AppLinkData)PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(AppLinkData appLinkData) + { + if (appLinkData == null) + { + return null; + } + return RequestContent.Create(appLinkData, ModelSerializationExtensions.WireOptions); + } + + /// The to deserialize the from. + internal static AppLinkData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppLinkData(document.RootElement, ModelSerializationExtensions.WireOptions); + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkData)} 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); + ((IJsonModel)Identity).Write(writer, options.Format == "W" ? ModelSerializationExtensions.WireV3Options : ModelSerializationExtensions.JsonV3Options); + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AppLinkData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkData)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkData(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkData DeserializeAppLinkData(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType resourceType = default; + SystemData systemData = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + IDictionary tags = default; + AzureLocation location = default; + AppLinkProperties properties = default; + ManagedServiceIdentity identity = default; + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("type"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("systemData"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerAppNetworkContext.Default); + continue; + } + if (prop.NameEquals("tags"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + tags = dictionary; + continue; + } + if (prop.NameEquals("location"u8)) + { + location = new AzureLocation(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("properties"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AppLinkProperties.DeserializeAppLinkProperties(prop.Value, options); + continue; + } + if (prop.NameEquals("identity"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), options.Format == "W" ? ModelSerializationExtensions.WireV3Options : ModelSerializationExtensions.JsonV3Options, AzureResourceManagerAppNetworkContext.Default); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkData( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkData.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkData.cs new file mode 100644 index 000000000000..9f2abe7fa564 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkData.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; +using Azure.Core; +using Azure.ResourceManager.AppNetwork.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + /// AppLink resource. + public partial class AppLinkData : TrackedResourceData + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The geo-location where the resource lives. + public AppLinkData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Resource tags. + /// The geo-location where the resource lives. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + internal AppLinkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, IDictionary tags, AzureLocation location, AppLinkProperties properties, ManagedServiceIdentity identity) : base(id, name, resourceType, systemData, tags, location) + { + _additionalBinaryDataProperties = additionalBinaryDataProperties; + Properties = properties; + Identity = identity; + } + + /// The resource-specific properties for this resource. + internal AppLinkProperties Properties { get; set; } + + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + + /// Provisioning state. + public AppLinkProvisioningState? AppLinkProvisioningState + { + get + { + return Properties is null ? default : Properties.ProvisioningState; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberCollection.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberCollection.cs new file mode 100644 index 000000000000..3d335c8fe2e3 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberCollection.cs @@ -0,0 +1,583 @@ +// 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.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppNetwork +{ + /// + /// 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 GetAppLinkMembers method from an instance of . + /// + public partial class AppLinkMemberCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _appLinkMembersClientDiagnostics; + private readonly AppLinkMembers _appLinkMembersRestClient; + private readonly ClientDiagnostics _upgradeHistoriesClientDiagnostics; + private readonly UpgradeHistories _upgradeHistoriesRestClient; + + /// Initializes a new instance of AppLinkMemberCollection for mocking. + protected AppLinkMemberCollection() + { + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AppLinkMemberCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + TryGetApiVersion(AppLinkMemberResource.ResourceType, out string appLinkMemberApiVersion); + _appLinkMembersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppNetwork", AppLinkMemberResource.ResourceType.Namespace, Diagnostics); + _appLinkMembersRestClient = new AppLinkMembers(_appLinkMembersClientDiagnostics, Pipeline, Endpoint, appLinkMemberApiVersion ?? "2025-08-01-preview"); + _upgradeHistoriesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppNetwork", AppLinkMemberResource.ResourceType.Namespace, Diagnostics); + _upgradeHistoriesRestClient = new UpgradeHistories(_upgradeHistoriesClientDiagnostics, Pipeline, Endpoint, appLinkMemberApiVersion ?? "2025-08-01-preview"); + ValidateResourceId(id); + } + + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != AppLinkResource.ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, AppLinkResource.ResourceType), id); + } + } + + /// + /// Create an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_CreateOrUpdate. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// 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 AppLinkMember. + /// Resource create parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string appLinkMemberName, AppLinkMemberData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberCollection.CreateOrUpdate"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, appLinkMemberName, AppLinkMemberData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + AppNetworkArmOperation operation = new AppNetworkArmOperation( + new AppLinkMemberOperationSource(Client), + _appLinkMembersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_CreateOrUpdate. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// 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 AppLinkMember. + /// Resource create parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string appLinkMemberName, AppLinkMemberData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberCollection.CreateOrUpdate"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, appLinkMemberName, AppLinkMemberData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + AppNetworkArmOperation operation = new AppNetworkArmOperation( + new AppLinkMemberOperationSource(Client), + _appLinkMembersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletion(cancellationToken); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLinkMember. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetAsync(string appLinkMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberCollection.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, appLinkMemberName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLinkMember. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response Get(string appLinkMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberCollection.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, appLinkMemberName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AppLinkMember resources by AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers. + /// + /// + /// Operation Id. + /// AppLinkMembers_ListByAppLink. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new AppLinkMembersGetByAppLinkAsyncCollectionResultOfT(_appLinkMembersRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new AppLinkMemberResource(Client, data)); + } + + /// + /// List AppLinkMember resources by AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers. + /// + /// + /// Operation Id. + /// AppLinkMembers_ListByAppLink. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new AppLinkMembersGetByAppLinkCollectionResultOfT(_appLinkMembersRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new AppLinkMemberResource(Client, data)); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLinkMember. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> ExistsAsync(string appLinkMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberCollection.Exists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, appLinkMemberName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((AppLinkMemberData)null, result); + break; + default: + throw new RequestFailedException(result); + } + 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.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLinkMember. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response Exists(string appLinkMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberCollection.Exists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, appLinkMemberName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((AppLinkMemberData)null, result); + break; + default: + throw new RequestFailedException(result); + } + 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.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLinkMember. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetIfExistsAsync(string appLinkMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberCollection.GetIfExists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, appLinkMemberName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((AppLinkMemberData)null, result); + break; + default: + throw new RequestFailedException(result); + } + if (response.Value == null) + { + return new NoValueResponse(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkMemberResource(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.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLinkMember. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual NullableResponse GetIfExists(string appLinkMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberCollection.GetIfExists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, appLinkMemberName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((AppLinkMemberData)null, result); + break; + default: + throw new RequestFailedException(result); + } + if (response.Value == null) + { + return new NoValueResponse(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + /// The cancellation token to use. + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberData.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberData.Serialization.cs new file mode 100644 index 000000000000..c5d4ad683eeb --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberData.Serialization.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.AppNetwork.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + /// AppLink Member resource. + public partial class AppLinkMemberData : TrackedResourceData, IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkMemberData() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkMemberData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkMemberData)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkMemberData)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkMemberData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AppLinkMemberData)PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(AppLinkMemberData appLinkMemberData) + { + if (appLinkMemberData == null) + { + return null; + } + return RequestContent.Create(appLinkMemberData, ModelSerializationExtensions.WireOptions); + } + + /// The to deserialize the from. + internal static AppLinkMemberData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppLinkMemberData(document.RootElement, ModelSerializationExtensions.WireOptions); + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberData)} does not support writing '{format}' format."); + } + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkMemberData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AppLinkMemberData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberData)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkMemberData(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkMemberData DeserializeAppLinkMemberData(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType resourceType = default; + SystemData systemData = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + IDictionary tags = default; + AzureLocation location = default; + AppLinkMemberProperties properties = default; + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("type"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("systemData"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerAppNetworkContext.Default); + continue; + } + if (prop.NameEquals("tags"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + tags = dictionary; + continue; + } + if (prop.NameEquals("location"u8)) + { + location = new AzureLocation(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("properties"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AppLinkMemberProperties.DeserializeAppLinkMemberProperties(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkMemberData( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties, + tags ?? new ChangeTrackingDictionary(), + location, + properties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberData.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberData.cs new file mode 100644 index 000000000000..4524ab441e8d --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberData.cs @@ -0,0 +1,46 @@ +// 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.AppNetwork.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + /// AppLink Member resource. + public partial class AppLinkMemberData : TrackedResourceData + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The geo-location where the resource lives. + public AppLinkMemberData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Resource tags. + /// The geo-location where the resource lives. + /// The resource-specific properties for this resource. + internal AppLinkMemberData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, IDictionary tags, AzureLocation location, AppLinkMemberProperties properties) : base(id, name, resourceType, systemData, tags, location) + { + _additionalBinaryDataProperties = additionalBinaryDataProperties; + Properties = properties; + } + + /// The resource-specific properties for this resource. + public AppLinkMemberProperties Properties { get; set; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberResource.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberResource.Serialization.cs new file mode 100644 index 000000000000..7003967c8ddb --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberResource.Serialization.cs @@ -0,0 +1,39 @@ +// 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.AppNetwork +{ + /// + public partial class AppLinkMemberResource : IJsonModel + { + private static IJsonModel s_dataDeserializationInstance; + + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new AppLinkMemberData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + /// The reader for deserializing the model. + /// The client options for reading and writing models. + AppLinkMemberData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppNetworkContext.Default); + + /// The binary data to be processed. + /// The client options for reading and writing models. + AppLinkMemberData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppNetworkContext.Default); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberResource.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberResource.cs new file mode 100644 index 000000000000..c6e95fdf3d76 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkMemberResource.cs @@ -0,0 +1,763 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.AppNetwork.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppNetwork +{ + /// + /// A class representing a AppLinkMember 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 GetResource method. + /// Otherwise you can get one from its parent resource using the GetAppLinkMembers method. + /// + public partial class AppLinkMemberResource : ArmResource + { + private readonly ClientDiagnostics _appLinkMembersClientDiagnostics; + private readonly AppLinkMembers _appLinkMembersRestClient; + private readonly ClientDiagnostics _upgradeHistoriesClientDiagnostics; + private readonly UpgradeHistories _upgradeHistoriesRestClient; + private readonly AppLinkMemberData _data; + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.AppLink/appLinks/appLinkMembers"; + + /// Initializes a new instance of AppLinkMemberResource for mocking. + protected AppLinkMemberResource() + { + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AppLinkMemberResource(ArmClient client, AppLinkMemberData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AppLinkMemberResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + TryGetApiVersion(ResourceType, out string appLinkMemberApiVersion); + _appLinkMembersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppNetwork", ResourceType.Namespace, Diagnostics); + _appLinkMembersRestClient = new AppLinkMembers(_appLinkMembersClientDiagnostics, Pipeline, Endpoint, appLinkMemberApiVersion ?? "2025-08-01-preview"); + _upgradeHistoriesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppNetwork", ResourceType.Namespace, Diagnostics); + _upgradeHistoriesRestClient = new UpgradeHistories(_upgradeHistoriesClientDiagnostics, Pipeline, Endpoint, appLinkMemberApiVersion ?? "2025-08-01-preview"); + ValidateResourceId(id); + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + public virtual AppLinkMemberData Data + { + get + { + if (!HasData) + { + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } + return _data; + } + } + + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The appLinkName. + /// The appLinkMemberName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string appLinkName, string appLinkMemberName) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}"; + return new ResourceIdentifier(resourceId); + } + + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } + } + + /// + /// Get an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Update. + /// + /// + /// Default Api Version. + /// 2025-08-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, AppLinkMemberPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.Update"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, AppLinkMemberPatch.ToRequestContent(patch), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + AppNetworkArmOperation operation = new AppNetworkArmOperation( + new AppLinkMemberOperationSource(Client), + _appLinkMembersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Update. + /// + /// + /// Default Api Version. + /// 2025-08-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, AppLinkMemberPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.Update"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, AppLinkMemberPatch.ToRequestContent(patch), context); + Response response = Pipeline.ProcessMessage(message, context); + AppNetworkArmOperation operation = new AppNetworkArmOperation( + new AppLinkMemberOperationSource(Client), + _appLinkMembersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletion(cancellationToken); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Delete. + /// + /// + /// Default Api Version. + /// 2025-08-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 DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.Delete"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + AppNetworkArmOperation operation = new AppNetworkArmOperation(_appLinkMembersClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}. + /// + /// + /// Operation Id. + /// AppLinkMembers_Delete. + /// + /// + /// Default Api Version. + /// 2025-08-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 DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.Delete"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + AppNetworkArmOperation operation = new AppNetworkArmOperation(_appLinkMembersClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletionResponse(cancellationToken); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List UpgradeHistory resources by AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}/upgradeHistories. + /// + /// + /// Operation Id. + /// UpgradeHistories_ListByAppLinkMember. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAppLinkUpgradeHistoriesAsync(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new UpgradeHistoriesGetAppLinkUpgradeHistoriesAsyncCollectionResultOfT( + _upgradeHistoriesRestClient, + Guid.Parse(Id.SubscriptionId), + Id.ResourceGroupName, + Id.Parent.Name, + Id.Name, + context); + } + + /// + /// List UpgradeHistory resources by AppLinkMember. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}/upgradeHistories. + /// + /// + /// Operation Id. + /// UpgradeHistories_ListByAppLinkMember. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAppLinkUpgradeHistories(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new UpgradeHistoriesGetAppLinkUpgradeHistoriesCollectionResultOfT( + _upgradeHistoriesRestClient, + Guid.Parse(Id.SubscriptionId), + Id.ResourceGroupName, + Id.Parent.Name, + Id.Name, + context); + } + + /// Add a tag to the current 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 DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) + { + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkMemberData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + AppLinkMemberPatch patch = new AppLinkMemberPatch(); + foreach (KeyValuePair tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + ArmOperation 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. + /// 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 DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken)) + { + Response originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkMemberData current = Get(cancellationToken: cancellationToken).Value.Data; + AppLinkMemberPatch patch = new AppLinkMemberPatch(); + foreach (KeyValuePair tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + ArmOperation 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. + /// The tags to set on the resource. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken).ConfigureAwait(false); + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkMemberData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + AppLinkMemberPatch patch = new AppLinkMemberPatch(); + patch.Tags.ReplaceWith(tags); + ArmOperation 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. + /// The tags to set on the resource. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkMemberData current = Get(cancellationToken: cancellationToken).Value.Data; + AppLinkMemberPatch patch = new AppLinkMemberPatch(); + patch.Tags.ReplaceWith(tags); + ArmOperation 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. + /// 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 DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) + { + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkMemberData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + AppLinkMemberPatch patch = new AppLinkMemberPatch(); + foreach (KeyValuePair tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + ArmOperation 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. + /// 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 DiagnosticScope scope = _appLinkMembersClientDiagnostics.CreateScope("AppLinkMemberResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken)) + { + Response originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinkMembersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkMemberData.FromResponse(result), result); + return Response.FromValue(new AppLinkMemberResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkMemberData current = Get(cancellationToken: cancellationToken).Value.Data; + AppLinkMemberPatch patch = new AppLinkMemberPatch(); + foreach (KeyValuePair tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + ArmOperation 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkResource.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkResource.Serialization.cs new file mode 100644 index 000000000000..f11915384376 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkResource.Serialization.cs @@ -0,0 +1,39 @@ +// 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.AppNetwork +{ + /// + public partial class AppLinkResource : IJsonModel + { + private static IJsonModel s_dataDeserializationInstance; + + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new AppLinkData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + /// The reader for deserializing the model. + /// The client options for reading and writing models. + AppLinkData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppNetworkContext.Default); + + /// The binary data to be processed. + /// The client options for reading and writing models. + AppLinkData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppNetworkContext.Default); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkResource.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkResource.cs new file mode 100644 index 000000000000..848c14a7e08e --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/AppLinkResource.cs @@ -0,0 +1,715 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.AppNetwork.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppNetwork +{ + /// + /// A class representing a AppLink 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 GetResource method. + /// Otherwise you can get one from its parent resource using the GetAppLinks method. + /// + public partial class AppLinkResource : ArmResource + { + private readonly ClientDiagnostics _appLinksClientDiagnostics; + private readonly AppLinks _appLinksRestClient; + private readonly AppLinkData _data; + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.AppLink/appLinks"; + + /// Initializes a new instance of AppLinkResource for mocking. + protected AppLinkResource() + { + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AppLinkResource(ArmClient client, AppLinkData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AppLinkResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + TryGetApiVersion(ResourceType, out string appLinkApiVersion); + _appLinksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppNetwork", ResourceType.Namespace, Diagnostics); + _appLinksRestClient = new AppLinks(_appLinksClientDiagnostics, Pipeline, Endpoint, appLinkApiVersion ?? "2025-08-01-preview"); + ValidateResourceId(id); + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + public virtual AppLinkData Data + { + get + { + if (!HasData) + { + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } + return _data; + } + } + + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The appLinkName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string appLinkName) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}"; + return new ResourceIdentifier(resourceId); + } + + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } + } + + /// + /// Get an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Update. + /// + /// + /// Default Api Version. + /// 2025-08-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, AppLinkPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.Update"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, AppLinkPatch.ToRequestContent(patch), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + AppNetworkArmOperation operation = new AppNetworkArmOperation( + new AppLinkOperationSource(Client), + _appLinksClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Update. + /// + /// + /// Default Api Version. + /// 2025-08-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, AppLinkPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.Update"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, AppLinkPatch.ToRequestContent(patch), context); + Response response = Pipeline.ProcessMessage(message, context); + AppNetworkArmOperation operation = new AppNetworkArmOperation( + new AppLinkOperationSource(Client), + _appLinksClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletion(cancellationToken); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Delete. + /// + /// + /// Default Api Version. + /// 2025-08-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 DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.Delete"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + AppNetworkArmOperation operation = new AppNetworkArmOperation(_appLinksClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Delete. + /// + /// + /// Default Api Version. + /// 2025-08-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 DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.Delete"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + AppNetworkArmOperation operation = new AppNetworkArmOperation(_appLinksClientDiagnostics, Pipeline, message.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. + /// 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 DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) + { + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + AppLinkPatch patch = new AppLinkPatch(); + foreach (KeyValuePair tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + ArmOperation 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. + /// 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 DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken)) + { + Response originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkData current = Get(cancellationToken: cancellationToken).Value.Data; + AppLinkPatch patch = new AppLinkPatch(); + foreach (KeyValuePair tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + ArmOperation 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. + /// The tags to set on the resource. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken).ConfigureAwait(false); + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + AppLinkPatch patch = new AppLinkPatch(); + patch.Tags.ReplaceWith(tags); + ArmOperation 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. + /// The tags to set on the resource. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkData current = Get(cancellationToken: cancellationToken).Value.Data; + AppLinkPatch patch = new AppLinkPatch(); + patch.Tags.ReplaceWith(tags); + ArmOperation 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. + /// 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 DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) + { + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + AppLinkPatch patch = new AppLinkPatch(); + foreach (KeyValuePair tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + ArmOperation 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. + /// 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 DiagnosticScope scope = _appLinksClientDiagnostics.CreateScope("AppLinkResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken)) + { + Response originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _appLinksRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(AppLinkData.FromResponse(result), result); + return Response.FromValue(new AppLinkResource(Client, response.Value), response.GetRawResponse()); + } + else + { + AppLinkData current = Get(cancellationToken: cancellationToken).Value.Data; + AppLinkPatch patch = new AppLinkPatch(); + foreach (KeyValuePair tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets a collection of AppLinkMembers in the . + /// An object representing collection of AppLinkMembers and their operations over a AppLinkMemberResource. + public virtual AppLinkMemberCollection GetAppLinkMembers() + { + return GetCachedClient(client => new AppLinkMemberCollection(client, Id)); + } + + /// Get an AppLinkMember. + /// The name of the AppLinkMember. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppLinkMemberAsync(string appLinkMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + + return await GetAppLinkMembers().GetAsync(appLinkMemberName, cancellationToken).ConfigureAwait(false); + } + + /// Get an AppLinkMember. + /// The name of the AppLinkMember. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppLinkMember(string appLinkMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkMemberName, nameof(appLinkMemberName)); + + return GetAppLinkMembers().Get(appLinkMemberName, cancellationToken); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/ArmAppNetworkModelFactory.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/ArmAppNetworkModelFactory.cs new file mode 100644 index 000000000000..7ff82b83c2d1 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/ArmAppNetworkModelFactory.cs @@ -0,0 +1,197 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager.AppNetwork; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// A factory class for creating instances of the models for mocking. + public static partial class ArmAppNetworkModelFactory + { + + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Resource tags. + /// The geo-location where the resource lives. + /// Provisioning state. + /// The managed service identities assigned to this resource. + /// A new instance for mocking. + public static AppLinkData AppLinkData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, IDictionary tags = default, AzureLocation location = default, AppLinkProvisioningState? appLinkProvisioningState = default, ManagedServiceIdentity identity = default) + { + tags ??= new ChangeTrackingDictionary(); + + return new AppLinkData( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties: null, + tags, + location, + appLinkProvisioningState is null ? default : new AppLinkProperties(appLinkProvisioningState, null), + identity); + } + + /// The type used for update operations of the AppLink. + /// Resource tags. + /// A new instance for mocking. + public static AppLinkPatch AppLinkPatch(IDictionary tags = default) + { + tags ??= new ChangeTrackingDictionary(); + + return new AppLinkPatch(tags, additionalBinaryDataProperties: null); + } + + /// AppLink Member resource. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Resource tags. + /// The geo-location where the resource lives. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static AppLinkMemberData AppLinkMemberData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, IDictionary tags = default, AzureLocation location = default, AppLinkMemberProperties properties = default) + { + tags ??= new ChangeTrackingDictionary(); + + return new AppLinkMemberData( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties: null, + tags, + location, + properties); + } + + /// Cluster type. + /// Resource ID. + /// Upgrade profile. + /// Metrics endpoint URL. + /// Connectivity profile. + /// Provisioning state. + /// A new instance for mocking. + public static AppLinkMemberProperties AppLinkMemberProperties(AppLinkClusterType? clusterType = default, ResourceIdentifier metadataResourceId = default, AppLinkUpgradeProfile upgradeProfile = default, string observabilityMetricsEndpoint = default, AppLinkConnectivityProfile connectivityProfile = default, AppLinkProvisioningState? provisioningState = default) + { + return new AppLinkMemberProperties( + clusterType, + metadataResourceId is null ? default : new Metadata(metadataResourceId, null), + upgradeProfile, + observabilityMetricsEndpoint is null ? default : new ObservabilityProfile(new MetricsProfile(observabilityMetricsEndpoint, null), null), + connectivityProfile, + provisioningState, + additionalBinaryDataProperties: null); + } + + /// The type used for update operations of the AppLinkMember. + /// Resource tags. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static AppLinkMemberPatch AppLinkMemberPatch(IDictionary tags = default, AppLinkMemberUpdateProperties properties = default) + { + tags ??= new ChangeTrackingDictionary(); + + return new AppLinkMemberPatch(tags, properties, additionalBinaryDataProperties: null); + } + + /// AppLinkMember upgrade history. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static AppLinkUpgradeHistory AppLinkUpgradeHistory(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, AppLinkUpgradeHistoryProperties properties = default) + { + return new AppLinkUpgradeHistory( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties: null, + properties); + } + + /// AppLinkMember upgrade history properties. + /// Start timestamp. + /// End timestamp. + /// Upgrade initiator. + /// Version upgraded from. + /// Version upgraded to. + /// Provisioning state. + /// A new instance for mocking. + public static AppLinkUpgradeHistoryProperties AppLinkUpgradeHistoryProperties(DateTimeOffset startOn = default, DateTimeOffset? endOn = default, string initiatedBy = default, string fromVersion = default, string toVersion = default, AppLinkProvisioningState? provisioningState = default) + { + return new AppLinkUpgradeHistoryProperties( + startOn, + endOn, + initiatedBy, + fromVersion, + toVersion, + provisioningState, + additionalBinaryDataProperties: null); + } + + /// AppLink available version resource. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static AppLinkAvailableVersion AppLinkAvailableVersion(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, AppLinkAvailableVersionProperties properties = default) + { + return new AppLinkAvailableVersion( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties: null, + properties); + } + + /// Kubernetes version. + /// Release channels. + /// Istio versions. + /// Provisioning state. + /// A new instance for mocking. + public static AppLinkAvailableVersionProperties AppLinkAvailableVersionProperties(string kubernetesVersion = default, IEnumerable fullyManagedVersionsReleaseChannels = default, IEnumerable selfManagedVersionDetailVersions = default, AppLinkProvisioningState? provisioningState = default) + { + return new AppLinkAvailableVersionProperties(kubernetesVersion, fullyManagedVersionsReleaseChannels is null ? default : new FullyManagedVersions((fullyManagedVersionsReleaseChannels ?? new ChangeTrackingList()).ToList(), null), selfManagedVersionDetailVersions is null ? default : new SelfManagedVersions((selfManagedVersionDetailVersions ?? new ChangeTrackingList()).ToList(), null), provisioningState, additionalBinaryDataProperties: null); + } + + /// Release channel information. + /// Release channel. + /// Istio version behind release channel. + /// A new instance for mocking. + public static AppLinkReleaseChannelInfo AppLinkReleaseChannelInfo(string releaseChannel = default, string version = default) + { + return new AppLinkReleaseChannelInfo(releaseChannel, version, additionalBinaryDataProperties: null); + } + + /// Version information. + /// Istio version. + /// Available upgrades. + /// A new instance for mocking. + public static AppLinkVersionInfo AppLinkVersionInfo(string version = default, IEnumerable upgrades = default) + { + upgrades ??= new ChangeTrackingList(); + + return new AppLinkVersionInfo(version, upgrades.ToList(), additionalBinaryDataProperties: null); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinkMembersGetByAppLinkAsyncCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinkMembersGetByAppLinkAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..11c1f68925bd --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinkMembersGetByAppLinkAsyncCollectionResultOfT.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; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppLinkMembersGetByAppLinkAsyncCollectionResultOfT : AsyncPageable + { + private readonly AppLinkMembers _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _appLinkName; + private readonly RequestContext _context; + + /// Initializes a new instance of AppLinkMembersGetByAppLinkAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The AppLinkMembers client used to send requests. + /// 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 AppLink. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public AppLinkMembersGetByAppLinkAsyncCollectionResultOfT(AppLinkMembers client, Guid subscriptionId, string resourceGroupName, string appLinkName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _appLinkName = appLinkName; + _context = context; + } + + /// Gets the pages of AppLinkMembersGetByAppLinkAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of AppLinkMembersGetByAppLinkAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + AppLinkMemberListResult result = AppLinkMemberListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByAppLinkRequest(nextLink, _subscriptionId, _resourceGroupName, _appLinkName, _context) : _client.CreateGetByAppLinkRequest(_subscriptionId, _resourceGroupName, _appLinkName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("AppLinkMemberCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinkMembersGetByAppLinkCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinkMembersGetByAppLinkCollectionResultOfT.cs new file mode 100644 index 000000000000..aceb10090789 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinkMembersGetByAppLinkCollectionResultOfT.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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppLinkMembersGetByAppLinkCollectionResultOfT : Pageable + { + private readonly AppLinkMembers _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _appLinkName; + private readonly RequestContext _context; + + /// Initializes a new instance of AppLinkMembersGetByAppLinkCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The AppLinkMembers client used to send requests. + /// 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 AppLink. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public AppLinkMembersGetByAppLinkCollectionResultOfT(AppLinkMembers client, Guid subscriptionId, string resourceGroupName, string appLinkName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _appLinkName = appLinkName; + _context = context; + } + + /// Gets the pages of AppLinkMembersGetByAppLinkCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of AppLinkMembersGetByAppLinkCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + AppLinkMemberListResult result = AppLinkMemberListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByAppLinkRequest(nextLink, _subscriptionId, _resourceGroupName, _appLinkName, _context) : _client.CreateGetByAppLinkRequest(_subscriptionId, _resourceGroupName, _appLinkName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("AppLinkMemberCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetByResourceGroupAsyncCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetByResourceGroupAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..adbc4f4b54b7 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetByResourceGroupAsyncCollectionResultOfT.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; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppLinksGetByResourceGroupAsyncCollectionResultOfT : AsyncPageable + { + private readonly AppLinks _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly RequestContext _context; + + /// Initializes a new instance of AppLinksGetByResourceGroupAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The AppLinks client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public AppLinksGetByResourceGroupAsyncCollectionResultOfT(AppLinks client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _context = context; + } + + /// Gets the pages of AppLinksGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of AppLinksGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + AppLinkListResult result = AppLinkListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("AppLinkCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetByResourceGroupCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetByResourceGroupCollectionResultOfT.cs new file mode 100644 index 000000000000..e36c87cc498c --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetByResourceGroupCollectionResultOfT.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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppLinksGetByResourceGroupCollectionResultOfT : Pageable + { + private readonly AppLinks _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly RequestContext _context; + + /// Initializes a new instance of AppLinksGetByResourceGroupCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The AppLinks client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public AppLinksGetByResourceGroupCollectionResultOfT(AppLinks client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _context = context; + } + + /// Gets the pages of AppLinksGetByResourceGroupCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of AppLinksGetByResourceGroupCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + AppLinkListResult result = AppLinkListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("AppLinkCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetBySubscriptionAsyncCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetBySubscriptionAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..b9655d9d7a63 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetBySubscriptionAsyncCollectionResultOfT.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 System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppLinksGetBySubscriptionAsyncCollectionResultOfT : AsyncPageable + { + private readonly AppLinks _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of AppLinksGetBySubscriptionAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The AppLinks client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public AppLinksGetBySubscriptionAsyncCollectionResultOfT(AppLinks client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of AppLinksGetBySubscriptionAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of AppLinksGetBySubscriptionAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + AppLinkListResult result = AppLinkListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetBySubscriptionRequest(nextLink, _subscriptionId, _context) : _client.CreateGetBySubscriptionRequest(_subscriptionId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableAppNetworkSubscriptionResource.GetAppLinks"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetBySubscriptionCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetBySubscriptionCollectionResultOfT.cs new file mode 100644 index 000000000000..97166b29e176 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AppLinksGetBySubscriptionCollectionResultOfT.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; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppLinksGetBySubscriptionCollectionResultOfT : Pageable + { + private readonly AppLinks _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of AppLinksGetBySubscriptionCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The AppLinks client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public AppLinksGetBySubscriptionCollectionResultOfT(AppLinks client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of AppLinksGetBySubscriptionCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of AppLinksGetBySubscriptionCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + AppLinkListResult result = AppLinkListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetBySubscriptionRequest(nextLink, _subscriptionId, _context) : _client.CreateGetBySubscriptionRequest(_subscriptionId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableAppNetworkSubscriptionResource.GetAppLinks"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AvailableVersionsGetAppLinkAvailableVersionsByLocationAsyncCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AvailableVersionsGetAppLinkAvailableVersionsByLocationAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..8a9baf724473 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AvailableVersionsGetAppLinkAvailableVersionsByLocationAsyncCollectionResultOfT.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; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AvailableVersionsGetAppLinkAvailableVersionsByLocationAsyncCollectionResultOfT : AsyncPageable + { + private readonly AvailableVersions _client; + private readonly Guid _subscriptionId; + private readonly AzureLocation _location; + private readonly string _kubernetesVersion; + private readonly RequestContext _context; + + /// Initializes a new instance of AvailableVersionsGetAppLinkAvailableVersionsByLocationAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The AvailableVersions client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Kubernetes version to filter profiles. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public AvailableVersionsGetAppLinkAvailableVersionsByLocationAsyncCollectionResultOfT(AvailableVersions client, Guid subscriptionId, AzureLocation location, string kubernetesVersion, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _location = location; + _kubernetesVersion = kubernetesVersion; + _context = context; + } + + /// Gets the pages of AvailableVersionsGetAppLinkAvailableVersionsByLocationAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of AvailableVersionsGetAppLinkAvailableVersionsByLocationAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + AvailableVersionListResult result = AvailableVersionListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAppLinkAvailableVersionsByLocationRequest(nextLink, _subscriptionId, _location, _kubernetesVersion, _context) : _client.CreateGetAppLinkAvailableVersionsByLocationRequest(_subscriptionId, _location, _kubernetesVersion, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableAppNetworkSubscriptionResource.GetAppLinkAvailableVersionsByLocation"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AvailableVersionsGetAppLinkAvailableVersionsByLocationCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AvailableVersionsGetAppLinkAvailableVersionsByLocationCollectionResultOfT.cs new file mode 100644 index 000000000000..f490935843ea --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/AvailableVersionsGetAppLinkAvailableVersionsByLocationCollectionResultOfT.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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AvailableVersionsGetAppLinkAvailableVersionsByLocationCollectionResultOfT : Pageable + { + private readonly AvailableVersions _client; + private readonly Guid _subscriptionId; + private readonly AzureLocation _location; + private readonly string _kubernetesVersion; + private readonly RequestContext _context; + + /// Initializes a new instance of AvailableVersionsGetAppLinkAvailableVersionsByLocationCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The AvailableVersions client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Kubernetes version to filter profiles. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public AvailableVersionsGetAppLinkAvailableVersionsByLocationCollectionResultOfT(AvailableVersions client, Guid subscriptionId, AzureLocation location, string kubernetesVersion, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _location = location; + _kubernetesVersion = kubernetesVersion; + _context = context; + } + + /// Gets the pages of AvailableVersionsGetAppLinkAvailableVersionsByLocationCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of AvailableVersionsGetAppLinkAvailableVersionsByLocationCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + AvailableVersionListResult result = AvailableVersionListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAppLinkAvailableVersionsByLocationRequest(nextLink, _subscriptionId, _location, _kubernetesVersion, _context) : _client.CreateGetAppLinkAvailableVersionsByLocationRequest(_subscriptionId, _location, _kubernetesVersion, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableAppNetworkSubscriptionResource.GetAppLinkAvailableVersionsByLocation"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/UpgradeHistoriesGetAppLinkUpgradeHistoriesAsyncCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/UpgradeHistoriesGetAppLinkUpgradeHistoriesAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..0caf0c1da8a3 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/UpgradeHistoriesGetAppLinkUpgradeHistoriesAsyncCollectionResultOfT.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 System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class UpgradeHistoriesGetAppLinkUpgradeHistoriesAsyncCollectionResultOfT : AsyncPageable + { + private readonly UpgradeHistories _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _appLinkName; + private readonly string _appLinkMemberName; + private readonly RequestContext _context; + + /// Initializes a new instance of UpgradeHistoriesGetAppLinkUpgradeHistoriesAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The UpgradeHistories client used to send requests. + /// 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 AppLink. + /// The name of the AppLinkMember. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public UpgradeHistoriesGetAppLinkUpgradeHistoriesAsyncCollectionResultOfT(UpgradeHistories client, Guid subscriptionId, string resourceGroupName, string appLinkName, string appLinkMemberName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _appLinkName = appLinkName; + _appLinkMemberName = appLinkMemberName; + _context = context; + } + + /// Gets the pages of UpgradeHistoriesGetAppLinkUpgradeHistoriesAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of UpgradeHistoriesGetAppLinkUpgradeHistoriesAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + UpgradeHistoryListResult result = UpgradeHistoryListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAppLinkUpgradeHistoriesRequest(nextLink, _subscriptionId, _resourceGroupName, _appLinkName, _appLinkMemberName, _context) : _client.CreateGetAppLinkUpgradeHistoriesRequest(_subscriptionId, _resourceGroupName, _appLinkName, _appLinkMemberName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("AppLinkMemberResource.GetAppLinkUpgradeHistories"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/UpgradeHistoriesGetAppLinkUpgradeHistoriesCollectionResultOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/UpgradeHistoriesGetAppLinkUpgradeHistoriesCollectionResultOfT.cs new file mode 100644 index 000000000000..484598d0e386 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/CollectionResults/UpgradeHistoriesGetAppLinkUpgradeHistoriesCollectionResultOfT.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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppNetwork.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class UpgradeHistoriesGetAppLinkUpgradeHistoriesCollectionResultOfT : Pageable + { + private readonly UpgradeHistories _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _appLinkName; + private readonly string _appLinkMemberName; + private readonly RequestContext _context; + + /// Initializes a new instance of UpgradeHistoriesGetAppLinkUpgradeHistoriesCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The UpgradeHistories client used to send requests. + /// 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 AppLink. + /// The name of the AppLinkMember. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public UpgradeHistoriesGetAppLinkUpgradeHistoriesCollectionResultOfT(UpgradeHistories client, Guid subscriptionId, string resourceGroupName, string appLinkName, string appLinkMemberName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _appLinkName = appLinkName; + _appLinkMemberName = appLinkMemberName; + _context = context; + } + + /// Gets the pages of UpgradeHistoriesGetAppLinkUpgradeHistoriesCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of UpgradeHistoriesGetAppLinkUpgradeHistoriesCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + UpgradeHistoryListResult result = UpgradeHistoryListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAppLinkUpgradeHistoriesRequest(nextLink, _subscriptionId, _resourceGroupName, _appLinkName, _appLinkMemberName, _context) : _client.CreateGetAppLinkUpgradeHistoriesRequest(_subscriptionId, _resourceGroupName, _appLinkName, _appLinkMemberName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("AppLinkMemberResource.GetAppLinkUpgradeHistories"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/AppNetworkExtensions.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/AppNetworkExtensions.cs new file mode 100644 index 000000000000..7b335cc8d5b2 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/AppNetworkExtensions.cs @@ -0,0 +1,208 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppNetwork.Mocking; +using Azure.ResourceManager.AppNetwork.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppNetwork +{ + /// A class to add extension methods to Azure.ResourceManager.AppNetwork. + public static partial class AppNetworkExtensions + { + /// + private static MockableAppNetworkArmClient GetMockableAppNetworkArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableAppNetworkArmClient(client0, ResourceIdentifier.Root)); + } + + /// + private static MockableAppNetworkResourceGroupResource GetMockableAppNetworkResourceGroupResource(ResourceGroupResource resourceGroupResource) + { + return resourceGroupResource.GetCachedClient(client => new MockableAppNetworkResourceGroupResource(client, resourceGroupResource.Id)); + } + + /// + private static MockableAppNetworkSubscriptionResource GetMockableAppNetworkSubscriptionResource(SubscriptionResource subscriptionResource) + { + return subscriptionResource.GetCachedClient(client => new MockableAppNetworkSubscriptionResource(client, subscriptionResource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AppLinkResource GetAppLinkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppNetworkArmClient(client).GetAppLinkResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AppLinkMemberResource GetAppLinkMemberResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppNetworkArmClient(client).GetAppLinkMemberResource(id); + } + + /// + /// Gets a collection of AppLinks in the + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The the method will execute against. + /// is null. + /// An object representing collection of AppLinks and their operations over a AppLinkResource. + public static AppLinkCollection GetAppLinks(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableAppNetworkResourceGroupResource(resourceGroupResource).GetAppLinks(); + } + + /// + /// Get an AppLink. + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The the method will execute against. + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public static async Task> GetAppLinkAsync(this ResourceGroupResource resourceGroupResource, string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableAppNetworkResourceGroupResource(resourceGroupResource).GetAppLinkAsync(appLinkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an AppLink. + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The the method will execute against. + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public static Response GetAppLink(this ResourceGroupResource resourceGroupResource, string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableAppNetworkResourceGroupResource(resourceGroupResource).GetAppLink(appLinkName, cancellationToken); + } + + /// + /// List AppLink resources by subscription. + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The 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 AsyncPageable GetAppLinksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableAppNetworkSubscriptionResource(subscriptionResource).GetAppLinksAsync(cancellationToken); + } + + /// + /// List AppLink resources by subscription. + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The 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 GetAppLinks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableAppNetworkSubscriptionResource(subscriptionResource).GetAppLinks(cancellationToken); + } + + /// + /// List AvailableVersion resources by location. + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The the method will execute against. + /// The name of the Azure region. + /// Kubernetes version to filter profiles. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetAppLinkAvailableVersionsByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string kubernetesVersion = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableAppNetworkSubscriptionResource(subscriptionResource).GetAppLinkAvailableVersionsByLocationAsync(location, kubernetesVersion, cancellationToken); + } + + /// + /// List AvailableVersion resources by location. + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The the method will execute against. + /// The name of the Azure region. + /// Kubernetes version to filter profiles. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetAppLinkAvailableVersionsByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, string kubernetesVersion = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableAppNetworkSubscriptionResource(subscriptionResource).GetAppLinkAvailableVersionsByLocation(location, kubernetesVersion, cancellationToken); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/MockableAppNetworkArmClient.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/MockableAppNetworkArmClient.cs new file mode 100644 index 000000000000..63f47b1c09cc --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/MockableAppNetworkArmClient.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Mocking +{ + /// A class to add extension methods to . + public partial class MockableAppNetworkArmClient : ArmResource + { + /// Initializes a new instance of MockableAppNetworkArmClient for mocking. + protected MockableAppNetworkArmClient() + { + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableAppNetworkArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppLinkResource GetAppLinkResource(ResourceIdentifier id) + { + AppLinkResource.ValidateResourceId(id); + return new AppLinkResource(Client, id); + } + + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppLinkMemberResource GetAppLinkMemberResource(ResourceIdentifier id) + { + AppLinkMemberResource.ValidateResourceId(id); + return new AppLinkMemberResource(Client, id); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/MockableAppNetworkResourceGroupResource.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/MockableAppNetworkResourceGroupResource.cs new file mode 100644 index 000000000000..035e7df2ccd8 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/MockableAppNetworkResourceGroupResource.cs @@ -0,0 +1,99 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppNetwork; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppNetwork.Mocking +{ + /// A class to add extension methods to . + public partial class MockableAppNetworkResourceGroupResource : ArmResource + { + /// Initializes a new instance of MockableAppNetworkResourceGroupResource for mocking. + protected MockableAppNetworkResourceGroupResource() + { + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableAppNetworkResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + /// Gets a collection of AppLinks in the . + /// An object representing collection of AppLinks and their operations over a AppLinkResource. + public virtual AppLinkCollection GetAppLinks() + { + return GetCachedClient(client => new AppLinkCollection(client, Id)); + } + + /// + /// Get an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppLinkAsync(string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + + return await GetAppLinks().GetAsync(appLinkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an AppLink. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}. + /// + /// + /// Operation Id. + /// AppLinks_Get. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the AppLink. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppLink(string appLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(appLinkName, nameof(appLinkName)); + + return GetAppLinks().Get(appLinkName, cancellationToken); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/MockableAppNetworkSubscriptionResource.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/MockableAppNetworkSubscriptionResource.cs new file mode 100644 index 000000000000..0bb9697396bb --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Extensions/MockableAppNetworkSubscriptionResource.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.AppNetwork; +using Azure.ResourceManager.AppNetwork.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppNetwork.Mocking +{ + /// A class to add extension methods to . + public partial class MockableAppNetworkSubscriptionResource : ArmResource + { + private ClientDiagnostics _appLinksClientDiagnostics; + private AppLinks _appLinksRestClient; + private ClientDiagnostics _availableVersionsClientDiagnostics; + private AvailableVersions _availableVersionsRestClient; + + /// Initializes a new instance of MockableAppNetworkSubscriptionResource for mocking. + protected MockableAppNetworkSubscriptionResource() + { + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableAppNetworkSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics AppLinksClientDiagnostics => _appLinksClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppNetwork.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); + + private AppLinks AppLinksRestClient => _appLinksRestClient ??= new AppLinks(AppLinksClientDiagnostics, Pipeline, Endpoint, "2025-08-01-preview"); + + private ClientDiagnostics AvailableVersionsClientDiagnostics => _availableVersionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppNetwork.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); + + private AvailableVersions AvailableVersionsRestClient => _availableVersionsRestClient ??= new AvailableVersions(AvailableVersionsClientDiagnostics, Pipeline, Endpoint, "2025-08-01-preview"); + + /// + /// List AppLink resources by subscription. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.AppLink/appLinks. + /// + /// + /// Operation Id. + /// AppLinks_ListBySubscription. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAppLinksAsync(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new AppLinksGetBySubscriptionAsyncCollectionResultOfT(AppLinksRestClient, Guid.Parse(Id.SubscriptionId), context), data => new AppLinkResource(Client, data)); + } + + /// + /// List AppLink resources by subscription. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.AppLink/appLinks. + /// + /// + /// Operation Id. + /// AppLinks_ListBySubscription. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAppLinks(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new AppLinksGetBySubscriptionCollectionResultOfT(AppLinksRestClient, Guid.Parse(Id.SubscriptionId), context), data => new AppLinkResource(Client, data)); + } + + /// + /// List AvailableVersion resources by location. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.AppLink/locations/{location}/availableVersions. + /// + /// + /// Operation Id. + /// AvailableVersions_ListByLocation. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the Azure region. + /// Kubernetes version to filter profiles. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAppLinkAvailableVersionsByLocationAsync(AzureLocation location, string kubernetesVersion = default, CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AvailableVersionsGetAppLinkAvailableVersionsByLocationAsyncCollectionResultOfT(AvailableVersionsRestClient, Guid.Parse(Id.SubscriptionId), location, kubernetesVersion, context); + } + + /// + /// List AvailableVersion resources by location. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.AppLink/locations/{location}/availableVersions. + /// + /// + /// Operation Id. + /// AvailableVersions_ListByLocation. + /// + /// + /// Default Api Version. + /// 2025-08-01-preview. + /// + /// + /// + /// The name of the Azure region. + /// Kubernetes version to filter profiles. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAppLinkAvailableVersionsByLocation(AzureLocation location, string kubernetesVersion = default, CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AvailableVersionsGetAppLinkAvailableVersionsByLocationCollectionResultOfT(AvailableVersionsRestClient, Guid.Parse(Id.SubscriptionId), location, kubernetesVersion, context); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/Argument.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..b9db1f5386e3 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/Argument.cs @@ -0,0 +1,113 @@ +// 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.AppNetwork +{ + internal static partial class Argument + { + /// The value. + /// The name. + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + /// The value. + /// The name. + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + /// The value. + /// The 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); + } + } + + /// The value. + /// The 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); + } + } + + /// The value. + /// The 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); + } + } + + /// The value. + /// The minimum value. + /// The maximum value. + /// The 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."); + } + } + + /// The value. + /// The name. + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/AsyncPageableWrapper.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/AsyncPageableWrapper.cs new file mode 100644 index 000000000000..6ed874e5a07a --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/AsyncPageableWrapper.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AsyncPageableWrapper : AsyncPageable + { + /// The source async pageable value of type AsyncPageable<T>. + private AsyncPageable _source; + /// The converter function from T to U. + private Func _converter; + + /// Initializes a new instance of the AsyncPageableWrapper class. + /// The source async pageable value of type AsyncPageable<T>. + /// The converter function from T to U. + public AsyncPageableWrapper(AsyncPageable source, Func converter) + { + _source = source; + _converter = converter; + } + + /// Converts the pages from AsyncPageable to Page. + /// A continuation token from a previous response. + /// An optional hint to specify the desired size of each page. + /// An enumerable of pages containing converted items of type U. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + await foreach (Page page in _source.AsPages(continuationToken, pageSizeHint).ConfigureAwait(false)) + { + List convertedItems = new List(); + foreach (T item in page.Values) + { + convertedItems.Add(_converter.Invoke(item)); + } + yield return Page.FromValues(convertedItems, page.ContinuationToken, page.GetRawResponse()); + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..cf3724051020 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,189 @@ +// 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.AppNetwork +{ + internal partial class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary + where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + /// The inner dictionary. + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + /// The inner dictionary. + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + /// Gets the IsUndefined. + public bool IsUndefined => _innerDictionary == null; + + /// Gets the Count. + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + /// Gets the IsReadOnly. + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + /// Gets the Keys. + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + /// Gets the Values. + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + /// Gets or sets the value associated with the specified key. + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + /// Gets the Keys. + IEnumerable IReadOnlyDictionary.Keys => Keys; + + /// Gets the Values. + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// The item to add. + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + /// The item to search for. + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + /// The array to copy. + /// The index. + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + /// The item to remove. + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + /// The key. + /// The value to add. + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + /// The key to search for. + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + /// The key. + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + /// The key to search for. + /// The value. + 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ChangeTrackingList.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..9879d8982420 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,168 @@ +// 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.AppNetwork +{ + internal partial class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + /// The inner list. + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + /// The inner list. + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + /// Gets the IsUndefined. + public bool IsUndefined => _innerList == null; + + /// Gets the Count. + public int Count => IsUndefined ? 0 : EnsureList().Count; + + /// Gets the IsReadOnly. + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + /// Gets or sets the value associated with the specified key. + 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(); + } + + /// The item to add. + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + /// The item. + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + /// The array to copy to. + /// The array index. + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + /// The item. + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + /// The item. + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + /// The inner list. + /// The item. + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + /// The inner list. + 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ClientPipelineExtensions.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ClientPipelineExtensions.cs new file mode 100644 index 000000000000..d1b355807d57 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ClientPipelineExtensions.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppNetwork +{ + internal static partial class ClientPipelineExtensions + { + public static async ValueTask ProcessMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + (CancellationToken userCancellationToken, ErrorOptions errorOptions) = context.Parse(); + await pipeline.SendAsync(message, userCancellationToken).ConfigureAwait(false); + + if (message.Response.IsError && (errorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow) + { + throw new RequestFailedException(message.Response); + } + + return message.Response; + } + + public static Response ProcessMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + (CancellationToken userCancellationToken, ErrorOptions errorOptions) = context.Parse(); + pipeline.Send(message, userCancellationToken); + + if (message.Response.IsError && (errorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow) + { + throw new RequestFailedException(message.Response); + } + + return message.Response; + } + + public static async ValueTask> ProcessHeadAsBoolMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + Response response = await pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + switch (response.Status) + { + case >= 200 and < 300: + return Response.FromValue(true, response); + case >= 400 and < 500: + return Response.FromValue(false, response); + default: + return new ErrorResult(response, new RequestFailedException(response)); + } + } + + public static Response ProcessHeadAsBoolMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + Response response = pipeline.ProcessMessage(message, context); + switch (response.Status) + { + case >= 200 and < 300: + return Response.FromValue(true, response); + case >= 400 and < 500: + return Response.FromValue(false, response); + default: + return new ErrorResult(response, new RequestFailedException(response)); + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenMemberAttribute.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..72778edeb7e4 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + /// The original name of the member. + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenSerializationAttribute.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..dfcabf517497 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + /// The property name which these hooks apply to. + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + /// The property name which these hooks apply to. + /// The serialization name of the property. + public CodeGenSerializationAttribute(string propertyName, string serializationName) + { + PropertyName = propertyName; + SerializationName = serializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string SerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenSuppressAttribute.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..38d536e69173 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + /// The member to suppress. + /// The types of the parameters of the member. + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenTypeAttribute.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..f36b5f513173 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + /// The original name of the type. + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ErrorResult.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ErrorResult.cs new file mode 100644 index 000000000000..b822418e9638 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ErrorResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class ErrorResult : Response + { + private readonly Response _response; + private readonly RequestFailedException _exception; + + public ErrorResult(Response response, RequestFailedException exception) + { + _response = response; + _exception = exception; + } + + /// Gets the Value. + public override T Value => throw _exception; + + /// + public override Response GetRawResponse() + { + return _response; + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..644f799d53f1 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,272 @@ +// Copyright (c) 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.Runtime.InteropServices; +using System.Text.Json; + +namespace Azure.ResourceManager.AppNetwork +{ + internal static partial class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions + { + MaxDepth = 256 + }; + /// The wire v3 options for model serialization. + internal static readonly ModelReaderWriterOptions WireV3Options = new ModelReaderWriterOptions("W|v3"); + /// The JSON v3 options for model serialization. + internal static readonly ModelReaderWriterOptions JsonV3Options = new ModelReaderWriterOptions("J|v3"); + + 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: + Dictionary dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + List 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) + { + string 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) + { + string 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 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); + } + + public static BinaryData GetUtf8Bytes(this JsonElement element) + { +#if NET9_0_OR_GREATER + return new global::System.BinaryData(global::System.Runtime.InteropServices.JsonMarshal.GetRawUtf8Value(element).ToArray()); +#else + return BinaryData.FromString(element.GetRawText()); +#endif + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/Optional.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..854f65687863 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/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.AppNetwork +{ + internal static partial 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(string value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/PageableWrapper.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/PageableWrapper.cs new file mode 100644 index 000000000000..24baa9ba6c8f --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/PageableWrapper.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; +using Azure; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class PageableWrapper : Pageable + { + /// The source pageable value of type Pageable<T>. + private Pageable _source; + /// The converter function from T to U. + private Func _converter; + + /// Initializes a new instance of the PageableWrapper class. + /// The source pageable value of type Pageable<T>. + /// The converter function from T to U. + public PageableWrapper(Pageable source, Func converter) + { + _source = source; + _converter = converter; + } + + /// Converts the pages from Pageable to Page. + /// A continuation token from a previous response. + /// An optional hint to specify the desired size of each page. + /// An enumerable of pages containing converted items of type U. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + foreach (Page page in _source.AsPages(continuationToken, pageSizeHint)) + { + List convertedItems = new List(); + foreach (T item in page.Values) + { + convertedItems.Add(_converter.Invoke(item)); + } + yield return Page.FromValues(convertedItems, page.ContinuationToken, page.GetRawResponse()); + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/RawRequestUriBuilderExtensions.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/RawRequestUriBuilderExtensions.cs new file mode 100644 index 000000000000..38dfe52dca7a --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/RawRequestUriBuilderExtensions.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.AppNetwork +{ + internal static partial class RawRequestUriBuilderExtensions + { + public static void AppendQueryDelimited(this RawRequestUriBuilder builder, string name, IEnumerable value, string delimiter, SerializationFormat format = SerializationFormat.Default, bool escape = true) + { + delimiter ??= ","; + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); + builder.AppendQuery(name, string.Join(delimiter, stringValues), escape); + } + + public static void UpdateQuery(this RawRequestUriBuilder builder, string name, string value) + { + string currentQuery = builder.Query; + string searchPattern = string.Concat(name, "="); + int paramStartIndex = -1; + if (currentQuery.StartsWith(string.Concat("?", searchPattern))) + { + paramStartIndex = 1; + } + if (paramStartIndex == -1) + { + string prefixedPattern = string.Concat("&", searchPattern); + int prefixedIndex = currentQuery.IndexOf(prefixedPattern); + if (prefixedIndex >= 0) + { + paramStartIndex = prefixedIndex + 1; + } + } + if (paramStartIndex >= 0) + { + int valueStartIndex = paramStartIndex + searchPattern.Length; + int valueEndIndex = currentQuery.IndexOf('&', valueStartIndex); + if (valueEndIndex == -1) + { + valueEndIndex = currentQuery.Length; + } + string beforeParam = currentQuery.Substring(0, valueStartIndex); + string afterParam = currentQuery.Substring(valueEndIndex); + string newQuery = string.Concat(beforeParam, value, afterParam); + builder.Query = newQuery; + } + else + { + builder.AppendQuery(name, value, true); + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/RequestContextExtensions.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/RequestContextExtensions.cs new file mode 100644 index 000000000000..0bc13ef0f188 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/RequestContextExtensions.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using Azure; + +namespace Azure.ResourceManager.AppNetwork +{ + internal static partial class RequestContextExtensions + { + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + public static ValueTuple Parse(this RequestContext context) + { + if (context == null) + { + return (CancellationToken.None, ErrorOptions.Default); + } + return (context.CancellationToken, context.ErrorOptions); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/SerializationFormat.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/SerializationFormat.cs new file mode 100644 index 000000000000..f21714ee7f81 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/SerializationFormat.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppNetwork +{ + internal enum SerializationFormat + { + /// The default serialization format. + Default = 0, + /// The RFC1123 date time format. + DateTime_RFC1123 = 1, + /// The RFC3339 date time format. + DateTime_RFC3339 = 2, + /// The RFC7231 date time format. + DateTime_RFC7231 = 3, + /// The ISO8601 date time format. + DateTime_ISO8601 = 4, + /// The Unix date time format. + DateTime_Unix = 5, + /// The ISO8601 date format. + Date_ISO8601 = 6, + /// The ISO8601 duration format. + Duration_ISO8601 = 7, + /// The constant duration format. + Duration_Constant = 8, + /// The seconds duration format. + Duration_Seconds = 9, + /// The seconds duration format with float precision. + Duration_Seconds_Float = 10, + /// The seconds duration format with double precision. + Duration_Seconds_Double = 11, + /// The milliseconds duration format. + Duration_Milliseconds = 12, + /// The milliseconds duration format with float precision. + Duration_Milliseconds_Float = 13, + /// The milliseconds duration format with double precision. + Duration_Milliseconds_Double = 14, + /// The ISO8601 time format. + Time_ISO8601 = 15, + /// The Base64Url bytes format. + Bytes_Base64Url = 16, + /// The Base64 bytes format. + Bytes_Base64 = 17 + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/TypeFormatters.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/TypeFormatters.cs new file mode 100644 index 000000000000..f6e386e620ef --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Internal/TypeFormatters.cs @@ -0,0 +1,181 @@ +// 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.Xml; + +namespace Azure.ResourceManager.AppNetwork +{ + internal static partial 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}. Generated clients require 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 ToFormatSpecifier(SerializationFormat format) => format switch + { + SerializationFormat.DateTime_RFC1123 => "R", + SerializationFormat.DateTime_RFC3339 => "O", + SerializationFormat.DateTime_RFC7231 => "R", + SerializationFormat.DateTime_ISO8601 => "O", + SerializationFormat.Date_ISO8601 => "D", + SerializationFormat.DateTime_Unix => "U", + SerializationFormat.Bytes_Base64Url => "U", + SerializationFormat.Bytes_Base64 => "D", + SerializationFormat.Duration_ISO8601 => "P", + SerializationFormat.Duration_Constant => "c", + SerializationFormat.Duration_Seconds => "%s", + SerializationFormat.Duration_Seconds_Float => "s\\.FFF", + SerializationFormat.Duration_Seconds_Double => "s\\.FFFFFF", + SerializationFormat.Time_ISO8601 => "T", + _ => null + }; + + public static string ConvertToString(object value, SerializationFormat format = SerializationFormat.Default) + { + string formatSpecifier = ToFormatSpecifier(format); + + return 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 formatSpecifier != null => ToString(b0, formatSpecifier), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when formatSpecifier != null => ToString(dateTime, formatSpecifier), + TimeSpan timeSpan when format == SerializationFormat.Duration_Seconds => Convert.ToInt32(timeSpan.TotalSeconds).ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan0 when format == SerializationFormat.Duration_Seconds_Float || format == SerializationFormat.Duration_Seconds_Double => timeSpan0.TotalSeconds.ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan1 when format == SerializationFormat.Duration_Milliseconds => Convert.ToInt32(timeSpan1.TotalMilliseconds).ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan2 when format == SerializationFormat.Duration_Milliseconds_Float || format == SerializationFormat.Duration_Milliseconds_Double => timeSpan2.TotalMilliseconds.ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan3 when formatSpecifier != null => ToString(timeSpan3, formatSpecifier), + TimeSpan timeSpan4 => XmlConvert.ToString(timeSpan4), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppLinkMemberOperationSource.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppLinkMemberOperationSource.cs new file mode 100644 index 000000000000..be82db2f379b --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppLinkMemberOperationSource.cs @@ -0,0 +1,49 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppNetwork +{ + /// + internal partial class AppLinkMemberOperationSource : IOperationSource + { + private readonly ArmClient _client; + + /// + /// + internal AppLinkMemberOperationSource(ArmClient client) + { + _client = client; + } + + /// The response from the service. + /// The cancellation token to use. + /// + AppLinkMemberResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + AppLinkMemberData data = AppLinkMemberData.DeserializeAppLinkMemberData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new AppLinkMemberResource(_client, data); + } + + /// The response from the service. + /// The cancellation token to use. + /// + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + AppLinkMemberData data = AppLinkMemberData.DeserializeAppLinkMemberData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new AppLinkMemberResource(_client, data); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppLinkOperationSource.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppLinkOperationSource.cs new file mode 100644 index 000000000000..5a981916ef43 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppLinkOperationSource.cs @@ -0,0 +1,49 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppNetwork +{ + /// + internal partial class AppLinkOperationSource : IOperationSource + { + private readonly ArmClient _client; + + /// + /// + internal AppLinkOperationSource(ArmClient client) + { + _client = client; + } + + /// The response from the service. + /// The cancellation token to use. + /// + AppLinkResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + AppLinkData data = AppLinkData.DeserializeAppLinkData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new AppLinkResource(_client, data); + } + + /// The response from the service. + /// The cancellation token to use. + /// + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + AppLinkData data = AppLinkData.DeserializeAppLinkData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new AppLinkResource(_client, data); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppNetworkArmOperation.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppNetworkArmOperation.cs new file mode 100644 index 000000000000..e00c6364ed0d --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppNetworkArmOperation.cs @@ -0,0 +1,106 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppNetworkArmOperation : ArmOperation + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of AppNetworkArmOperation for mocking. + protected AppNetworkArmOperation() + { + } + + /// + /// The operation response. + /// The token to rehydrate the operation. + internal AppNetworkArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + /// + /// The instance of . + /// The instance of . + /// The operation request. + /// The operation response. + /// The finalStateVia of the operation. + /// If should skip Api version override. + /// The Api version override value. + internal AppNetworkArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) + { + _nextLinkOperation = nextLinkOperationImplementation; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal( + nextLinkOperation, + clientDiagnostics, + response, + "AppNetworkArmOperation", + null, + new SequentialDelayStrategy()); + } + + /// Gets the Id. + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// Gets the HasCompleted. + public override bool HasCompleted => _operation.HasCompleted; + + /// The token to rehydrate a long-running operation. + private string GetOperationId(RehydrationToken? rehydrationToken) + { + return rehydrationToken?.Id; + } + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppNetworkArmOperationOfT.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppNetworkArmOperationOfT.cs new file mode 100644 index 000000000000..3a757ebecff3 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/LongRunningOperation/AppNetworkArmOperationOfT.cs @@ -0,0 +1,113 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppNetworkArmOperation : ArmOperation + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of AppNetworkArmOperation for mocking. + protected AppNetworkArmOperation() + { + } + + /// + /// The operation response. + /// The token to rehydrate the operation. + internal AppNetworkArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + /// + /// The instance of . + /// The instance of . + /// The instance of . + /// The operation request. + /// The operation response. + /// The finalStateVia of the operation. + /// If should skip Api version override. + /// The Api version override value. + internal AppNetworkArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) + { + _nextLinkOperation = nextLinkOperationImplementation; + _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, + "AppNetworkArmOperation", + null, + new SequentialDelayStrategy()); + } + + /// Gets the Id. + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// Gets the Value. + public override T Value => _operation.Value; + + /// Gets the HasValue. + public override bool HasValue => _operation.HasValue; + + /// Gets the HasCompleted. + public override bool HasCompleted => _operation.HasCompleted; + + /// The token to rehydrate a long-running operation. + private string GetOperationId(RehydrationToken? rehydrationToken) + { + return rehydrationToken?.Id; + } + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersion.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersion.Serialization.cs new file mode 100644 index 000000000000..0ade33ddf915 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersion.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; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppNetwork; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLink available version resource. + public partial class AppLinkAvailableVersion : ResourceData, IJsonModel + { + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkAvailableVersion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkAvailableVersion)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkAvailableVersion)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkAvailableVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AppLinkAvailableVersion)PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkAvailableVersion)} does not support writing '{format}' format."); + } + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkAvailableVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AppLinkAvailableVersion)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkAvailableVersion)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkAvailableVersion(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkAvailableVersion DeserializeAppLinkAvailableVersion(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType resourceType = default; + SystemData systemData = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + AppLinkAvailableVersionProperties properties = default; + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("type"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("systemData"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerAppNetworkContext.Default); + continue; + } + if (prop.NameEquals("properties"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AppLinkAvailableVersionProperties.DeserializeAppLinkAvailableVersionProperties(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkAvailableVersion( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties, + properties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersion.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersion.cs new file mode 100644 index 000000000000..a50bcfdfdcf2 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersion.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; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLink available version resource. + public partial class AppLinkAvailableVersion : ResourceData + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal AppLinkAvailableVersion() + { + } + + /// Initializes a new instance of . + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// The resource-specific properties for this resource. + internal AppLinkAvailableVersion(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, AppLinkAvailableVersionProperties properties) : base(id, name, resourceType, systemData) + { + _additionalBinaryDataProperties = additionalBinaryDataProperties; + Properties = properties; + } + + /// The resource-specific properties for this resource. + public AppLinkAvailableVersionProperties Properties { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersionProperties.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersionProperties.Serialization.cs new file mode 100644 index 000000000000..7fa64faff82f --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersionProperties.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLink available version properties. + public partial class AppLinkAvailableVersionProperties : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkAvailableVersionProperties() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkAvailableVersionProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkAvailableVersionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkAvailableVersionProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkAvailableVersionProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkAvailableVersionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkAvailableVersionProperties)} does not support writing '{format}' format."); + } + writer.WritePropertyName("kubernetesVersion"u8); + writer.WriteStringValue(KubernetesVersion); + writer.WritePropertyName("fullyManagedVersions"u8); + writer.WriteObjectValue(FullyManagedVersions, options); + writer.WritePropertyName("selfManagedVersions"u8); + writer.WriteObjectValue(SelfManagedVersionDetail, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkAvailableVersionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkAvailableVersionProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkAvailableVersionProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkAvailableVersionProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkAvailableVersionProperties DeserializeAppLinkAvailableVersionProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string kubernetesVersion = default; + FullyManagedVersions fullyManagedVersions = default; + SelfManagedVersions selfManagedVersionDetail = default; + AppLinkProvisioningState? provisioningState = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("kubernetesVersion"u8)) + { + kubernetesVersion = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("fullyManagedVersions"u8)) + { + fullyManagedVersions = FullyManagedVersions.DeserializeFullyManagedVersions(prop.Value, options); + continue; + } + if (prop.NameEquals("selfManagedVersions"u8)) + { + selfManagedVersionDetail = SelfManagedVersions.DeserializeSelfManagedVersions(prop.Value, options); + continue; + } + if (prop.NameEquals("provisioningState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AppLinkProvisioningState(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkAvailableVersionProperties(kubernetesVersion, fullyManagedVersions, selfManagedVersionDetail, provisioningState, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersionProperties.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersionProperties.cs new file mode 100644 index 000000000000..e1f3acce3b76 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkAvailableVersionProperties.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.AppNetwork.Models +{ + /// AppLink available version properties. + public partial class AppLinkAvailableVersionProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Kubernetes version. + /// Fully managed versions. + /// Self managed versions. + internal AppLinkAvailableVersionProperties(string kubernetesVersion, FullyManagedVersions fullyManagedVersions, SelfManagedVersions selfManagedVersionDetail) + { + KubernetesVersion = kubernetesVersion; + FullyManagedVersions = fullyManagedVersions; + SelfManagedVersionDetail = selfManagedVersionDetail; + } + + /// Initializes a new instance of . + /// Kubernetes version. + /// Fully managed versions. + /// Self managed versions. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal AppLinkAvailableVersionProperties(string kubernetesVersion, FullyManagedVersions fullyManagedVersions, SelfManagedVersions selfManagedVersionDetail, AppLinkProvisioningState? provisioningState, IDictionary additionalBinaryDataProperties) + { + KubernetesVersion = kubernetesVersion; + FullyManagedVersions = fullyManagedVersions; + SelfManagedVersionDetail = selfManagedVersionDetail; + ProvisioningState = provisioningState; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Kubernetes version. + public string KubernetesVersion { get; } + + /// Fully managed versions. + internal FullyManagedVersions FullyManagedVersions { get; } + + /// Self managed versions. + internal SelfManagedVersions SelfManagedVersionDetail { get; } + + /// Provisioning state. + public AppLinkProvisioningState? ProvisioningState { get; } + + /// Release channels. + public IList FullyManagedVersionsReleaseChannels + { + get + { + return FullyManagedVersions is null ? default : FullyManagedVersions.ReleaseChannels; + } + } + + /// Istio versions. + public IList SelfManagedVersionDetailVersions + { + get + { + return SelfManagedVersionDetail is null ? default : SelfManagedVersionDetail.Versions; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkClusterType.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkClusterType.cs new file mode 100644 index 000000000000..eb0648522cd6 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkClusterType.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember cluster type. + public readonly partial struct AppLinkClusterType : IEquatable + { + private readonly string _value; + /// Azure Kubernetes Service. + private const string AksValue = "AKS"; + + /// Initializes a new instance of . + /// The value. + /// is null. + public AppLinkClusterType(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// Azure Kubernetes Service. + public static AppLinkClusterType Aks { get; } = new AppLinkClusterType(AksValue); + + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator ==(AppLinkClusterType left, AppLinkClusterType right) => left.Equals(right); + + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator !=(AppLinkClusterType left, AppLinkClusterType right) => !left.Equals(right); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkClusterType(string value) => new AppLinkClusterType(value); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkClusterType?(string value) => value == null ? null : new AppLinkClusterType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppLinkClusterType other && Equals(other); + + /// + public bool Equals(AppLinkClusterType 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkConnectivityProfile.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkConnectivityProfile.Serialization.cs new file mode 100644 index 000000000000..d56d7cec2a5f --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkConnectivityProfile.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember connectivity profile. + public partial class AppLinkConnectivityProfile : IJsonModel + { + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkConnectivityProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkConnectivityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkConnectivityProfile)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkConnectivityProfile)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkConnectivityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkConnectivityProfile)} does not support writing '{format}' format."); + } + if (Optional.IsDefined(EastWestGateway)) + { + writer.WritePropertyName("eastWestGateway"u8); + writer.WriteObjectValue(EastWestGateway, options); + } + if (Optional.IsDefined(PrivateConnect)) + { + writer.WritePropertyName("privateConnect"u8); + writer.WriteObjectValue(PrivateConnect, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkConnectivityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkConnectivityProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkConnectivityProfile)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkConnectivityProfile(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkConnectivityProfile DeserializeAppLinkConnectivityProfile(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EastWestGatewayProfile eastWestGateway = default; + PrivateConnectProfile privateConnect = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("eastWestGateway"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eastWestGateway = EastWestGatewayProfile.DeserializeEastWestGatewayProfile(prop.Value, options); + continue; + } + if (prop.NameEquals("privateConnect"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateConnect = PrivateConnectProfile.DeserializePrivateConnectProfile(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkConnectivityProfile(eastWestGateway, privateConnect, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkConnectivityProfile.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkConnectivityProfile.cs new file mode 100644 index 000000000000..13035466b644 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkConnectivityProfile.cs @@ -0,0 +1,68 @@ +// 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.AppNetwork.Models +{ + /// AppLinkMember connectivity profile. + public partial class AppLinkConnectivityProfile + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public AppLinkConnectivityProfile() + { + } + + /// Initializes a new instance of . + /// East-West gateway profile. + /// Private connect profile. + /// Keeps track of any properties unknown to the library. + internal AppLinkConnectivityProfile(EastWestGatewayProfile eastWestGateway, PrivateConnectProfile privateConnect, IDictionary additionalBinaryDataProperties) + { + EastWestGateway = eastWestGateway; + PrivateConnect = privateConnect; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// East-West gateway profile. + internal EastWestGatewayProfile EastWestGateway { get; set; } + + /// Private connect profile. + internal PrivateConnectProfile PrivateConnect { get; set; } + + /// East-West gateway visibility. + public AppLinkEastWestGatewayVisibility? EastWestGatewayVisibility + { + get + { + return EastWestGateway is null ? default : EastWestGateway.Visibility; + } + set + { + EastWestGateway = value.HasValue ? new EastWestGatewayProfile(value.Value) : default; + } + } + + /// Delegated Subnet to AppLink. + public ResourceIdentifier PrivateConnectSubnetResourceId + { + get + { + return PrivateConnect is null ? default : PrivateConnect.SubnetResourceId; + } + set + { + PrivateConnect = new PrivateConnectProfile(value); + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkEastWestGatewayVisibility.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkEastWestGatewayVisibility.cs new file mode 100644 index 000000000000..64786376cea7 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkEastWestGatewayVisibility.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// East-West gateway visibility. + public readonly partial struct AppLinkEastWestGatewayVisibility : IEquatable + { + private readonly string _value; + /// Use an internal load balancer for the east-west gateway. + private const string InternalValue = "Internal"; + /// Use an external load balancer for the east-west gateway. + private const string ExternalValue = "External"; + + /// Initializes a new instance of . + /// The value. + /// is null. + public AppLinkEastWestGatewayVisibility(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// Use an internal load balancer for the east-west gateway. + public static AppLinkEastWestGatewayVisibility Internal { get; } = new AppLinkEastWestGatewayVisibility(InternalValue); + + /// Use an external load balancer for the east-west gateway. + public static AppLinkEastWestGatewayVisibility External { get; } = new AppLinkEastWestGatewayVisibility(ExternalValue); + + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator ==(AppLinkEastWestGatewayVisibility left, AppLinkEastWestGatewayVisibility right) => left.Equals(right); + + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator !=(AppLinkEastWestGatewayVisibility left, AppLinkEastWestGatewayVisibility right) => !left.Equals(right); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkEastWestGatewayVisibility(string value) => new AppLinkEastWestGatewayVisibility(value); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkEastWestGatewayVisibility?(string value) => value == null ? null : new AppLinkEastWestGatewayVisibility(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppLinkEastWestGatewayVisibility other && Equals(other); + + /// + public bool Equals(AppLinkEastWestGatewayVisibility 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkListResult.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkListResult.Serialization.cs new file mode 100644 index 000000000000..9037201c6e19 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkListResult.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; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The response of a AppLink list operation. + internal partial class AppLinkListResult : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkListResult() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkListResult)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkListResult)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static AppLinkListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppLinkListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkListResult)} does not support writing '{format}' format."); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (AppLinkData 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" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkListResult)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkListResult(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkListResult DeserializeAppLinkListResult(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AppLinkData.DeserializeAppLinkData(item, options)); + } + value = array; + continue; + } + if (prop.NameEquals("nextLink"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString(), UriKind.RelativeOrAbsolute); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkListResult(value, nextLink, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkListResult.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkListResult.cs new file mode 100644 index 000000000000..894d28a1e350 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkListResult.cs @@ -0,0 +1,45 @@ +// 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.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The response of a AppLink list operation. + internal partial class AppLinkListResult + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The AppLink items on this page. + internal AppLinkListResult(IEnumerable value) + { + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AppLink items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AppLinkListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) + { + Value = value; + NextLink = nextLink; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The AppLink items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberListResult.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberListResult.Serialization.cs new file mode 100644 index 000000000000..cc69a31a04c6 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberListResult.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; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The response of a AppLinkMember list operation. + internal partial class AppLinkMemberListResult : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkMemberListResult() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkMemberListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkMemberListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkMemberListResult)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkMemberListResult)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkMemberListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static AppLinkMemberListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppLinkMemberListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberListResult)} does not support writing '{format}' format."); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (AppLinkMemberData 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" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkMemberListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkMemberListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberListResult)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkMemberListResult(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkMemberListResult DeserializeAppLinkMemberListResult(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AppLinkMemberData.DeserializeAppLinkMemberData(item, options)); + } + value = array; + continue; + } + if (prop.NameEquals("nextLink"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString(), UriKind.RelativeOrAbsolute); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkMemberListResult(value, nextLink, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberListResult.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberListResult.cs new file mode 100644 index 000000000000..390e4c877caf --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberListResult.cs @@ -0,0 +1,45 @@ +// 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.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The response of a AppLinkMember list operation. + internal partial class AppLinkMemberListResult + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The AppLinkMember items on this page. + internal AppLinkMemberListResult(IEnumerable value) + { + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AppLinkMember items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AppLinkMemberListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) + { + Value = value; + NextLink = nextLink; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The AppLinkMember items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberPatch.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberPatch.Serialization.cs new file mode 100644 index 000000000000..1ff1468d2caa --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberPatch.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.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The type used for update operations of the AppLinkMember. + public partial class AppLinkMemberPatch : IJsonModel + { + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkMemberPatch PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkMemberPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkMemberPatch)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkMemberPatch)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkMemberPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(AppLinkMemberPatch appLinkMemberPatch) + { + if (appLinkMemberPatch == null) + { + return null; + } + return RequestContent.Create(appLinkMemberPatch, ModelSerializationExtensions.WireOptions); + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberPatch)} 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); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkMemberPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkMemberPatch JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberPatch)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkMemberPatch(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkMemberPatch DeserializeAppLinkMemberPatch(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AppLinkMemberUpdateProperties properties = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("tags"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + tags = dictionary; + continue; + } + if (prop.NameEquals("properties"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AppLinkMemberUpdateProperties.DeserializeAppLinkMemberUpdateProperties(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkMemberPatch(tags ?? new ChangeTrackingDictionary(), properties, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberPatch.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberPatch.cs new file mode 100644 index 000000000000..df3ae145dc24 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberPatch.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; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The type used for update operations of the AppLinkMember. + public partial class AppLinkMemberPatch + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public AppLinkMemberPatch() + { + 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 AppLinkMemberPatch(IDictionary tags, AppLinkMemberUpdateProperties properties, IDictionary additionalBinaryDataProperties) + { + Tags = tags; + Properties = properties; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Resource tags. + public IDictionary Tags { get; } + + /// The resource-specific properties for this resource. + public AppLinkMemberUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberProperties.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberProperties.Serialization.cs new file mode 100644 index 000000000000..30ae167a6b3f --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberProperties.Serialization.cs @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLink Member properties. + public partial class AppLinkMemberProperties : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkMemberProperties() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkMemberProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkMemberProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkMemberProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkMemberProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkMemberProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberProperties)} does not support writing '{format}' format."); + } + if (Optional.IsDefined(ClusterType)) + { + writer.WritePropertyName("clusterType"u8); + writer.WriteStringValue(ClusterType.Value.ToString()); + } + writer.WritePropertyName("metadata"u8); + writer.WriteObjectValue(Metadata, options); + if (Optional.IsDefined(UpgradeProfile)) + { + writer.WritePropertyName("upgradeProfile"u8); + writer.WriteObjectValue(UpgradeProfile, options); + } + if (Optional.IsDefined(ObservabilityProfile)) + { + writer.WritePropertyName("observabilityProfile"u8); + writer.WriteObjectValue(ObservabilityProfile, options); + } + if (Optional.IsDefined(ConnectivityProfile)) + { + writer.WritePropertyName("connectivityProfile"u8); + writer.WriteObjectValue(ConnectivityProfile, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkMemberProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkMemberProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkMemberProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkMemberProperties DeserializeAppLinkMemberProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AppLinkClusterType? clusterType = default; + Metadata metadata = default; + AppLinkUpgradeProfile upgradeProfile = default; + ObservabilityProfile observabilityProfile = default; + AppLinkConnectivityProfile connectivityProfile = default; + AppLinkProvisioningState? provisioningState = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("clusterType"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clusterType = new AppLinkClusterType(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("metadata"u8)) + { + metadata = Metadata.DeserializeMetadata(prop.Value, options); + continue; + } + if (prop.NameEquals("upgradeProfile"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upgradeProfile = AppLinkUpgradeProfile.DeserializeAppLinkUpgradeProfile(prop.Value, options); + continue; + } + if (prop.NameEquals("observabilityProfile"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + observabilityProfile = ObservabilityProfile.DeserializeObservabilityProfile(prop.Value, options); + continue; + } + if (prop.NameEquals("connectivityProfile"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectivityProfile = AppLinkConnectivityProfile.DeserializeAppLinkConnectivityProfile(prop.Value, options); + continue; + } + if (prop.NameEquals("provisioningState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AppLinkProvisioningState(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkMemberProperties( + clusterType, + metadata, + upgradeProfile, + observabilityProfile, + connectivityProfile, + provisioningState, + additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberProperties.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberProperties.cs new file mode 100644 index 000000000000..706ad74dc902 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberProperties.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.Core; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLink Member properties. + public partial class AppLinkMemberProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Resource ID. + /// is null. + public AppLinkMemberProperties(ResourceIdentifier metadataResourceId) + { + Argument.AssertNotNull(metadataResourceId, nameof(metadataResourceId)); + + Metadata = new Metadata(metadataResourceId); + } + + /// Initializes a new instance of . + /// Cluster type. + /// AppLink Member Metadata. + /// Upgrade profile. + /// Observability profile. + /// Connectivity profile. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal AppLinkMemberProperties(AppLinkClusterType? clusterType, Metadata metadata, AppLinkUpgradeProfile upgradeProfile, ObservabilityProfile observabilityProfile, AppLinkConnectivityProfile connectivityProfile, AppLinkProvisioningState? provisioningState, IDictionary additionalBinaryDataProperties) + { + ClusterType = clusterType; + Metadata = metadata; + UpgradeProfile = upgradeProfile; + ObservabilityProfile = observabilityProfile; + ConnectivityProfile = connectivityProfile; + ProvisioningState = provisioningState; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Cluster type. + public AppLinkClusterType? ClusterType { get; set; } + + /// AppLink Member Metadata. + internal Metadata Metadata { get; set; } + + /// Upgrade profile. + public AppLinkUpgradeProfile UpgradeProfile { get; set; } + + /// Observability profile. + internal ObservabilityProfile ObservabilityProfile { get; set; } + + /// Connectivity profile. + public AppLinkConnectivityProfile ConnectivityProfile { get; set; } + + /// Provisioning state. + public AppLinkProvisioningState? ProvisioningState { get; } + + /// Resource ID. + public ResourceIdentifier MetadataResourceId + { + get + { + return Metadata is null ? default : Metadata.ResourceId; + } + set + { + Metadata = new Metadata(value); + } + } + + /// Metrics endpoint URL. + public string ObservabilityMetricsEndpoint + { + get + { + return ObservabilityProfile is null ? default : ObservabilityProfile.MetricsEndpoint; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberUpdateProperties.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..dee09fe6a334 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberUpdateProperties.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The updatable properties of the AppLinkMember. + public partial class AppLinkMemberUpdateProperties : IJsonModel + { + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkMemberUpdateProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkMemberUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkMemberUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkMemberUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkMemberUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberUpdateProperties)} does not support writing '{format}' format."); + } + if (Optional.IsDefined(UpgradeProfile)) + { + writer.WritePropertyName("upgradeProfile"u8); + writer.WriteObjectValue(UpgradeProfile, options); + } + if (Optional.IsDefined(ObservabilityProfile)) + { + writer.WritePropertyName("observabilityProfile"u8); + writer.WriteObjectValue(ObservabilityProfile, options); + } + if (Optional.IsDefined(ConnectivityProfile)) + { + writer.WritePropertyName("connectivityProfile"u8); + writer.WriteObjectValue(ConnectivityProfile, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkMemberUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkMemberUpdateProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkMemberUpdateProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkMemberUpdateProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkMemberUpdateProperties DeserializeAppLinkMemberUpdateProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AppLinkUpgradeProfile upgradeProfile = default; + ObservabilityProfile observabilityProfile = default; + AppLinkConnectivityProfile connectivityProfile = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("upgradeProfile"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upgradeProfile = AppLinkUpgradeProfile.DeserializeAppLinkUpgradeProfile(prop.Value, options); + continue; + } + if (prop.NameEquals("observabilityProfile"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + observabilityProfile = ObservabilityProfile.DeserializeObservabilityProfile(prop.Value, options); + continue; + } + if (prop.NameEquals("connectivityProfile"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectivityProfile = AppLinkConnectivityProfile.DeserializeAppLinkConnectivityProfile(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkMemberUpdateProperties(upgradeProfile, observabilityProfile, connectivityProfile, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberUpdateProperties.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberUpdateProperties.cs new file mode 100644 index 000000000000..9220e99695c2 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkMemberUpdateProperties.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.AppNetwork.Models +{ + /// The updatable properties of the AppLinkMember. + public partial class AppLinkMemberUpdateProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public AppLinkMemberUpdateProperties() + { + } + + /// Initializes a new instance of . + /// Upgrade profile. + /// Observability profile. + /// Connectivity profile. + /// Keeps track of any properties unknown to the library. + internal AppLinkMemberUpdateProperties(AppLinkUpgradeProfile upgradeProfile, ObservabilityProfile observabilityProfile, AppLinkConnectivityProfile connectivityProfile, IDictionary additionalBinaryDataProperties) + { + UpgradeProfile = upgradeProfile; + ObservabilityProfile = observabilityProfile; + ConnectivityProfile = connectivityProfile; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Upgrade profile. + public AppLinkUpgradeProfile UpgradeProfile { get; set; } + + /// Observability profile. + internal ObservabilityProfile ObservabilityProfile { get; set; } + + /// Connectivity profile. + public AppLinkConnectivityProfile ConnectivityProfile { get; set; } + + /// Metrics endpoint URL. + public string ObservabilityMetricsEndpoint + { + get + { + return ObservabilityProfile is null ? default : ObservabilityProfile.MetricsEndpoint; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkPatch.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkPatch.Serialization.cs new file mode 100644 index 000000000000..2a419aaf5ff5 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkPatch.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; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The type used for update operations of the AppLink. + public partial class AppLinkPatch : IJsonModel + { + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkPatch PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkPatch)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkPatch)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(AppLinkPatch appLinkPatch) + { + if (appLinkPatch == null) + { + return null; + } + return RequestContent.Create(appLinkPatch, ModelSerializationExtensions.WireOptions); + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkPatch)} 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); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkPatch JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkPatch)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkPatch(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkPatch DeserializeAppLinkPatch(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("tags"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkPatch(tags ?? new ChangeTrackingDictionary(), additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkPatch.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkPatch.cs new file mode 100644 index 000000000000..4953d6fec1fe --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkPatch.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The type used for update operations of the AppLink. + public partial class AppLinkPatch + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public AppLinkPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal AppLinkPatch(IDictionary tags, IDictionary additionalBinaryDataProperties) + { + Tags = tags; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkProperties.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkProperties.Serialization.cs new file mode 100644 index 000000000000..c449e314a9ec --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkProperties.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLink properties. + internal partial class AppLinkProperties : IJsonModel + { + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkProperties)} 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" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkProperties DeserializeAppLinkProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AppLinkProvisioningState? provisioningState = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("provisioningState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AppLinkProvisioningState(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkProperties(provisioningState, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkProperties.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkProperties.cs new file mode 100644 index 000000000000..e8edd581b251 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkProperties.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.AppNetwork.Models +{ + /// AppLink properties. + internal partial class AppLinkProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public AppLinkProperties() + { + } + + /// Initializes a new instance of . + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal AppLinkProperties(AppLinkProvisioningState? provisioningState, IDictionary additionalBinaryDataProperties) + { + ProvisioningState = provisioningState; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Provisioning state. + public AppLinkProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkProvisioningState.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkProvisioningState.cs new file mode 100644 index 000000000000..dd168eb6f7fb --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkProvisioningState.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// Provisioning state of the resource. + public readonly partial struct AppLinkProvisioningState : IEquatable + { + private readonly string _value; + /// Resource has been created. + private const string SucceededValue = "Succeeded"; + /// Resource creation failed. + private const string FailedValue = "Failed"; + /// Resource creation was canceled. + private const string CanceledValue = "Canceled"; + /// Resource is getting provisioned. + private const string ProvisioningValue = "Provisioning"; + /// Resource is Updating. + private const string UpdatingValue = "Updating"; + /// Resource is Deleting. + private const string DeletingValue = "Deleting"; + /// Resource has been Accepted. + private const string AcceptedValue = "Accepted"; + + /// Initializes a new instance of . + /// The value. + /// is null. + public AppLinkProvisioningState(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// Resource has been created. + public static AppLinkProvisioningState Succeeded { get; } = new AppLinkProvisioningState(SucceededValue); + + /// Resource creation failed. + public static AppLinkProvisioningState Failed { get; } = new AppLinkProvisioningState(FailedValue); + + /// Resource creation was canceled. + public static AppLinkProvisioningState Canceled { get; } = new AppLinkProvisioningState(CanceledValue); + + /// Resource is getting provisioned. + public static AppLinkProvisioningState Provisioning { get; } = new AppLinkProvisioningState(ProvisioningValue); + + /// Resource is Updating. + public static AppLinkProvisioningState Updating { get; } = new AppLinkProvisioningState(UpdatingValue); + + /// Resource is Deleting. + public static AppLinkProvisioningState Deleting { get; } = new AppLinkProvisioningState(DeletingValue); + + /// Resource has been Accepted. + public static AppLinkProvisioningState Accepted { get; } = new AppLinkProvisioningState(AcceptedValue); + + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator ==(AppLinkProvisioningState left, AppLinkProvisioningState right) => left.Equals(right); + + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator !=(AppLinkProvisioningState left, AppLinkProvisioningState right) => !left.Equals(right); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkProvisioningState(string value) => new AppLinkProvisioningState(value); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkProvisioningState?(string value) => value == null ? null : new AppLinkProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppLinkProvisioningState other && Equals(other); + + /// + public bool Equals(AppLinkProvisioningState 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkReleaseChannelInfo.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkReleaseChannelInfo.Serialization.cs new file mode 100644 index 000000000000..171e8850a2d4 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkReleaseChannelInfo.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// Release channel information. + public partial class AppLinkReleaseChannelInfo : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkReleaseChannelInfo() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkReleaseChannelInfo PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkReleaseChannelInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkReleaseChannelInfo)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkReleaseChannelInfo)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkReleaseChannelInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkReleaseChannelInfo)} does not support writing '{format}' format."); + } + writer.WritePropertyName("releaseChannel"u8); + writer.WriteStringValue(ReleaseChannel); + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkReleaseChannelInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkReleaseChannelInfo JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkReleaseChannelInfo)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkReleaseChannelInfo(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkReleaseChannelInfo DeserializeAppLinkReleaseChannelInfo(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string releaseChannel = default; + string version = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("releaseChannel"u8)) + { + releaseChannel = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("version"u8)) + { + version = prop.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkReleaseChannelInfo(releaseChannel, version, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkReleaseChannelInfo.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkReleaseChannelInfo.cs new file mode 100644 index 000000000000..148458b5b2c1 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkReleaseChannelInfo.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// Release channel information. + public partial class AppLinkReleaseChannelInfo + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Release channel. + /// Istio version behind release channel. + internal AppLinkReleaseChannelInfo(string releaseChannel, string version) + { + ReleaseChannel = releaseChannel; + Version = version; + } + + /// Initializes a new instance of . + /// Release channel. + /// Istio version behind release channel. + /// Keeps track of any properties unknown to the library. + internal AppLinkReleaseChannelInfo(string releaseChannel, string version, IDictionary additionalBinaryDataProperties) + { + ReleaseChannel = releaseChannel; + Version = version; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Release channel. + public string ReleaseChannel { get; } + + /// Istio version behind release channel. + public string Version { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistory.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistory.Serialization.cs new file mode 100644 index 000000000000..ecbe3c4b9e0e --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistory.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; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppNetwork; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember upgrade history. + public partial class AppLinkUpgradeHistory : ResourceData, IJsonModel + { + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkUpgradeHistory(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkUpgradeHistory)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkUpgradeHistory)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkUpgradeHistory IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AppLinkUpgradeHistory)PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkUpgradeHistory)} does not support writing '{format}' format."); + } + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkUpgradeHistory IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AppLinkUpgradeHistory)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkUpgradeHistory)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkUpgradeHistory(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkUpgradeHistory DeserializeAppLinkUpgradeHistory(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType resourceType = default; + SystemData systemData = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + AppLinkUpgradeHistoryProperties properties = default; + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("type"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("systemData"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerAppNetworkContext.Default); + continue; + } + if (prop.NameEquals("properties"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AppLinkUpgradeHistoryProperties.DeserializeAppLinkUpgradeHistoryProperties(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkUpgradeHistory( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties, + properties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistory.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistory.cs new file mode 100644 index 000000000000..28fa22697cac --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistory.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; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember upgrade history. + public partial class AppLinkUpgradeHistory : ResourceData + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal AppLinkUpgradeHistory() + { + } + + /// Initializes a new instance of . + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// The resource-specific properties for this resource. + internal AppLinkUpgradeHistory(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, AppLinkUpgradeHistoryProperties properties) : base(id, name, resourceType, systemData) + { + _additionalBinaryDataProperties = additionalBinaryDataProperties; + Properties = properties; + } + + /// The resource-specific properties for this resource. + public AppLinkUpgradeHistoryProperties Properties { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistoryProperties.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistoryProperties.Serialization.cs new file mode 100644 index 000000000000..d9e5a274388f --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistoryProperties.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember upgrade history properties. + public partial class AppLinkUpgradeHistoryProperties : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkUpgradeHistoryProperties() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkUpgradeHistoryProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkUpgradeHistoryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkUpgradeHistoryProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkUpgradeHistoryProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkUpgradeHistoryProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkUpgradeHistoryProperties)} does not support writing '{format}' format."); + } + writer.WritePropertyName("startTimestamp"u8); + writer.WriteStringValue(StartOn, "O"); + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTimestamp"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + writer.WritePropertyName("initiatedBy"u8); + writer.WriteStringValue(InitiatedBy); + writer.WritePropertyName("fromVersion"u8); + writer.WriteStringValue(FromVersion); + writer.WritePropertyName("toVersion"u8); + writer.WriteStringValue(ToVersion); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkUpgradeHistoryProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkUpgradeHistoryProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkUpgradeHistoryProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkUpgradeHistoryProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkUpgradeHistoryProperties DeserializeAppLinkUpgradeHistoryProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset startOn = default; + DateTimeOffset? endOn = default; + string initiatedBy = default; + string fromVersion = default; + string toVersion = default; + AppLinkProvisioningState? provisioningState = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("startTimestamp"u8)) + { + startOn = prop.Value.GetDateTimeOffset("O"); + continue; + } + if (prop.NameEquals("endTimestamp"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endOn = prop.Value.GetDateTimeOffset("O"); + continue; + } + if (prop.NameEquals("initiatedBy"u8)) + { + initiatedBy = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("fromVersion"u8)) + { + fromVersion = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("toVersion"u8)) + { + toVersion = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("provisioningState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AppLinkProvisioningState(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkUpgradeHistoryProperties( + startOn, + endOn, + initiatedBy, + fromVersion, + toVersion, + provisioningState, + additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistoryProperties.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistoryProperties.cs new file mode 100644 index 000000000000..5edf29eee48d --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeHistoryProperties.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.AppNetwork.Models +{ + /// AppLinkMember upgrade history properties. + public partial class AppLinkUpgradeHistoryProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Start timestamp. + /// Upgrade initiator. + /// Version upgraded from. + /// Version upgraded to. + internal AppLinkUpgradeHistoryProperties(DateTimeOffset startOn, string initiatedBy, string fromVersion, string toVersion) + { + StartOn = startOn; + InitiatedBy = initiatedBy; + FromVersion = fromVersion; + ToVersion = toVersion; + } + + /// Initializes a new instance of . + /// Start timestamp. + /// End timestamp. + /// Upgrade initiator. + /// Version upgraded from. + /// Version upgraded to. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal AppLinkUpgradeHistoryProperties(DateTimeOffset startOn, DateTimeOffset? endOn, string initiatedBy, string fromVersion, string toVersion, AppLinkProvisioningState? provisioningState, IDictionary additionalBinaryDataProperties) + { + StartOn = startOn; + EndOn = endOn; + InitiatedBy = initiatedBy; + FromVersion = fromVersion; + ToVersion = toVersion; + ProvisioningState = provisioningState; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Start timestamp. + public DateTimeOffset StartOn { get; } + + /// End timestamp. + public DateTimeOffset? EndOn { get; } + + /// Upgrade initiator. + public string InitiatedBy { get; } + + /// Version upgraded from. + public string FromVersion { get; } + + /// Version upgraded to. + public string ToVersion { get; } + + /// Provisioning state. + public AppLinkProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeMode.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeMode.cs new file mode 100644 index 000000000000..b10e4a1926ba --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeMode.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember upgrade mode. + public readonly partial struct AppLinkUpgradeMode : IEquatable + { + private readonly string _value; + /// Fully managed upgrade mode. + private const string FullyManagedValue = "FullyManaged"; + /// Self managed upgrade mode. + private const string SelfManagedValue = "SelfManaged"; + + /// Initializes a new instance of . + /// The value. + /// is null. + public AppLinkUpgradeMode(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// Fully managed upgrade mode. + public static AppLinkUpgradeMode FullyManaged { get; } = new AppLinkUpgradeMode(FullyManagedValue); + + /// Self managed upgrade mode. + public static AppLinkUpgradeMode SelfManaged { get; } = new AppLinkUpgradeMode(SelfManagedValue); + + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator ==(AppLinkUpgradeMode left, AppLinkUpgradeMode right) => left.Equals(right); + + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator !=(AppLinkUpgradeMode left, AppLinkUpgradeMode right) => !left.Equals(right); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkUpgradeMode(string value) => new AppLinkUpgradeMode(value); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkUpgradeMode?(string value) => value == null ? null : new AppLinkUpgradeMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppLinkUpgradeMode other && Equals(other); + + /// + public bool Equals(AppLinkUpgradeMode 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeProfile.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeProfile.Serialization.cs new file mode 100644 index 000000000000..8332b17cafaf --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeProfile.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember upgrade profile. + public partial class AppLinkUpgradeProfile : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkUpgradeProfile() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkUpgradeProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkUpgradeProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkUpgradeProfile)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkUpgradeProfile)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkUpgradeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkUpgradeProfile)} does not support writing '{format}' format."); + } + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.ToString()); + if (Optional.IsDefined(FullyManagedUpgradeProfile)) + { + writer.WritePropertyName("fullyManagedUpgradeProfile"u8); + writer.WriteObjectValue(FullyManagedUpgradeProfile, options); + } + if (Optional.IsDefined(SelfManagedUpgradeProfile)) + { + writer.WritePropertyName("selfManagedUpgradeProfile"u8); + writer.WriteObjectValue(SelfManagedUpgradeProfile, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkUpgradeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkUpgradeProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkUpgradeProfile)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkUpgradeProfile(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkUpgradeProfile DeserializeAppLinkUpgradeProfile(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AppLinkUpgradeMode mode = default; + FullyManagedUpgradeProfile fullyManagedUpgradeProfile = default; + SelfManagedUpgradeProfile selfManagedUpgradeProfile = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("mode"u8)) + { + mode = new AppLinkUpgradeMode(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("fullyManagedUpgradeProfile"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fullyManagedUpgradeProfile = FullyManagedUpgradeProfile.DeserializeFullyManagedUpgradeProfile(prop.Value, options); + continue; + } + if (prop.NameEquals("selfManagedUpgradeProfile"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selfManagedUpgradeProfile = SelfManagedUpgradeProfile.DeserializeSelfManagedUpgradeProfile(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkUpgradeProfile(mode, fullyManagedUpgradeProfile, selfManagedUpgradeProfile, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeProfile.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeProfile.cs new file mode 100644 index 000000000000..9fbb39847d35 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeProfile.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.AppNetwork.Models +{ + /// AppLinkMember upgrade profile. + public partial class AppLinkUpgradeProfile + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Upgrade mode. + public AppLinkUpgradeProfile(AppLinkUpgradeMode mode) + { + Mode = mode; + } + + /// Initializes a new instance of . + /// Upgrade mode. + /// Fully managed upgrade profile. + /// Self managed upgrade profile. + /// Keeps track of any properties unknown to the library. + internal AppLinkUpgradeProfile(AppLinkUpgradeMode mode, FullyManagedUpgradeProfile fullyManagedUpgradeProfile, SelfManagedUpgradeProfile selfManagedUpgradeProfile, IDictionary additionalBinaryDataProperties) + { + Mode = mode; + FullyManagedUpgradeProfile = fullyManagedUpgradeProfile; + SelfManagedUpgradeProfile = selfManagedUpgradeProfile; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Upgrade mode. + public AppLinkUpgradeMode Mode { get; set; } + + /// Fully managed upgrade profile. + internal FullyManagedUpgradeProfile FullyManagedUpgradeProfile { get; set; } + + /// Self managed upgrade profile. + internal SelfManagedUpgradeProfile SelfManagedUpgradeProfile { get; set; } + + /// Release channel. + public AppLinkUpgradeReleaseChannel? FullyManagedUpgradeReleaseChannel + { + get + { + return FullyManagedUpgradeProfile is null ? default : FullyManagedUpgradeProfile.ReleaseChannel; + } + set + { + FullyManagedUpgradeProfile = value.HasValue ? new FullyManagedUpgradeProfile(value.Value) : default; + } + } + + /// Istio version. + public string SelfManagedUpgradeVersion + { + get + { + return SelfManagedUpgradeProfile is null ? default : SelfManagedUpgradeProfile.Version; + } + set + { + SelfManagedUpgradeProfile = new SelfManagedUpgradeProfile(value); + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeReleaseChannel.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeReleaseChannel.cs new file mode 100644 index 000000000000..70392fe82bcc --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkUpgradeReleaseChannel.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember upgrade release channel. + public readonly partial struct AppLinkUpgradeReleaseChannel : IEquatable + { + private readonly string _value; + /// Rapid release channel. + private const string RapidValue = "Rapid"; + /// Stable release channel. + private const string StableValue = "Stable"; + + /// Initializes a new instance of . + /// The value. + /// is null. + public AppLinkUpgradeReleaseChannel(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// Rapid release channel. + public static AppLinkUpgradeReleaseChannel Rapid { get; } = new AppLinkUpgradeReleaseChannel(RapidValue); + + /// Stable release channel. + public static AppLinkUpgradeReleaseChannel Stable { get; } = new AppLinkUpgradeReleaseChannel(StableValue); + + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator ==(AppLinkUpgradeReleaseChannel left, AppLinkUpgradeReleaseChannel right) => left.Equals(right); + + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator !=(AppLinkUpgradeReleaseChannel left, AppLinkUpgradeReleaseChannel right) => !left.Equals(right); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkUpgradeReleaseChannel(string value) => new AppLinkUpgradeReleaseChannel(value); + + /// Converts a string to a . + /// The value. + public static implicit operator AppLinkUpgradeReleaseChannel?(string value) => value == null ? null : new AppLinkUpgradeReleaseChannel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppLinkUpgradeReleaseChannel other && Equals(other); + + /// + public bool Equals(AppLinkUpgradeReleaseChannel 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/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkVersionInfo.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkVersionInfo.Serialization.cs new file mode 100644 index 000000000000..194b296a15d6 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkVersionInfo.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// Version information. + public partial class AppLinkVersionInfo : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AppLinkVersionInfo() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppLinkVersionInfo PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAppLinkVersionInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppLinkVersionInfo)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AppLinkVersionInfo)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AppLinkVersionInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkVersionInfo)} does not support writing '{format}' format."); + } + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + writer.WritePropertyName("upgrades"u8); + writer.WriteStartArray(); + foreach (string item in Upgrades) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AppLinkVersionInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppLinkVersionInfo JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppLinkVersionInfo)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppLinkVersionInfo(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppLinkVersionInfo DeserializeAppLinkVersionInfo(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + IList upgrades = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("version"u8)) + { + version = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("upgrades"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } + } + upgrades = array; + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AppLinkVersionInfo(version, upgrades, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkVersionInfo.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkVersionInfo.cs new file mode 100644 index 000000000000..9108ab3023c4 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AppLinkVersionInfo.cs @@ -0,0 +1,46 @@ +// 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.AppNetwork.Models +{ + /// Version information. + public partial class AppLinkVersionInfo + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Istio version. + /// Available upgrades. + internal AppLinkVersionInfo(string version, IEnumerable upgrades) + { + Version = version; + Upgrades = upgrades.ToList(); + } + + /// Initializes a new instance of . + /// Istio version. + /// Available upgrades. + /// Keeps track of any properties unknown to the library. + internal AppLinkVersionInfo(string version, IList upgrades, IDictionary additionalBinaryDataProperties) + { + Version = version; + Upgrades = upgrades; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Istio version. + public string Version { get; } + + /// Available upgrades. + public IList Upgrades { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AvailableVersionListResult.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AvailableVersionListResult.Serialization.cs new file mode 100644 index 000000000000..c743925c2dbb --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AvailableVersionListResult.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; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The response of a AvailableVersion list operation. + internal partial class AvailableVersionListResult : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal AvailableVersionListResult() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AvailableVersionListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeAvailableVersionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvailableVersionListResult)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(AvailableVersionListResult)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + AvailableVersionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static AvailableVersionListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvailableVersionListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvailableVersionListResult)} does not support writing '{format}' format."); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (AppLinkAvailableVersion 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" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + AvailableVersionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AvailableVersionListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvailableVersionListResult)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvailableVersionListResult(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvailableVersionListResult DeserializeAvailableVersionListResult(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AppLinkAvailableVersion.DeserializeAppLinkAvailableVersion(item, options)); + } + value = array; + continue; + } + if (prop.NameEquals("nextLink"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString(), UriKind.RelativeOrAbsolute); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new AvailableVersionListResult(value, nextLink, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AvailableVersionListResult.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AvailableVersionListResult.cs new file mode 100644 index 000000000000..bead29d48fa3 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AvailableVersionListResult.cs @@ -0,0 +1,44 @@ +// 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.AppNetwork.Models +{ + /// The response of a AvailableVersion list operation. + internal partial class AvailableVersionListResult + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The AvailableVersion items on this page. + internal AvailableVersionListResult(IEnumerable value) + { + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AvailableVersion items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AvailableVersionListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) + { + Value = value; + NextLink = nextLink; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The AvailableVersion items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AzureResourceManagerAppNetworkContext.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AzureResourceManagerAppNetworkContext.cs new file mode 100644 index 000000000000..c08e697c54fd --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/AzureResourceManagerAppNetworkContext.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using Azure; +using Azure.ResourceManager.AppNetwork.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppNetwork +{ + /// + /// Context class which will be filled in by the System.ClientModel.SourceGeneration. + /// For more information + /// + [ModelReaderWriterBuildable(typeof(AppLinkAvailableVersion))] + [ModelReaderWriterBuildable(typeof(AppLinkAvailableVersionProperties))] + [ModelReaderWriterBuildable(typeof(AppLinkConnectivityProfile))] + [ModelReaderWriterBuildable(typeof(AppLinkData))] + [ModelReaderWriterBuildable(typeof(AppLinkListResult))] + [ModelReaderWriterBuildable(typeof(AppLinkMemberData))] + [ModelReaderWriterBuildable(typeof(AppLinkMemberListResult))] + [ModelReaderWriterBuildable(typeof(AppLinkMemberPatch))] + [ModelReaderWriterBuildable(typeof(AppLinkMemberProperties))] + [ModelReaderWriterBuildable(typeof(AppLinkMemberResource))] + [ModelReaderWriterBuildable(typeof(AppLinkMemberUpdateProperties))] + [ModelReaderWriterBuildable(typeof(AppLinkPatch))] + [ModelReaderWriterBuildable(typeof(AppLinkProperties))] + [ModelReaderWriterBuildable(typeof(AppLinkReleaseChannelInfo))] + [ModelReaderWriterBuildable(typeof(AppLinkResource))] + [ModelReaderWriterBuildable(typeof(AppLinkUpgradeHistory))] + [ModelReaderWriterBuildable(typeof(AppLinkUpgradeHistoryProperties))] + [ModelReaderWriterBuildable(typeof(AppLinkUpgradeProfile))] + [ModelReaderWriterBuildable(typeof(AppLinkVersionInfo))] + [ModelReaderWriterBuildable(typeof(AvailableVersionListResult))] + [ModelReaderWriterBuildable(typeof(EastWestGatewayProfile))] + [ModelReaderWriterBuildable(typeof(FullyManagedUpgradeProfile))] + [ModelReaderWriterBuildable(typeof(FullyManagedVersions))] + [ModelReaderWriterBuildable(typeof(ManagedServiceIdentity))] + [ModelReaderWriterBuildable(typeof(Metadata))] + [ModelReaderWriterBuildable(typeof(MetricsProfile))] + [ModelReaderWriterBuildable(typeof(ObservabilityProfile))] + [ModelReaderWriterBuildable(typeof(PrivateConnectProfile))] + [ModelReaderWriterBuildable(typeof(ResponseError))] + [ModelReaderWriterBuildable(typeof(SelfManagedUpgradeProfile))] + [ModelReaderWriterBuildable(typeof(SelfManagedVersions))] + [ModelReaderWriterBuildable(typeof(SystemData))] + [ModelReaderWriterBuildable(typeof(UpgradeHistoryListResult))] + [ModelReaderWriterBuildable(typeof(UserAssignedIdentity))] + public partial class AzureResourceManagerAppNetworkContext : ModelReaderWriterContext + { + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/EastWestGatewayProfile.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/EastWestGatewayProfile.Serialization.cs new file mode 100644 index 000000000000..a1a7e1a54897 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/EastWestGatewayProfile.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember east-west gateway profile. + internal partial class EastWestGatewayProfile : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal EastWestGatewayProfile() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual EastWestGatewayProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeEastWestGatewayProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EastWestGatewayProfile)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(EastWestGatewayProfile)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + EastWestGatewayProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EastWestGatewayProfile)} does not support writing '{format}' format."); + } + writer.WritePropertyName("visibility"u8); + writer.WriteStringValue(Visibility.ToString()); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + EastWestGatewayProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual EastWestGatewayProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EastWestGatewayProfile)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEastWestGatewayProfile(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static EastWestGatewayProfile DeserializeEastWestGatewayProfile(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AppLinkEastWestGatewayVisibility visibility = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("visibility"u8)) + { + visibility = new AppLinkEastWestGatewayVisibility(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new EastWestGatewayProfile(visibility, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/EastWestGatewayProfile.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/EastWestGatewayProfile.cs new file mode 100644 index 000000000000..89a2f6bac733 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/EastWestGatewayProfile.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember east-west gateway profile. + internal partial class EastWestGatewayProfile + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// East-West gateway visibility. + public EastWestGatewayProfile(AppLinkEastWestGatewayVisibility visibility) + { + Visibility = visibility; + } + + /// Initializes a new instance of . + /// East-West gateway visibility. + /// Keeps track of any properties unknown to the library. + internal EastWestGatewayProfile(AppLinkEastWestGatewayVisibility visibility, IDictionary additionalBinaryDataProperties) + { + Visibility = visibility; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// East-West gateway visibility. + public AppLinkEastWestGatewayVisibility Visibility { get; set; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedUpgradeProfile.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedUpgradeProfile.Serialization.cs new file mode 100644 index 000000000000..2efbc5f76457 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedUpgradeProfile.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember fully managed upgrade profile. + internal partial class FullyManagedUpgradeProfile : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal FullyManagedUpgradeProfile() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual FullyManagedUpgradeProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeFullyManagedUpgradeProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FullyManagedUpgradeProfile)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(FullyManagedUpgradeProfile)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + FullyManagedUpgradeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FullyManagedUpgradeProfile)} does not support writing '{format}' format."); + } + writer.WritePropertyName("releaseChannel"u8); + writer.WriteStringValue(ReleaseChannel.ToString()); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + FullyManagedUpgradeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual FullyManagedUpgradeProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FullyManagedUpgradeProfile)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFullyManagedUpgradeProfile(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static FullyManagedUpgradeProfile DeserializeFullyManagedUpgradeProfile(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AppLinkUpgradeReleaseChannel releaseChannel = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("releaseChannel"u8)) + { + releaseChannel = new AppLinkUpgradeReleaseChannel(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new FullyManagedUpgradeProfile(releaseChannel, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedUpgradeProfile.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedUpgradeProfile.cs new file mode 100644 index 000000000000..1564c53b9c8b --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedUpgradeProfile.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember fully managed upgrade profile. + internal partial class FullyManagedUpgradeProfile + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Release channel. + public FullyManagedUpgradeProfile(AppLinkUpgradeReleaseChannel releaseChannel) + { + ReleaseChannel = releaseChannel; + } + + /// Initializes a new instance of . + /// Release channel. + /// Keeps track of any properties unknown to the library. + internal FullyManagedUpgradeProfile(AppLinkUpgradeReleaseChannel releaseChannel, IDictionary additionalBinaryDataProperties) + { + ReleaseChannel = releaseChannel; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Release channel. + public AppLinkUpgradeReleaseChannel ReleaseChannel { get; set; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedVersions.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedVersions.Serialization.cs new file mode 100644 index 000000000000..4b59cb893b24 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedVersions.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// Fully managed versions. + internal partial class FullyManagedVersions : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal FullyManagedVersions() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual FullyManagedVersions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeFullyManagedVersions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FullyManagedVersions)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(FullyManagedVersions)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + FullyManagedVersions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FullyManagedVersions)} does not support writing '{format}' format."); + } + writer.WritePropertyName("releaseChannels"u8); + writer.WriteStartArray(); + foreach (AppLinkReleaseChannelInfo item in ReleaseChannels) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + FullyManagedVersions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual FullyManagedVersions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FullyManagedVersions)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFullyManagedVersions(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static FullyManagedVersions DeserializeFullyManagedVersions(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList releaseChannels = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("releaseChannels"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AppLinkReleaseChannelInfo.DeserializeAppLinkReleaseChannelInfo(item, options)); + } + releaseChannels = array; + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new FullyManagedVersions(releaseChannels, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedVersions.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedVersions.cs new file mode 100644 index 000000000000..fefe2ba1471d --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/FullyManagedVersions.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; +using System.Linq; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// Fully managed versions. + internal partial class FullyManagedVersions + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Release channels. + internal FullyManagedVersions(IEnumerable releaseChannels) + { + ReleaseChannels = releaseChannels.ToList(); + } + + /// Initializes a new instance of . + /// Release channels. + /// Keeps track of any properties unknown to the library. + internal FullyManagedVersions(IList releaseChannels, IDictionary additionalBinaryDataProperties) + { + ReleaseChannels = releaseChannels; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Release channels. + public IList ReleaseChannels { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/Metadata.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/Metadata.Serialization.cs new file mode 100644 index 000000000000..f0553e7b8b2b --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/Metadata.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; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember metadata. + internal partial class Metadata : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal Metadata() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual Metadata PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Metadata)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(Metadata)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + Metadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Metadata)} does not support writing '{format}' format."); + } + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + Metadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual Metadata JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Metadata)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMetadata(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static Metadata DeserializeMetadata(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier resourceId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("resourceId"u8)) + { + resourceId = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new Metadata(resourceId, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/Metadata.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/Metadata.cs new file mode 100644 index 000000000000..6ce16bce8338 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/Metadata.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; +using Azure.Core; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember metadata. + internal partial class Metadata + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Resource ID. + /// is null. + public Metadata(ResourceIdentifier resourceId) + { + Argument.AssertNotNull(resourceId, nameof(resourceId)); + + ResourceId = resourceId; + } + + /// Initializes a new instance of . + /// Resource ID. + /// Keeps track of any properties unknown to the library. + internal Metadata(ResourceIdentifier resourceId, IDictionary additionalBinaryDataProperties) + { + ResourceId = resourceId; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Resource ID. + public ResourceIdentifier ResourceId { get; set; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/MetricsProfile.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/MetricsProfile.Serialization.cs new file mode 100644 index 000000000000..8eeecb7c20b3 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/MetricsProfile.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember metrics profile. + internal partial class MetricsProfile : IJsonModel + { + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MetricsProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeMetricsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MetricsProfile)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(MetricsProfile)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + MetricsProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MetricsProfile)} does not support writing '{format}' format."); + } + if (options.Format != "W" && Optional.IsDefined(MetricsEndpoint)) + { + writer.WritePropertyName("metricsEndpoint"u8); + writer.WriteStringValue(MetricsEndpoint); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + MetricsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MetricsProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MetricsProfile)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMetricsProfile(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MetricsProfile DeserializeMetricsProfile(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string metricsEndpoint = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("metricsEndpoint"u8)) + { + metricsEndpoint = prop.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new MetricsProfile(metricsEndpoint, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/MetricsProfile.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/MetricsProfile.cs new file mode 100644 index 000000000000..e263b72665ee --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/MetricsProfile.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.AppNetwork.Models +{ + /// AppLinkMember metrics profile. + internal partial class MetricsProfile + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public MetricsProfile() + { + } + + /// Initializes a new instance of . + /// Metrics endpoint URL. + /// Keeps track of any properties unknown to the library. + internal MetricsProfile(string metricsEndpoint, IDictionary additionalBinaryDataProperties) + { + MetricsEndpoint = metricsEndpoint; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Metrics endpoint URL. + public string MetricsEndpoint { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/ObservabilityProfile.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/ObservabilityProfile.Serialization.cs new file mode 100644 index 000000000000..ff9897ab2021 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/ObservabilityProfile.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember observability profile. + internal partial class ObservabilityProfile : IJsonModel + { + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ObservabilityProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeObservabilityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ObservabilityProfile)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(ObservabilityProfile)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + ObservabilityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ObservabilityProfile)} does not support writing '{format}' format."); + } + if (Optional.IsDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteObjectValue(Metrics, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + ObservabilityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ObservabilityProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ObservabilityProfile)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeObservabilityProfile(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ObservabilityProfile DeserializeObservabilityProfile(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MetricsProfile metrics = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("metrics"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metrics = MetricsProfile.DeserializeMetricsProfile(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new ObservabilityProfile(metrics, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/ObservabilityProfile.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/ObservabilityProfile.cs new file mode 100644 index 000000000000..03abeadba782 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/ObservabilityProfile.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember observability profile. + internal partial class ObservabilityProfile + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public ObservabilityProfile() + { + } + + /// Initializes a new instance of . + /// Metrics configuration. + /// Keeps track of any properties unknown to the library. + internal ObservabilityProfile(MetricsProfile metrics, IDictionary additionalBinaryDataProperties) + { + Metrics = metrics; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Metrics configuration. + internal MetricsProfile Metrics { get; set; } + + /// Metrics endpoint URL. + public string MetricsEndpoint + { + get + { + return Metrics is null ? default : Metrics.MetricsEndpoint; + } + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/PrivateConnectProfile.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/PrivateConnectProfile.Serialization.cs new file mode 100644 index 000000000000..69c509f3971d --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/PrivateConnectProfile.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; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember private connect profile. + internal partial class PrivateConnectProfile : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal PrivateConnectProfile() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual PrivateConnectProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializePrivateConnectProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateConnectProfile)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(PrivateConnectProfile)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + PrivateConnectProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateConnectProfile)} does not support writing '{format}' format."); + } + writer.WritePropertyName("subnetResourceId"u8); + writer.WriteStringValue(SubnetResourceId); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + PrivateConnectProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual PrivateConnectProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateConnectProfile)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateConnectProfile(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static PrivateConnectProfile DeserializePrivateConnectProfile(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier subnetResourceId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("subnetResourceId"u8)) + { + subnetResourceId = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new PrivateConnectProfile(subnetResourceId, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/PrivateConnectProfile.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/PrivateConnectProfile.cs new file mode 100644 index 000000000000..4a14c94637f5 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/PrivateConnectProfile.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; +using Azure.Core; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember private connect profile. + internal partial class PrivateConnectProfile + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Delegated Subnet to AppLink. + /// is null. + public PrivateConnectProfile(ResourceIdentifier subnetResourceId) + { + Argument.AssertNotNull(subnetResourceId, nameof(subnetResourceId)); + + SubnetResourceId = subnetResourceId; + } + + /// Initializes a new instance of . + /// Delegated Subnet to AppLink. + /// Keeps track of any properties unknown to the library. + internal PrivateConnectProfile(ResourceIdentifier subnetResourceId, IDictionary additionalBinaryDataProperties) + { + SubnetResourceId = subnetResourceId; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Delegated Subnet to AppLink. + public ResourceIdentifier SubnetResourceId { get; set; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedUpgradeProfile.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedUpgradeProfile.Serialization.cs new file mode 100644 index 000000000000..cb7fe98d5d54 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedUpgradeProfile.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember self managed upgrade profile. + internal partial class SelfManagedUpgradeProfile : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal SelfManagedUpgradeProfile() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SelfManagedUpgradeProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeSelfManagedUpgradeProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SelfManagedUpgradeProfile)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(SelfManagedUpgradeProfile)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + SelfManagedUpgradeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfManagedUpgradeProfile)} does not support writing '{format}' format."); + } + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + SelfManagedUpgradeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SelfManagedUpgradeProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfManagedUpgradeProfile)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSelfManagedUpgradeProfile(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SelfManagedUpgradeProfile DeserializeSelfManagedUpgradeProfile(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("version"u8)) + { + version = prop.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new SelfManagedUpgradeProfile(version, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedUpgradeProfile.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedUpgradeProfile.cs new file mode 100644 index 000000000000..a343f3766a41 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedUpgradeProfile.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; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// AppLinkMember self managed upgrade profile. + internal partial class SelfManagedUpgradeProfile + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Istio version. + /// is null. + public SelfManagedUpgradeProfile(string version) + { + Argument.AssertNotNull(version, nameof(version)); + + Version = version; + } + + /// Initializes a new instance of . + /// Istio version. + /// Keeps track of any properties unknown to the library. + internal SelfManagedUpgradeProfile(string version, IDictionary additionalBinaryDataProperties) + { + Version = version; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Istio version. + public string Version { get; set; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedVersions.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedVersions.Serialization.cs new file mode 100644 index 000000000000..09430aa0afa5 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedVersions.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.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// Self managed versions. + internal partial class SelfManagedVersions : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal SelfManagedVersions() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SelfManagedVersions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeSelfManagedVersions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SelfManagedVersions)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(SelfManagedVersions)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + SelfManagedVersions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfManagedVersions)} does not support writing '{format}' format."); + } + writer.WritePropertyName("versions"u8); + writer.WriteStartArray(); + foreach (AppLinkVersionInfo item in Versions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + SelfManagedVersions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SelfManagedVersions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfManagedVersions)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSelfManagedVersions(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SelfManagedVersions DeserializeSelfManagedVersions(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList versions = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("versions"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AppLinkVersionInfo.DeserializeAppLinkVersionInfo(item, options)); + } + versions = array; + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new SelfManagedVersions(versions, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedVersions.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedVersions.cs new file mode 100644 index 000000000000..e1e83fa6490f --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/SelfManagedVersions.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; +using System.Linq; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// Self managed versions. + internal partial class SelfManagedVersions + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Istio versions. + internal SelfManagedVersions(IEnumerable versions) + { + Versions = versions.ToList(); + } + + /// Initializes a new instance of . + /// Istio versions. + /// Keeps track of any properties unknown to the library. + internal SelfManagedVersions(IList versions, IDictionary additionalBinaryDataProperties) + { + Versions = versions; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Istio versions. + public IList Versions { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/UpgradeHistoryListResult.Serialization.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/UpgradeHistoryListResult.Serialization.cs new file mode 100644 index 000000000000..856627843366 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/UpgradeHistoryListResult.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; +using Azure.ResourceManager.AppNetwork; + +namespace Azure.ResourceManager.AppNetwork.Models +{ + /// The response of a UpgradeHistory list operation. + internal partial class UpgradeHistoryListResult : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal UpgradeHistoryListResult() + { + } + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual UpgradeHistoryListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeUpgradeHistoryListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpgradeHistoryListResult)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppNetworkContext.Default); + default: + throw new FormatException($"The model {nameof(UpgradeHistoryListResult)} does not support writing '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The data to parse. + /// The client options for reading and writing models. + UpgradeHistoryListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static UpgradeHistoryListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpgradeHistoryListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpgradeHistoryListResult)} does not support writing '{format}' format."); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (AppLinkUpgradeHistory 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" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + 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 + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + UpgradeHistoryListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual UpgradeHistoryListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpgradeHistoryListResult)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpgradeHistoryListResult(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static UpgradeHistoryListResult DeserializeUpgradeHistoryListResult(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AppLinkUpgradeHistory.DeserializeAppLinkUpgradeHistory(item, options)); + } + value = array; + continue; + } + if (prop.NameEquals("nextLink"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString(), UriKind.RelativeOrAbsolute); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new UpgradeHistoryListResult(value, nextLink, additionalBinaryDataProperties); + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/UpgradeHistoryListResult.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/UpgradeHistoryListResult.cs new file mode 100644 index 000000000000..d9b89a04715b --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/Models/UpgradeHistoryListResult.cs @@ -0,0 +1,44 @@ +// 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.AppNetwork.Models +{ + /// The response of a UpgradeHistory list operation. + internal partial class UpgradeHistoryListResult + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The UpgradeHistory items on this page. + internal UpgradeHistoryListResult(IEnumerable value) + { + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The UpgradeHistory items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal UpgradeHistoryListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) + { + Value = value; + NextLink = nextLink; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The UpgradeHistory items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/ProviderConstants.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..5d91fb82efc2 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/ProviderConstants.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppNetwork +{ + internal static partial class ProviderConstants + { + /// Gets the DefaultProviderNamespace. + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/AppLinkMembersRestOperations.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/AppLinkMembersRestOperations.cs new file mode 100644 index 000000000000..f2680f80f4db --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/AppLinkMembersRestOperations.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppLinkMembers + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AppLinkMembers for mocking. + protected AppLinkMembers() + { + } + + /// Initializes a new instance of AppLinkMembers. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal AppLinkMembers(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, string appLinkMemberName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + uri.AppendPath("/appLinkMembers/", false); + uri.AppendPath(appLinkMemberName, true); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, string appLinkMemberName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + uri.AppendPath("/appLinkMembers/", false); + uri.AppendPath(appLinkMemberName, true); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Put; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, string appLinkMemberName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + uri.AppendPath("/appLinkMembers/", false); + uri.AppendPath(appLinkMemberName, true); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Patch; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, string appLinkMemberName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + uri.AppendPath("/appLinkMembers/", false); + uri.AppendPath(appLinkMemberName, true); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Delete; + return message; + } + + internal HttpMessage CreateGetByAppLinkRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + uri.AppendPath("/appLinkMembers", false); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetByAppLinkRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string appLinkName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + if (nextPage.IsAbsoluteUri) + { + uri.Reset(nextPage); + } + else + { + uri.Reset(new Uri(_endpoint, nextPage)); + } + if (_apiVersion != null) + { + uri.UpdateQuery("api-version", _apiVersion); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/AppLinksRestOperations.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/AppLinksRestOperations.cs new file mode 100644 index 000000000000..c03e403b78a2 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/AppLinksRestOperations.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AppLinks + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AppLinks for mocking. + protected AppLinks() + { + } + + /// Initializes a new instance of AppLinks. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal AppLinks(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Put; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Patch; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Delete; + return message; + } + + internal HttpMessage CreateGetByResourceGroupRequest(Guid subscriptionId, string resourceGroupName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks", false); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetByResourceGroupRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + if (nextPage.IsAbsoluteUri) + { + uri.Reset(nextPage); + } + else + { + uri.Reset(new Uri(_endpoint, nextPage)); + } + if (_apiVersion != null) + { + uri.UpdateQuery("api-version", _apiVersion); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetBySubscriptionRequest(Guid subscriptionId, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks", false); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetBySubscriptionRequest(Uri nextPage, Guid subscriptionId, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + if (nextPage.IsAbsoluteUri) + { + uri.Reset(nextPage); + } + else + { + uri.Reset(new Uri(_endpoint, nextPage)); + } + if (_apiVersion != null) + { + uri.UpdateQuery("api-version", _apiVersion); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/AvailableVersionsRestOperations.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/AvailableVersionsRestOperations.cs new file mode 100644 index 000000000000..2099ddb7b930 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/AvailableVersionsRestOperations.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class AvailableVersions + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AvailableVersions for mocking. + protected AvailableVersions() + { + } + + /// Initializes a new instance of AvailableVersions. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal AvailableVersions(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetAppLinkAvailableVersionsByLocationRequest(Guid subscriptionId, AzureLocation location, string kubernetesVersion, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/providers/Microsoft.AppLink/locations/", false); + uri.AppendPath(location.ToString(), true); + uri.AppendPath("/availableVersions", false); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + if (kubernetesVersion != null) + { + uri.AppendQuery("kubernetesVersion", kubernetesVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetAppLinkAvailableVersionsByLocationRequest(Uri nextPage, Guid subscriptionId, AzureLocation location, string kubernetesVersion, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + if (nextPage.IsAbsoluteUri) + { + uri.Reset(nextPage); + } + else + { + uri.Reset(new Uri(_endpoint, nextPage)); + } + if (_apiVersion != null) + { + uri.UpdateQuery("api-version", _apiVersion); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/UpgradeHistoriesRestOperations.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/UpgradeHistoriesRestOperations.cs new file mode 100644 index 000000000000..1c5774124e98 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Generated/RestOperations/UpgradeHistoriesRestOperations.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppNetwork +{ + internal partial class UpgradeHistories + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of UpgradeHistories for mocking. + protected UpgradeHistories() + { + } + + /// Initializes a new instance of UpgradeHistories. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal UpgradeHistories(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetAppLinkUpgradeHistoriesRequest(Guid subscriptionId, string resourceGroupName, string appLinkName, string appLinkMemberName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppLink/appLinks/", false); + uri.AppendPath(appLinkName, true); + uri.AppendPath("/appLinkMembers/", false); + uri.AppendPath(appLinkMemberName, true); + uri.AppendPath("/upgradeHistories", false); + if (_apiVersion != null) + { + uri.AppendQuery("api-version", _apiVersion, true); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetAppLinkUpgradeHistoriesRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string appLinkName, string appLinkMemberName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + if (nextPage.IsAbsoluteUri) + { + uri.Reset(nextPage); + } + else + { + uri.Reset(new Uri(_endpoint, nextPage)); + } + if (_apiVersion != null) + { + uri.UpdateQuery("api-version", _apiVersion); + } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Properties/AssemblyInfo.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..d396a92be8e0 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/src/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.AppLink")] + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] +[assembly: InternalsVisibleTo("Azure.ResourceManager.AppNetwork.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tests/AppNetworkManagementTestBase.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tests/AppNetworkManagementTestBase.cs new file mode 100644 index 000000000000..f14244f5c1a5 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tests/AppNetworkManagementTestBase.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppNetwork.Tests +{ + public class AppNetworkManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected AppNetworkManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected AppNetworkManagementTestBase(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/appnetwork/Azure.ResourceManager.AppNetwork/tests/AppNetworkManagementTestEnvironment.cs b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tests/AppNetworkManagementTestEnvironment.cs new file mode 100644 index 000000000000..53c9b8adbcb4 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tests/AppNetworkManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.AppNetwork.Tests +{ + public class AppNetworkManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tests/Azure.ResourceManager.AppNetwork.Tests.csproj b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tests/Azure.ResourceManager.AppNetwork.Tests.csproj new file mode 100644 index 000000000000..4ff19fa5a3f0 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tests/Azure.ResourceManager.AppNetwork.Tests.csproj @@ -0,0 +1,5 @@ + + + + + diff --git a/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tsp-location.yaml b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tsp-location.yaml new file mode 100644 index 000000000000..b3fc3d93ffe2 --- /dev/null +++ b/sdk/appnetwork/Azure.ResourceManager.AppNetwork/tsp-location.yaml @@ -0,0 +1,6 @@ +directory: specification/applink/AppLink.Management +commit: 762a9f2b1d4ae360a647e37b02f7074348643667 +repo: Azure/azure-rest-api-specs +additionalDirectories: + +emitterPackageJsonPath: eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json \ No newline at end of file diff --git a/sdk/appnetwork/ci.mgmt.yml b/sdk/appnetwork/ci.mgmt.yml new file mode 100644 index 000000000000..25555b5dc40e --- /dev/null +++ b/sdk/appnetwork/ci.mgmt.yml @@ -0,0 +1,11 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: appnetwork + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.AppNetwork + safeName: AzureResourceManagerAppNetwork