diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/Azure.Management.AppConfiguration.sln b/sdk/appconfiguration/Azure.Management.AppConfiguration/Azure.Management.AppConfiguration.sln new file mode 100644 index 000000000000..58a404b8d2f4 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/Azure.Management.AppConfiguration.sln @@ -0,0 +1,79 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Management.AppConfiguration", "src\Azure.Management.AppConfiguration.csproj", "{7300F777-249C-4649-8AEA-3EAF65F1ABF8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Management.AppConfiguration.Tests", "tests\Azure.Management.AppConfiguration.Tests.csproj", "{6CD43398-9E99-4E6D-8EFB-04D10A4EB249}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core", "..\..\core\Azure.Core\src\Azure.Core.csproj", "{086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Debug|x64.ActiveCfg = Debug|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Debug|x64.Build.0 = Debug|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Debug|x86.ActiveCfg = Debug|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Debug|x86.Build.0 = Debug|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Release|Any CPU.Build.0 = Release|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Release|x64.ActiveCfg = Release|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Release|x64.Build.0 = Release|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Release|x86.ActiveCfg = Release|Any CPU + {7300F777-249C-4649-8AEA-3EAF65F1ABF8}.Release|x86.Build.0 = Release|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Debug|x64.ActiveCfg = Debug|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Debug|x64.Build.0 = Debug|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Debug|x86.ActiveCfg = Debug|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Debug|x86.Build.0 = Debug|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Release|Any CPU.Build.0 = Release|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Release|x64.ActiveCfg = Release|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Release|x64.Build.0 = Release|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Release|x86.ActiveCfg = Release|Any CPU + {6CD43398-9E99-4E6D-8EFB-04D10A4EB249}.Release|x86.Build.0 = Release|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Debug|x64.ActiveCfg = Debug|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Debug|x64.Build.0 = Debug|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Debug|x86.ActiveCfg = Debug|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Debug|x86.Build.0 = Debug|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Release|Any CPU.Build.0 = Release|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Release|x64.ActiveCfg = Release|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Release|x64.Build.0 = Release|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Release|x86.ActiveCfg = Release|Any CPU + {EA9DBCE0-4918-4683-A2D1-68992BDAF1E3}.Release|x86.Build.0 = Release|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Debug|Any CPU.Build.0 = Debug|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Debug|x64.ActiveCfg = Debug|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Debug|x64.Build.0 = Debug|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Debug|x86.ActiveCfg = Debug|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Debug|x86.Build.0 = Debug|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Release|Any CPU.ActiveCfg = Release|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Release|Any CPU.Build.0 = Release|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Release|x64.ActiveCfg = Release|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Release|x64.Build.0 = Release|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Release|x86.ActiveCfg = Release|Any CPU + {086D0FD3-FA19-4C72-9E3A-B8570A2BAD11}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1D9A1979-96B1-4D0F-A699-CAD779358ACF} + EndGlobalSection +EndGlobal diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/CHANGELOG.md b/sdk/appconfiguration/Azure.Management.AppConfiguration/CHANGELOG.md new file mode 100644 index 000000000000..0c771dd35ce7 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/CHANGELOG.md @@ -0,0 +1,6 @@ +# Release History + +## 1.0.0-preview.1 + +### New Features +- Initial preview of Azure Management SDK based on Azure.Core \ No newline at end of file diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/Directory.Build.props b/sdk/appconfiguration/Azure.Management.AppConfiguration/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/README.md b/sdk/appconfiguration/Azure.Management.AppConfiguration/README.md new file mode 100644 index 000000000000..8f2ff80ff8e9 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/README.md @@ -0,0 +1,69 @@ +# README.md template + +Use the guidelines in each section of this template to ensure consistency and readability of your README. The README resides in your package's GitHub repository at the root of its directory within the repo. It's also used as the package distribution page (NuGet, PyPi, npm, etc.) and as a Quickstart on docs.microsoft.com. See [README-EXAMPLE.md](README-EXAMPLE.md) for an example following this template. + +* All headings, including the H1, should use **sentence-style capitalization**. Refer to the [Microsoft Style Guide][style-guide-msft] and [Microsoft Cloud Style Guide][style-guide-cloud] for more information. +* Example: `# Azure Batch client library for Python` + +# Azure Management AppConfiguration client library for .NET + +**Introduction**: The introduction appears directly under the title (H1) of your README. + +* **DO NOT** use an "Introduction" or "Overview" heading (H2) for this section. +* First sentence: **Describe the service** briefly. You can usually use the first line of the service's docs landing page for this (Example: [Cosmos DB docs landing page](https://docs.microsoft.com/azure/cosmos-db/)). +* Next, add a **bulleted list** of the **most common tasks** supported by the package or library, prefaced with "Use the client library for [Product Name] to:". Then, provide code snippets for these tasks in the [Examples](#examples) section later in the document. Keep the task list short but include those tasks most developers need to perform with your package. +* Include this single line of links targeting your product's content at the bottom of the introduction, making any adjustments as necessary (for example, NuGet instead of PyPi): + + [Source code](https://github.com/Azure/azure-sdk-for-python/tree/master/azure-batch) | [Package (PyPi)](https://pypi.org/project/azure-batch/) | [API reference documentation](https://docs.microsoft.com/python/api/overview/azure/batch?view=azure-python) | [Product documentation](https://docs.microsoft.com/azure/batch/) + +> TIP: Your README should be as **brief** as possible but **no more brief** than necessary to get a developer new to Azure, the service, or the package up and running quickly. Keep it brief, but include everything a developer needs to make their first API call successfully. + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `pip install package-name`, but should enable a developer to successfully install the package from NuGet, pip, npm, Maven, or even cloning a GitHub repository. + +Include a **Prerequisites** line after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +**Prerequisites**: You must have an [Azure subscription](https://azure.microsoft.com/free/), [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API), and [Python 3.6+](https://www.python.org/downloads/) to use this package. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +## Examples + +Include code snippets and short descriptions for each task you listed in the [Introduction](#introduction) (the bulleted list). Briefly explain each operation, but include enough clarity to explain complex or otherwise tricky operations. + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://worldready.cloudapp.net/Styleguide/Read?id=2696&topicid=25357 + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftemplate%2FAzure.Template%2FREADME.png) diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/api/Azure.Management.AppConfiguration.netstandard2.0.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/api/Azure.Management.AppConfiguration.netstandard2.0.cs new file mode 100644 index 000000000000..c73308f170d2 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/api/Azure.Management.AppConfiguration.netstandard2.0.cs @@ -0,0 +1,430 @@ +namespace Azure.Management.AppConfiguration +{ + public partial class AppConfigurationManagementClient + { + protected AppConfigurationManagementClient() { } + public AppConfigurationManagementClient(string subscriptionId, Azure.Core.TokenCredential tokenCredential, Azure.Management.AppConfiguration.AppConfigurationManagementClientOptions options = null) { } + public AppConfigurationManagementClient(string subscriptionId, System.Uri endpoint, Azure.Core.TokenCredential tokenCredential, Azure.Management.AppConfiguration.AppConfigurationManagementClientOptions options = null) { } + public virtual Azure.Management.AppConfiguration.ConfigurationStoresClient GetConfigurationStoresClient() { throw null; } + public virtual Azure.Management.AppConfiguration.OperationsClient GetOperationsClient() { throw null; } + public virtual Azure.Management.AppConfiguration.PrivateEndpointConnectionsClient GetPrivateEndpointConnectionsClient() { throw null; } + public virtual Azure.Management.AppConfiguration.PrivateLinkResourcesClient GetPrivateLinkResourcesClient() { throw null; } + } + public partial class AppConfigurationManagementClientOptions : Azure.Core.ClientOptions + { + public AppConfigurationManagementClientOptions() { } + } + public partial class ConfigurationStoresClient + { + protected ConfigurationStoresClient() { } + public virtual Azure.Response Get(string resourceGroupName, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string resourceGroupName, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable List(string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable ListAsync(string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable ListByResourceGroup(string resourceGroupName, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable ListByResourceGroupAsync(string resourceGroupName, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable ListKeys(string resourceGroupName, string configStoreName, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable ListKeysAsync(string resourceGroupName, string configStoreName, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ListKeyValue(string resourceGroupName, string configStoreName, Azure.Management.AppConfiguration.Models.ListKeyValueParameters listKeyValueParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ListKeyValueAsync(string resourceGroupName, string configStoreName, Azure.Management.AppConfiguration.Models.ListKeyValueParameters listKeyValueParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RegenerateKey(string resourceGroupName, string configStoreName, Azure.Management.AppConfiguration.Models.RegenerateKeyParameters regenerateKeyParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RegenerateKeyAsync(string resourceGroupName, string configStoreName, Azure.Management.AppConfiguration.Models.RegenerateKeyParameters regenerateKeyParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Management.AppConfiguration.ConfigurationStoresCreateOperation StartCreate(string resourceGroupName, string configStoreName, Azure.Management.AppConfiguration.Models.ConfigurationStore configStoreCreationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.ValueTask StartCreateAsync(string resourceGroupName, string configStoreName, Azure.Management.AppConfiguration.Models.ConfigurationStore configStoreCreationParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Management.AppConfiguration.ConfigurationStoresDeleteOperation StartDelete(string resourceGroupName, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.ValueTask StartDeleteAsync(string resourceGroupName, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Management.AppConfiguration.ConfigurationStoresUpdateOperation StartUpdate(string resourceGroupName, string configStoreName, Azure.Management.AppConfiguration.Models.ConfigurationStoreUpdateParameters configStoreUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.ValueTask StartUpdateAsync(string resourceGroupName, string configStoreName, Azure.Management.AppConfiguration.Models.ConfigurationStoreUpdateParameters configStoreUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ConfigurationStoresCreateOperation : Azure.Operation + { + internal ConfigurationStoresCreateOperation() { } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public override Azure.Management.AppConfiguration.Models.ConfigurationStore Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ConfigurationStoresDeleteOperation : Azure.Operation + { + internal ConfigurationStoresDeleteOperation() { } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public override Azure.Response Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ConfigurationStoresUpdateOperation : Azure.Operation + { + internal ConfigurationStoresUpdateOperation() { } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public override Azure.Management.AppConfiguration.Models.ConfigurationStore Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class OperationsClient + { + protected OperationsClient() { } + public virtual Azure.Response CheckNameAvailability(Azure.Management.AppConfiguration.Models.CheckNameAvailabilityParameters checkNameAvailabilityParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckNameAvailabilityAsync(Azure.Management.AppConfiguration.Models.CheckNameAvailabilityParameters checkNameAvailabilityParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable List(string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable ListAsync(string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PrivateEndpointConnectionsClient + { + protected PrivateEndpointConnectionsClient() { } + public virtual Azure.Response Get(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable ListByConfigurationStore(string resourceGroupName, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable ListByConfigurationStoreAsync(string resourceGroupName, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Management.AppConfiguration.PrivateEndpointConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, Azure.Management.AppConfiguration.Models.PrivateEndpointConnection privateEndpointConnection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.ValueTask StartCreateOrUpdateAsync(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, Azure.Management.AppConfiguration.Models.PrivateEndpointConnection privateEndpointConnection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Management.AppConfiguration.PrivateEndpointConnectionsDeleteOperation StartDelete(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.ValueTask StartDeleteAsync(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PrivateEndpointConnectionsCreateOrUpdateOperation : Azure.Operation + { + internal PrivateEndpointConnectionsCreateOrUpdateOperation() { } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public override Azure.Management.AppConfiguration.Models.PrivateEndpointConnection Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PrivateEndpointConnectionsDeleteOperation : Azure.Operation + { + internal PrivateEndpointConnectionsDeleteOperation() { } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public override Azure.Response Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PrivateLinkResourcesClient + { + protected PrivateLinkResourcesClient() { } + public virtual Azure.Response Get(string resourceGroupName, string configStoreName, string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string resourceGroupName, string configStoreName, string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable ListByConfigurationStore(string resourceGroupName, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable ListByConfigurationStoreAsync(string resourceGroupName, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.Management.AppConfiguration.Models +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ActionsRequired : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ActionsRequired(string value) { throw null; } + public static Azure.Management.AppConfiguration.Models.ActionsRequired None { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.ActionsRequired Recreate { get { throw null; } } + public bool Equals(Azure.Management.AppConfiguration.Models.ActionsRequired other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Management.AppConfiguration.Models.ActionsRequired left, Azure.Management.AppConfiguration.Models.ActionsRequired right) { throw null; } + public static implicit operator Azure.Management.AppConfiguration.Models.ActionsRequired (string value) { throw null; } + public static bool operator !=(Azure.Management.AppConfiguration.Models.ActionsRequired left, Azure.Management.AppConfiguration.Models.ActionsRequired right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ApiKey + { + internal ApiKey() { } + public string ConnectionString { get { throw null; } } + public string Id { get { throw null; } } + public System.DateTimeOffset? LastModified { get { throw null; } } + public string Name { get { throw null; } } + public bool? ReadOnly { get { throw null; } } + public string Value { get { throw null; } } + } + public partial class ApiKeyListResult + { + internal ApiKeyListResult() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + } + public partial class CheckNameAvailabilityParameters + { + public CheckNameAvailabilityParameters(string name) { } + public string Name { get { throw null; } } + public string Type { get { throw null; } } + } + public partial class ConfigurationStore : Azure.Management.AppConfiguration.Models.Resource + { + public ConfigurationStore(string location, Azure.Management.AppConfiguration.Models.Sku sku) : base (default(string)) { } + public System.DateTimeOffset? CreationDate { get { throw null; } } + public Azure.Management.AppConfiguration.Models.EncryptionProperties Encryption { get { throw null; } set { } } + public string Endpoint { get { throw null; } } + public Azure.Management.AppConfiguration.Models.ResourceIdentity Identity { get { throw null; } set { } } + public System.Collections.Generic.IList PrivateEndpointConnections { get { throw null; } } + public Azure.Management.AppConfiguration.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Management.AppConfiguration.Models.PublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } + public Azure.Management.AppConfiguration.Models.Sku Sku { get { throw null; } set { } } + } + public partial class ConfigurationStoreListResult + { + internal ConfigurationStoreListResult() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + } + public partial class ConfigurationStoreUpdateParameters + { + public ConfigurationStoreUpdateParameters() { } + public Azure.Management.AppConfiguration.Models.EncryptionProperties Encryption { get { throw null; } set { } } + public Azure.Management.AppConfiguration.Models.ResourceIdentity Identity { get { throw null; } set { } } + public Azure.Management.AppConfiguration.Models.Sku Sku { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectionStatus(string value) { throw null; } + public static Azure.Management.AppConfiguration.Models.ConnectionStatus Approved { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.ConnectionStatus Disconnected { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.ConnectionStatus Pending { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.ConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.Management.AppConfiguration.Models.ConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Management.AppConfiguration.Models.ConnectionStatus left, Azure.Management.AppConfiguration.Models.ConnectionStatus right) { throw null; } + public static implicit operator Azure.Management.AppConfiguration.Models.ConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.Management.AppConfiguration.Models.ConnectionStatus left, Azure.Management.AppConfiguration.Models.ConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EncryptionProperties + { + public EncryptionProperties() { } + public Azure.Management.AppConfiguration.Models.KeyVaultProperties KeyVaultProperties { get { throw null; } set { } } + } + public partial class Error + { + internal Error() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IdentityType(string value) { throw null; } + public static Azure.Management.AppConfiguration.Models.IdentityType None { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.IdentityType SystemAssigned { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.IdentityType SystemAssignedUserAssigned { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.IdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.Management.AppConfiguration.Models.IdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Management.AppConfiguration.Models.IdentityType left, Azure.Management.AppConfiguration.Models.IdentityType right) { throw null; } + public static implicit operator Azure.Management.AppConfiguration.Models.IdentityType (string value) { throw null; } + public static bool operator !=(Azure.Management.AppConfiguration.Models.IdentityType left, Azure.Management.AppConfiguration.Models.IdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class KeyValue + { + internal KeyValue() { } + public string ContentType { get { throw null; } } + public string ETag { get { throw null; } } + public string Key { get { throw null; } } + public string Label { get { throw null; } } + public System.DateTimeOffset? LastModified { get { throw null; } } + public bool? Locked { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + public string Value { get { throw null; } } + } + public partial class KeyVaultProperties + { + public KeyVaultProperties() { } + public string IdentityClientId { get { throw null; } set { } } + public string KeyIdentifier { get { throw null; } set { } } + } + public partial class ListKeyValueParameters + { + public ListKeyValueParameters(string key) { } + public string Key { get { throw null; } } + public string Label { get { throw null; } set { } } + } + public partial class NameAvailabilityStatus + { + internal NameAvailabilityStatus() { } + public string Message { get { throw null; } } + public bool? NameAvailable { get { throw null; } } + public string Reason { get { throw null; } } + } + public partial class OperationDefinition + { + internal OperationDefinition() { } + public Azure.Management.AppConfiguration.Models.OperationDefinitionDisplay Display { get { throw null; } } + public string Name { get { throw null; } } + } + public partial class OperationDefinitionDisplay + { + internal OperationDefinitionDisplay() { } + public string Description { get { throw null; } } + public string Operation { get { throw null; } } + public string Provider { get { throw null; } } + public string Resource { get { throw null; } } + } + public partial class OperationDefinitionListResult + { + internal OperationDefinitionListResult() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + } + public partial class PrivateEndpoint + { + public PrivateEndpoint() { } + public string Id { get { throw null; } set { } } + } + public partial class PrivateEndpointConnection + { + public PrivateEndpointConnection() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public Azure.Management.AppConfiguration.Models.PrivateEndpoint PrivateEndpoint { get { throw null; } set { } } + public Azure.Management.AppConfiguration.Models.PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } + public Azure.Management.AppConfiguration.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string Type { get { throw null; } } + } + public partial class PrivateEndpointConnectionListResult + { + internal PrivateEndpointConnectionListResult() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + } + public partial class PrivateEndpointConnectionReference + { + public PrivateEndpointConnectionReference() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public Azure.Management.AppConfiguration.Models.PrivateEndpoint PrivateEndpoint { get { throw null; } set { } } + public Azure.Management.AppConfiguration.Models.PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } + public Azure.Management.AppConfiguration.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string Type { get { throw null; } } + } + public partial class PrivateLinkResource + { + internal PrivateLinkResource() { } + public string GroupId { get { throw null; } } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + public string Type { get { throw null; } } + } + public partial class PrivateLinkResourceListResult + { + internal PrivateLinkResourceListResult() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + } + public partial class PrivateLinkServiceConnectionState + { + public PrivateLinkServiceConnectionState() { } + public Azure.Management.AppConfiguration.Models.ActionsRequired? ActionsRequired { get { throw null; } } + public string Description { get { throw null; } set { } } + public Azure.Management.AppConfiguration.Models.ConnectionStatus? Status { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.Management.AppConfiguration.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.ProvisioningState Creating { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.Management.AppConfiguration.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Management.AppConfiguration.Models.ProvisioningState left, Azure.Management.AppConfiguration.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.Management.AppConfiguration.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.Management.AppConfiguration.Models.ProvisioningState left, Azure.Management.AppConfiguration.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PublicNetworkAccess : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PublicNetworkAccess(string value) { throw null; } + public static Azure.Management.AppConfiguration.Models.PublicNetworkAccess Disabled { get { throw null; } } + public static Azure.Management.AppConfiguration.Models.PublicNetworkAccess Enabled { get { throw null; } } + public bool Equals(Azure.Management.AppConfiguration.Models.PublicNetworkAccess other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Management.AppConfiguration.Models.PublicNetworkAccess left, Azure.Management.AppConfiguration.Models.PublicNetworkAccess right) { throw null; } + public static implicit operator Azure.Management.AppConfiguration.Models.PublicNetworkAccess (string value) { throw null; } + public static bool operator !=(Azure.Management.AppConfiguration.Models.PublicNetworkAccess left, Azure.Management.AppConfiguration.Models.PublicNetworkAccess right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RegenerateKeyParameters + { + public RegenerateKeyParameters() { } + public string Id { get { throw null; } set { } } + } + public partial class Resource + { + public Resource(string location) { } + public string Id { get { throw null; } } + public string Location { get { throw null; } set { } } + public string Name { get { throw null; } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } set { } } + public string Type { get { throw null; } } + } + public partial class ResourceIdentity + { + public ResourceIdentity() { } + public string PrincipalId { get { throw null; } } + public string TenantId { get { throw null; } } + public Azure.Management.AppConfiguration.Models.IdentityType? Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } set { } } + } + public partial class Sku + { + public Sku(string name) { } + public string Name { get { throw null; } set { } } + } + public partial class UserIdentity + { + public UserIdentity() { } + public string ClientId { get { throw null; } } + public string PrincipalId { get { throw null; } } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Azure.Management.AppConfiguration.csproj b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Azure.Management.AppConfiguration.csproj new file mode 100644 index 000000000000..d3fae647d5c5 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Azure.Management.AppConfiguration.csproj @@ -0,0 +1,9 @@ + + + 1.0.0-preview.1 + Azure.Management.AppConfiguration + Azure management client SDK for Azure resource provider Microsoft.AppConfiguration + azure;management;appconfiguration + $(NoWarn);AZC0008;CA1308 + + diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/AppConfigurationManagementClient.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/AppConfigurationManagementClient.cs new file mode 100644 index 000000000000..07c537cd9706 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/AppConfigurationManagementClient.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Management.AppConfiguration; + +namespace Azure.Management.AppConfiguration +{ + /// AppConfiguration service management client. + public class AppConfigurationManagementClient + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + private readonly string _subscriptionId; + private readonly Uri _endpoint; + + /// Initializes a new instance of AppConfigurationManagementClient for mocking. + protected AppConfigurationManagementClient() + { + } + + /// Initializes a new instance of AppConfigurationManagementClient. + /// The Microsoft Azure subscription ID. + /// The OAuth token for making client requests. + /// The options for configuring the client. + public AppConfigurationManagementClient(string subscriptionId, TokenCredential tokenCredential, AppConfigurationManagementClientOptions options = null) : this(subscriptionId, null, tokenCredential, options) + { + } + /// Initializes a new instance of AppConfigurationManagementClient. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// The OAuth token for making client requests. + /// The options for configuring the client. + /// This occurs when one of the required arguments is null. + public AppConfigurationManagementClient(string subscriptionId, Uri endpoint, TokenCredential tokenCredential, AppConfigurationManagementClientOptions options = null) + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + + options ??= new AppConfigurationManagementClientOptions(); + _clientDiagnostics = new ClientDiagnostics(options); + _pipeline = ManagementPipelineBuilder.Build(tokenCredential, endpoint, options); + _subscriptionId = subscriptionId; + _endpoint = endpoint; + } + + /// Creates a new instance of ConfigurationStoresClient. + public virtual ConfigurationStoresClient GetConfigurationStoresClient() + { + return new ConfigurationStoresClient(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + } + + /// Creates a new instance of OperationsClient. + public virtual OperationsClient GetOperationsClient() + { + return new OperationsClient(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + } + + /// Creates a new instance of PrivateEndpointConnectionsClient. + public virtual PrivateEndpointConnectionsClient GetPrivateEndpointConnectionsClient() + { + return new PrivateEndpointConnectionsClient(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + } + + /// Creates a new instance of PrivateLinkResourcesClient. + public virtual PrivateLinkResourcesClient GetPrivateLinkResourcesClient() + { + return new PrivateLinkResourcesClient(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/AppConfigurationManagementClientOptions.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/AppConfigurationManagementClientOptions.cs new file mode 100644 index 000000000000..fa2f466412a3 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/AppConfigurationManagementClientOptions.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Management.AppConfiguration +{ + /// Client options for AppConfiguration. + public class AppConfigurationManagementClientOptions : ClientOptions + { + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresClient.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresClient.cs new file mode 100644 index 000000000000..17fe85d7309d --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresClient.cs @@ -0,0 +1,615 @@ +// 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.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + /// The ConfigurationStores service client. + public partial class ConfigurationStoresClient + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal ConfigurationStoresRestClient RestClient { get; } + /// Initializes a new instance of ConfigurationStoresClient for mocking. + protected ConfigurationStoresClient() + { + } + /// Initializes a new instance of ConfigurationStoresClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + internal ConfigurationStoresClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2019-11-01-preview") + { + RestClient = new ConfigurationStoresRestClient(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Gets the properties of the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public virtual async Task> GetAsync(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.Get"); + scope.Start(); + try + { + return await RestClient.GetAsync(resourceGroupName, configStoreName, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the properties of the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public virtual Response Get(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.Get"); + scope.Start(); + try + { + return RestClient.Get(resourceGroupName, configStoreName, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Regenerates an access key for the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for regenerating an access key. + /// The cancellation token to use. + public virtual async Task> RegenerateKeyAsync(string resourceGroupName, string configStoreName, RegenerateKeyParameters regenerateKeyParameters, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.RegenerateKey"); + scope.Start(); + try + { + return await RestClient.RegenerateKeyAsync(resourceGroupName, configStoreName, regenerateKeyParameters, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Regenerates an access key for the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for regenerating an access key. + /// The cancellation token to use. + public virtual Response RegenerateKey(string resourceGroupName, string configStoreName, RegenerateKeyParameters regenerateKeyParameters, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.RegenerateKey"); + scope.Start(); + try + { + return RestClient.RegenerateKey(resourceGroupName, configStoreName, regenerateKeyParameters, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists a configuration store key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for retrieving a key-value. + /// The cancellation token to use. + public virtual async Task> ListKeyValueAsync(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListKeyValue"); + scope.Start(); + try + { + return await RestClient.ListKeyValueAsync(resourceGroupName, configStoreName, listKeyValueParameters, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists a configuration store key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for retrieving a key-value. + /// The cancellation token to use. + public virtual Response ListKeyValue(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListKeyValue"); + scope.Start(); + try + { + return RestClient.ListKeyValue(resourceGroupName, configStoreName, listKeyValueParameters, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the configuration stores for a given subscription. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public virtual AsyncPageable ListAsync(string skipToken = null, CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.List"); + scope.Start(); + try + { + var response = await RestClient.ListNextPageAsync(nextLink, skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Lists the configuration stores for a given subscription. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public virtual Pageable List(string skipToken = null, CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.List"); + scope.Start(); + try + { + var response = RestClient.List(skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.List"); + scope.Start(); + try + { + var response = RestClient.ListNextPage(nextLink, skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Lists the configuration stores for a given resource group. + /// The name of the resource group to which the container registry belongs. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public virtual AsyncPageable ListByResourceGroupAsync(string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListByResourceGroup"); + scope.Start(); + try + { + var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListByResourceGroup"); + scope.Start(); + try + { + var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Lists the configuration stores for a given resource group. + /// The name of the resource group to which the container registry belongs. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public virtual Pageable ListByResourceGroup(string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListByResourceGroup"); + scope.Start(); + try + { + var response = RestClient.ListByResourceGroup(resourceGroupName, skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListByResourceGroup"); + scope.Start(); + try + { + var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Lists the access key for the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public virtual AsyncPageable ListKeysAsync(string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListKeys"); + scope.Start(); + try + { + var response = await RestClient.ListKeysAsync(resourceGroupName, configStoreName, skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListKeys"); + scope.Start(); + try + { + var response = await RestClient.ListKeysNextPageAsync(nextLink, resourceGroupName, configStoreName, skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Lists the access key for the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public virtual Pageable ListKeys(string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListKeys"); + scope.Start(); + try + { + var response = RestClient.ListKeys(resourceGroupName, configStoreName, skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.ListKeys"); + scope.Start(); + try + { + var response = RestClient.ListKeysNextPage(nextLink, resourceGroupName, configStoreName, skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Creates a configuration store with the specified parameters. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for creating a configuration store. + /// The cancellation token to use. + public virtual async ValueTask StartCreateAsync(string resourceGroupName, string configStoreName, ConfigurationStore configStoreCreationParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (configStoreCreationParameters == null) + { + throw new ArgumentNullException(nameof(configStoreCreationParameters)); + } + + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.StartCreate"); + scope.Start(); + try + { + var originalResponse = await RestClient.CreateAsync(resourceGroupName, configStoreName, configStoreCreationParameters, cancellationToken).ConfigureAwait(false); + return new ConfigurationStoresCreateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateRequest(resourceGroupName, configStoreName, configStoreCreationParameters).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a configuration store with the specified parameters. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for creating a configuration store. + /// The cancellation token to use. + public virtual ConfigurationStoresCreateOperation StartCreate(string resourceGroupName, string configStoreName, ConfigurationStore configStoreCreationParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (configStoreCreationParameters == null) + { + throw new ArgumentNullException(nameof(configStoreCreationParameters)); + } + + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.StartCreate"); + scope.Start(); + try + { + var originalResponse = RestClient.Create(resourceGroupName, configStoreName, configStoreCreationParameters, cancellationToken); + return new ConfigurationStoresCreateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateRequest(resourceGroupName, configStoreName, configStoreCreationParameters).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public virtual async ValueTask StartDeleteAsync(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.StartDelete"); + scope.Start(); + try + { + var originalResponse = await RestClient.DeleteAsync(resourceGroupName, configStoreName, cancellationToken).ConfigureAwait(false); + return new ConfigurationStoresDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, configStoreName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public virtual ConfigurationStoresDeleteOperation StartDelete(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.StartDelete"); + scope.Start(); + try + { + var originalResponse = RestClient.Delete(resourceGroupName, configStoreName, cancellationToken); + return new ConfigurationStoresDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, configStoreName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Updates a configuration store with the specified parameters. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for updating a configuration store. + /// The cancellation token to use. + public virtual async ValueTask StartUpdateAsync(string resourceGroupName, string configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (configStoreUpdateParameters == null) + { + throw new ArgumentNullException(nameof(configStoreUpdateParameters)); + } + + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.StartUpdate"); + scope.Start(); + try + { + var originalResponse = await RestClient.UpdateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters, cancellationToken).ConfigureAwait(false); + return new ConfigurationStoresUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, configStoreName, configStoreUpdateParameters).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Updates a configuration store with the specified parameters. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for updating a configuration store. + /// The cancellation token to use. + public virtual ConfigurationStoresUpdateOperation StartUpdate(string resourceGroupName, string configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (configStoreUpdateParameters == null) + { + throw new ArgumentNullException(nameof(configStoreUpdateParameters)); + } + + using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.StartUpdate"); + scope.Start(); + try + { + var originalResponse = RestClient.Update(resourceGroupName, configStoreName, configStoreUpdateParameters, cancellationToken); + return new ConfigurationStoresUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, configStoreName, configStoreUpdateParameters).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresCreateOperation.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresCreateOperation.cs new file mode 100644 index 000000000000..cc591515fa8c --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresCreateOperation.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + /// Creates a configuration store with the specified parameters. + public partial class ConfigurationStoresCreateOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + internal ConfigurationStoresCreateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ConfigurationStoresCreateOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override ConfigurationStore Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + ConfigurationStore IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + return null; + } + else + { + return ConfigurationStore.DeserializeConfigurationStore(document.RootElement); + } + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + return null; + } + else + { + return ConfigurationStore.DeserializeConfigurationStore(document.RootElement); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresDeleteOperation.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresDeleteOperation.cs new file mode 100644 index 000000000000..0aff2d74ac55 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresDeleteOperation.cs @@ -0,0 +1,62 @@ +// 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; + +namespace Azure.Management.AppConfiguration +{ + /// Deletes a configuration store. + public partial class ConfigurationStoresDeleteOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + internal ConfigurationStoresDeleteOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ConfigurationStoresDeleteOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override Response Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + return response; + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + return await new ValueTask(response).ConfigureAwait(false); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresRestClient.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresRestClient.cs new file mode 100644 index 000000000000..4ef9f4240077 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresRestClient.cs @@ -0,0 +1,1144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + internal partial class ConfigurationStoresRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of ConfigurationStoresRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + /// This occurs when one of the required arguments is null. + public ConfigurationStoresRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2019-11-01-preview") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores", false); + uri.AppendQuery("api-version", apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + return message; + } + + /// Lists the configuration stores for a given subscription. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public async ValueTask> ListAsync(string skipToken = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStoreListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStoreListResult.DeserializeConfigurationStoreListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the configuration stores for a given subscription. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public Response List(string skipToken = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStoreListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStoreListResult.DeserializeConfigurationStoreListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores", false); + uri.AppendQuery("api-version", apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + return message; + } + + /// Lists the configuration stores for a given resource group. + /// The name of the resource group to which the container registry belongs. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public async ValueTask> ListByResourceGroupAsync(string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStoreListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStoreListResult.DeserializeConfigurationStoreListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the configuration stores for a given resource group. + /// The name of the resource group to which the container registry belongs. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public Response ListByResourceGroup(string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStoreListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStoreListResult.DeserializeConfigurationStoreListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string configStoreName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Gets the properties of the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public async ValueTask> GetAsync(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateGetRequest(resourceGroupName, configStoreName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStore value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStore.DeserializeConfigurationStore(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets the properties of the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public Response Get(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateGetRequest(resourceGroupName, configStoreName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStore value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStore.DeserializeConfigurationStore(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string resourceGroupName, string configStoreName, ConfigurationStore configStoreCreationParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Content-Type", "application/json"); + using var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(configStoreCreationParameters); + request.Content = content; + return message; + } + + /// Creates a configuration store with the specified parameters. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for creating a configuration store. + /// The cancellation token to use. + public async ValueTask CreateAsync(string resourceGroupName, string configStoreName, ConfigurationStore configStoreCreationParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (configStoreCreationParameters == null) + { + throw new ArgumentNullException(nameof(configStoreCreationParameters)); + } + + using var message = CreateCreateRequest(resourceGroupName, configStoreName, configStoreCreationParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 201: + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Creates a configuration store with the specified parameters. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for creating a configuration store. + /// The cancellation token to use. + public Response Create(string resourceGroupName, string configStoreName, ConfigurationStore configStoreCreationParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (configStoreCreationParameters == null) + { + throw new ArgumentNullException(nameof(configStoreCreationParameters)); + } + + using var message = CreateCreateRequest(resourceGroupName, configStoreName, configStoreCreationParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 201: + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string configStoreName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Deletes a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public async ValueTask DeleteAsync(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, configStoreName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Deletes a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public Response Delete(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, configStoreName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string resourceGroupName, string configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Content-Type", "application/json"); + using var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(configStoreUpdateParameters); + request.Content = content; + return message; + } + + /// Updates a configuration store with the specified parameters. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for updating a configuration store. + /// The cancellation token to use. + public async ValueTask UpdateAsync(string resourceGroupName, string configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (configStoreUpdateParameters == null) + { + throw new ArgumentNullException(nameof(configStoreUpdateParameters)); + } + + using var message = CreateUpdateRequest(resourceGroupName, configStoreName, configStoreUpdateParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 201: + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Updates a configuration store with the specified parameters. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for updating a configuration store. + /// The cancellation token to use. + public Response Update(string resourceGroupName, string configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (configStoreUpdateParameters == null) + { + throw new ArgumentNullException(nameof(configStoreUpdateParameters)); + } + + using var message = CreateUpdateRequest(resourceGroupName, configStoreName, configStoreUpdateParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 201: + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListKeysRequest(string resourceGroupName, string configStoreName, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/ListKeys", false); + uri.AppendQuery("api-version", apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + return message; + } + + /// Lists the access key for the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public async ValueTask> ListKeysAsync(string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListKeysRequest(resourceGroupName, configStoreName, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKeyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ApiKeyListResult.DeserializeApiKeyListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the access key for the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public Response ListKeys(string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListKeysRequest(resourceGroupName, configStoreName, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKeyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ApiKeyListResult.DeserializeApiKeyListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRegenerateKeyRequest(string resourceGroupName, string configStoreName, RegenerateKeyParameters regenerateKeyParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/RegenerateKey", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Content-Type", "application/json"); + using var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(regenerateKeyParameters); + request.Content = content; + return message; + } + + /// Regenerates an access key for the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for regenerating an access key. + /// The cancellation token to use. + public async ValueTask> RegenerateKeyAsync(string resourceGroupName, string configStoreName, RegenerateKeyParameters regenerateKeyParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (regenerateKeyParameters == null) + { + throw new ArgumentNullException(nameof(regenerateKeyParameters)); + } + + using var message = CreateRegenerateKeyRequest(resourceGroupName, configStoreName, regenerateKeyParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKey value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ApiKey.DeserializeApiKey(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Regenerates an access key for the specified configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for regenerating an access key. + /// The cancellation token to use. + public Response RegenerateKey(string resourceGroupName, string configStoreName, RegenerateKeyParameters regenerateKeyParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (regenerateKeyParameters == null) + { + throw new ArgumentNullException(nameof(regenerateKeyParameters)); + } + + using var message = CreateRegenerateKeyRequest(resourceGroupName, configStoreName, regenerateKeyParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKey value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ApiKey.DeserializeApiKey(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListKeyValueRequest(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/listKeyValue", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Content-Type", "application/json"); + using var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(listKeyValueParameters); + request.Content = content; + return message; + } + + /// Lists a configuration store key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for retrieving a key-value. + /// The cancellation token to use. + public async ValueTask> ListKeyValueAsync(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (listKeyValueParameters == null) + { + throw new ArgumentNullException(nameof(listKeyValueParameters)); + } + + using var message = CreateListKeyValueRequest(resourceGroupName, configStoreName, listKeyValueParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + KeyValue value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = KeyValue.DeserializeKeyValue(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists a configuration store key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The parameters for retrieving a key-value. + /// The cancellation token to use. + public Response ListKeyValue(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (listKeyValueParameters == null) + { + throw new ArgumentNullException(nameof(listKeyValueParameters)); + } + + using var message = CreateListKeyValueRequest(resourceGroupName, configStoreName, listKeyValueParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + KeyValue value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = KeyValue.DeserializeKeyValue(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + return message; + } + + /// Lists the configuration stores for a given subscription. + /// The URL to the next page of results. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public async ValueTask> ListNextPageAsync(string nextLink, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStoreListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStoreListResult.DeserializeConfigurationStoreListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the configuration stores for a given subscription. + /// The URL to the next page of results. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public Response ListNextPage(string nextLink, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStoreListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStoreListResult.DeserializeConfigurationStoreListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + return message; + } + + /// Lists the configuration stores for a given resource group. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public async ValueTask> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStoreListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStoreListResult.DeserializeConfigurationStoreListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the configuration stores for a given resource group. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConfigurationStoreListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ConfigurationStoreListResult.DeserializeConfigurationStoreListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListKeysNextPageRequest(string nextLink, string resourceGroupName, string configStoreName, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + return message; + } + + /// Lists the access key for the specified configuration store. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public async ValueTask> ListKeysNextPageAsync(string nextLink, string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListKeysNextPageRequest(nextLink, resourceGroupName, configStoreName, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKeyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ApiKeyListResult.DeserializeApiKeyListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the access key for the specified configuration store. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public Response ListKeysNextPage(string nextLink, string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListKeysNextPageRequest(nextLink, resourceGroupName, configStoreName, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKeyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = ApiKeyListResult.DeserializeApiKeyListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresUpdateOperation.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresUpdateOperation.cs new file mode 100644 index 000000000000..62a68c18f472 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/ConfigurationStoresUpdateOperation.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + /// Updates a configuration store with the specified parameters. + public partial class ConfigurationStoresUpdateOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + internal ConfigurationStoresUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ConfigurationStoresUpdateOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override ConfigurationStore Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + ConfigurationStore IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + return null; + } + else + { + return ConfigurationStore.DeserializeConfigurationStore(document.RootElement); + } + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + return null; + } + else + { + return ConfigurationStore.DeserializeConfigurationStore(document.RootElement); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ActionsRequired.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ActionsRequired.cs new file mode 100644 index 000000000000..e314fcc764f8 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ActionsRequired.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Management.AppConfiguration.Models +{ + /// Any action that is required beyond basic workflow (approve/ reject/ disconnect). + public readonly partial struct ActionsRequired : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + public ActionsRequired(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string RecreateValue = "Recreate"; + + /// None. + public static ActionsRequired None { get; } = new ActionsRequired(NoneValue); + /// Recreate. + public static ActionsRequired Recreate { get; } = new ActionsRequired(RecreateValue); + /// Determines if two values are the same. + public static bool operator ==(ActionsRequired left, ActionsRequired right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ActionsRequired left, ActionsRequired right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ActionsRequired(string value) => new ActionsRequired(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ActionsRequired other && Equals(other); + /// + public bool Equals(ActionsRequired other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKey.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKey.Serialization.cs new file mode 100644 index 000000000000..659f453af764 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKey.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class ApiKey + { + internal static ApiKey DeserializeApiKey(JsonElement element) + { + string id = default; + string name = default; + string value = default; + string connectionString = default; + DateTimeOffset? lastModified = default; + bool? readOnly = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectionString")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionString = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModified")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModified = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("readOnly")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + readOnly = property.Value.GetBoolean(); + continue; + } + } + return new ApiKey(id, name, value, connectionString, lastModified, readOnly); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKey.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKey.cs new file mode 100644 index 000000000000..aa963f12b66d --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKey.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Management.AppConfiguration.Models +{ + /// An API key used for authenticating with a configuration store endpoint. + public partial class ApiKey + { + /// Initializes a new instance of ApiKey. + internal ApiKey() + { + } + + /// Initializes a new instance of ApiKey. + /// The key ID. + /// A name for the key describing its usage. + /// The value of the key that is used for authentication purposes. + /// A connection string that can be used by supporting clients for authentication. + /// The last time any of the key's properties were modified. + /// Whether this key can only be used for read operations. + internal ApiKey(string id, string name, string value, string connectionString, DateTimeOffset? lastModified, bool? readOnly) + { + Id = id; + Name = name; + Value = value; + ConnectionString = connectionString; + LastModified = lastModified; + ReadOnly = readOnly; + } + + /// The key ID. + public string Id { get; } + /// A name for the key describing its usage. + public string Name { get; } + /// The value of the key that is used for authentication purposes. + public string Value { get; } + /// A connection string that can be used by supporting clients for authentication. + public string ConnectionString { get; } + /// The last time any of the key's properties were modified. + public DateTimeOffset? LastModified { get; } + /// Whether this key can only be used for read operations. + public bool? ReadOnly { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKeyListResult.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKeyListResult.Serialization.cs new file mode 100644 index 000000000000..626aba8d0df6 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKeyListResult.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class ApiKeyListResult + { + internal static ApiKeyListResult DeserializeApiKeyListResult(JsonElement element) + { + IReadOnlyList value = default; + string nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(ApiKey.DeserializeApiKey(item)); + } + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = property.Value.GetString(); + continue; + } + } + return new ApiKeyListResult(value, nextLink); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKeyListResult.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKeyListResult.cs new file mode 100644 index 000000000000..ddf7ff3fc3e0 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ApiKeyListResult.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The result of a request to list API keys. + public partial class ApiKeyListResult + { + /// Initializes a new instance of ApiKeyListResult. + internal ApiKeyListResult() + { + } + + /// Initializes a new instance of ApiKeyListResult. + /// The collection value. + /// The URI that can be used to request the next set of paged results. + internal ApiKeyListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The collection value. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next set of paged results. + public string NextLink { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/CheckNameAvailabilityParameters.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/CheckNameAvailabilityParameters.Serialization.cs new file mode 100644 index 000000000000..3f956c8fd420 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/CheckNameAvailabilityParameters.Serialization.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class CheckNameAvailabilityParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"); + writer.WriteStringValue(Type); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/CheckNameAvailabilityParameters.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/CheckNameAvailabilityParameters.cs new file mode 100644 index 000000000000..9b7758b174cc --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/CheckNameAvailabilityParameters.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Management.AppConfiguration.Models +{ + /// Parameters used for checking whether a resource name is available. + public partial class CheckNameAvailabilityParameters + { + /// Initializes a new instance of CheckNameAvailabilityParameters. + /// The name to check for availability. + public CheckNameAvailabilityParameters(string name) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + Name = name; + Type = "Microsoft.AppConfiguration/configurationStores"; + } + + /// Initializes a new instance of CheckNameAvailabilityParameters. + /// The name to check for availability. + /// The resource type to check for name availability. + internal CheckNameAvailabilityParameters(string name, string type) + { + Name = name; + Type = type; + } + + /// The name to check for availability. + public string Name { get; } + /// The resource type to check for name availability. + public string Type { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStore.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStore.Serialization.cs new file mode 100644 index 000000000000..e051e3f77f94 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStore.Serialization.cs @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class ConfigurationStore : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Identity != null) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } + writer.WritePropertyName("sku"); + writer.WriteObjectValue(Sku); + if (Id != null) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + if (Name != null) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Type != null) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Tags != null) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (ProvisioningState != null) + { + writer.WritePropertyName("provisioningState"); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (CreationDate != null) + { + writer.WritePropertyName("creationDate"); + writer.WriteStringValue(CreationDate.Value, "O"); + } + if (Endpoint != null) + { + writer.WritePropertyName("endpoint"); + writer.WriteStringValue(Endpoint); + } + if (Encryption != null) + { + writer.WritePropertyName("encryption"); + writer.WriteObjectValue(Encryption); + } + if (PrivateEndpointConnections != null) + { + writer.WritePropertyName("privateEndpointConnections"); + writer.WriteStartArray(); + foreach (var item in PrivateEndpointConnections) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (PublicNetworkAccess != null) + { + writer.WritePropertyName("publicNetworkAccess"); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ConfigurationStore DeserializeConfigurationStore(JsonElement element) + { + ResourceIdentity identity = default; + Sku sku = default; + string id = default; + string name = default; + string type = default; + string location = default; + IDictionary tags = default; + ProvisioningState? provisioningState = default; + DateTimeOffset? creationDate = default; + string endpoint = default; + EncryptionProperties encryption = default; + IList privateEndpointConnections = default; + PublicNetworkAccess? publicNetworkAccess = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ResourceIdentity.DeserializeResourceIdentity(property.Value); + continue; + } + if (property.NameEquals("sku")) + { + sku = Sku.DeserializeSku(property.Value); + continue; + } + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("creationDate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("endpoint")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("encryption")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryption = EncryptionProperties.DeserializeEncryptionProperties(property0.Value); + continue; + } + if (property0.NameEquals("privateEndpointConnections")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(PrivateEndpointConnectionReference.DeserializePrivateEndpointConnectionReference(item)); + } + } + privateEndpointConnections = array; + continue; + } + if (property0.NameEquals("publicNetworkAccess")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicNetworkAccess = new PublicNetworkAccess(property0.Value.GetString()); + continue; + } + } + continue; + } + } + return new ConfigurationStore(id, name, type, location, tags, identity, sku, provisioningState, creationDate, endpoint, encryption, privateEndpointConnections, publicNetworkAccess); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStore.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStore.cs new file mode 100644 index 000000000000..7ffcc7d99a9c --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStore.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The configuration store along with all resource properties. The Configuration Store will have all information to begin utilizing it. + public partial class ConfigurationStore : Resource + { + /// Initializes a new instance of ConfigurationStore. + /// The location of the resource. This cannot be changed after the resource is created. + /// The sku of the configuration store. + public ConfigurationStore(string location, Sku sku) : base(location) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (sku == null) + { + throw new ArgumentNullException(nameof(sku)); + } + + Sku = sku; + } + + /// Initializes a new instance of ConfigurationStore. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The location of the resource. This cannot be changed after the resource is created. + /// The tags of the resource. + /// The managed identity information, if configured. + /// The sku of the configuration store. + /// The provisioning state of the configuration store. + /// The creation date of configuration store. + /// The DNS endpoint where the configuration store API will be available. + /// The encryption settings of the configuration store. + /// The list of private endpoint connections that are set up for this resource. + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + internal ConfigurationStore(string id, string name, string type, string location, IDictionary tags, ResourceIdentity identity, Sku sku, ProvisioningState? provisioningState, DateTimeOffset? creationDate, string endpoint, EncryptionProperties encryption, IList privateEndpointConnections, PublicNetworkAccess? publicNetworkAccess) : base(id, name, type, location, tags) + { + Identity = identity; + Sku = sku; + ProvisioningState = provisioningState; + CreationDate = creationDate; + Endpoint = endpoint; + Encryption = encryption; + PrivateEndpointConnections = privateEndpointConnections; + PublicNetworkAccess = publicNetworkAccess; + } + + /// The managed identity information, if configured. + public ResourceIdentity Identity { get; set; } + /// The sku of the configuration store. + public Sku Sku { get; set; } + /// The provisioning state of the configuration store. + public ProvisioningState? ProvisioningState { get; } + /// The creation date of configuration store. + public DateTimeOffset? CreationDate { get; } + /// The DNS endpoint where the configuration store API will be available. + public string Endpoint { get; } + /// The encryption settings of the configuration store. + public EncryptionProperties Encryption { get; set; } + /// The list of private endpoint connections that are set up for this resource. + public IList PrivateEndpointConnections { get; } + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + public PublicNetworkAccess? PublicNetworkAccess { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreListResult.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreListResult.Serialization.cs new file mode 100644 index 000000000000..baf740bbe5cd --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreListResult.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class ConfigurationStoreListResult + { + internal static ConfigurationStoreListResult DeserializeConfigurationStoreListResult(JsonElement element) + { + IReadOnlyList value = default; + string nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(ConfigurationStore.DeserializeConfigurationStore(item)); + } + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = property.Value.GetString(); + continue; + } + } + return new ConfigurationStoreListResult(value, nextLink); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreListResult.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreListResult.cs new file mode 100644 index 000000000000..7cbda6609303 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreListResult.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The result of a request to list configuration stores. + public partial class ConfigurationStoreListResult + { + /// Initializes a new instance of ConfigurationStoreListResult. + internal ConfigurationStoreListResult() + { + } + + /// Initializes a new instance of ConfigurationStoreListResult. + /// The collection value. + /// The URI that can be used to request the next set of paged results. + internal ConfigurationStoreListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The collection value. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next set of paged results. + public string NextLink { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.Serialization.cs new file mode 100644 index 000000000000..06f06c40370e --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class ConfigurationStoreUpdateParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Identity != null) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } + if (Sku != null) + { + writer.WritePropertyName("sku"); + writer.WriteObjectValue(Sku); + } + if (Tags != null) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Encryption != null) + { + writer.WritePropertyName("encryption"); + writer.WriteObjectValue(Encryption); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.cs new file mode 100644 index 000000000000..b575669ddce0 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The parameters for updating a configuration store. + public partial class ConfigurationStoreUpdateParameters + { + /// Initializes a new instance of ConfigurationStoreUpdateParameters. + public ConfigurationStoreUpdateParameters() + { + } + + /// Initializes a new instance of ConfigurationStoreUpdateParameters. + /// The managed identity information for the configuration store. + /// The SKU of the configuration store. + /// The ARM resource tags. + /// The encryption settings of the configuration store. + internal ConfigurationStoreUpdateParameters(ResourceIdentity identity, Sku sku, IDictionary tags, EncryptionProperties encryption) + { + Identity = identity; + Sku = sku; + Tags = tags; + Encryption = encryption; + } + + /// The managed identity information for the configuration store. + public ResourceIdentity Identity { get; set; } + /// The SKU of the configuration store. + public Sku Sku { get; set; } + /// The ARM resource tags. + public IDictionary Tags { get; set; } + /// The encryption settings of the configuration store. + public EncryptionProperties Encryption { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConnectionStatus.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConnectionStatus.cs new file mode 100644 index 000000000000..822bbdcc20ab --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ConnectionStatus.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The private link service connection status. + public readonly partial struct ConnectionStatus : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + public ConnectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string ApprovedValue = "Approved"; + private const string RejectedValue = "Rejected"; + private const string DisconnectedValue = "Disconnected"; + + /// Pending. + public static ConnectionStatus Pending { get; } = new ConnectionStatus(PendingValue); + /// Approved. + public static ConnectionStatus Approved { get; } = new ConnectionStatus(ApprovedValue); + /// Rejected. + public static ConnectionStatus Rejected { get; } = new ConnectionStatus(RejectedValue); + /// Disconnected. + public static ConnectionStatus Disconnected { get; } = new ConnectionStatus(DisconnectedValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectionStatus left, ConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectionStatus left, ConnectionStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ConnectionStatus(string value) => new ConnectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectionStatus other && Equals(other); + /// + public bool Equals(ConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/EncryptionProperties.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/EncryptionProperties.Serialization.cs new file mode 100644 index 000000000000..dd2489cca3c3 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/EncryptionProperties.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class EncryptionProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (KeyVaultProperties != null) + { + writer.WritePropertyName("keyVaultProperties"); + writer.WriteObjectValue(KeyVaultProperties); + } + writer.WriteEndObject(); + } + + internal static EncryptionProperties DeserializeEncryptionProperties(JsonElement element) + { + KeyVaultProperties keyVaultProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyVaultProperties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyVaultProperties = KeyVaultProperties.DeserializeKeyVaultProperties(property.Value); + continue; + } + } + return new EncryptionProperties(keyVaultProperties); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/EncryptionProperties.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/EncryptionProperties.cs new file mode 100644 index 000000000000..61f7f370c719 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/EncryptionProperties.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// The encryption settings for a configuration store. + public partial class EncryptionProperties + { + /// Initializes a new instance of EncryptionProperties. + public EncryptionProperties() + { + } + + /// Initializes a new instance of EncryptionProperties. + /// Key vault properties. + internal EncryptionProperties(KeyVaultProperties keyVaultProperties) + { + KeyVaultProperties = keyVaultProperties; + } + + /// Key vault properties. + public KeyVaultProperties KeyVaultProperties { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Error.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Error.Serialization.cs new file mode 100644 index 000000000000..7c1098bbd514 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Error.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class Error + { + internal static Error DeserializeError(JsonElement element) + { + string code = default; + string message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + message = property.Value.GetString(); + continue; + } + } + return new Error(code, message); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Error.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Error.cs new file mode 100644 index 000000000000..7d7b1c7eeba7 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Error.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// AppConfiguration error object. + public partial class Error + { + /// Initializes a new instance of Error. + internal Error() + { + } + + /// Initializes a new instance of Error. + /// Error code. + /// Error message. + internal Error(string code, string message) + { + Code = code; + Message = message; + } + + /// Error code. + public string Code { get; } + /// Error message. + public string Message { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/IdentityType.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/IdentityType.cs new file mode 100644 index 000000000000..740c4ca96ab6 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/IdentityType.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. + public readonly partial struct IdentityType : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + public IdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string SystemAssignedValue = "SystemAssigned"; + private const string UserAssignedValue = "UserAssigned"; + private const string SystemAssignedUserAssignedValue = "SystemAssigned, UserAssigned"; + + /// None. + public static IdentityType None { get; } = new IdentityType(NoneValue); + /// SystemAssigned. + public static IdentityType SystemAssigned { get; } = new IdentityType(SystemAssignedValue); + /// UserAssigned. + public static IdentityType UserAssigned { get; } = new IdentityType(UserAssignedValue); + /// SystemAssigned, UserAssigned. + public static IdentityType SystemAssignedUserAssigned { get; } = new IdentityType(SystemAssignedUserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(IdentityType left, IdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IdentityType left, IdentityType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator IdentityType(string value) => new IdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IdentityType other && Equals(other); + /// + public bool Equals(IdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyValue.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyValue.Serialization.cs new file mode 100644 index 000000000000..3ffaade29fff --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyValue.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class KeyValue + { + internal static KeyValue DeserializeKeyValue(JsonElement element) + { + string key = default; + string label = default; + string value = default; + string contentType = default; + string eTag = default; + DateTimeOffset? lastModified = default; + bool? locked = default; + IReadOnlyDictionary tags = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("label")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("contentType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + contentType = property.Value.GetString(); + continue; + } + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModified")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModified = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("locked")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + locked = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + } + tags = dictionary; + continue; + } + } + return new KeyValue(key, label, value, contentType, eTag, lastModified, locked, tags); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyValue.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyValue.cs new file mode 100644 index 000000000000..dc6b0ba401e8 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyValue.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The result of a request to retrieve a key-value from the specified configuration store. + public partial class KeyValue + { + /// Initializes a new instance of KeyValue. + internal KeyValue() + { + } + + /// Initializes a new instance of KeyValue. + /// + /// The primary identifier of a key-value. + /// + /// The key is used in unison with the label to uniquely identify a key-value. + /// + /// + /// A value used to group key-values. + /// + /// The label is used in unison with the key to uniquely identify a key-value. + /// + /// The value of the key-value. + /// + /// The content type of the key-value's value. + /// + /// Providing a proper content-type can enable transformations of values when they are retrieved by applications. + /// + /// An ETag indicating the state of a key-value within a configuration store. + /// The last time a modifying operation was performed on the given key-value. + /// + /// A value indicating whether the key-value is locked. + /// + /// A locked key-value may not be modified until it is unlocked. + /// + /// A dictionary of tags that can help identify what a key-value may be applicable for. + internal KeyValue(string key, string label, string value, string contentType, string eTag, DateTimeOffset? lastModified, bool? locked, IReadOnlyDictionary tags) + { + Key = key; + Label = label; + Value = value; + ContentType = contentType; + ETag = eTag; + LastModified = lastModified; + Locked = locked; + Tags = tags; + } + + /// + /// The primary identifier of a key-value. + /// + /// The key is used in unison with the label to uniquely identify a key-value. + /// + public string Key { get; } + /// + /// A value used to group key-values. + /// + /// The label is used in unison with the key to uniquely identify a key-value. + /// + public string Label { get; } + /// The value of the key-value. + public string Value { get; } + /// + /// The content type of the key-value's value. + /// + /// Providing a proper content-type can enable transformations of values when they are retrieved by applications. + /// + public string ContentType { get; } + /// An ETag indicating the state of a key-value within a configuration store. + public string ETag { get; } + /// The last time a modifying operation was performed on the given key-value. + public DateTimeOffset? LastModified { get; } + /// + /// A value indicating whether the key-value is locked. + /// + /// A locked key-value may not be modified until it is unlocked. + /// + public bool? Locked { get; } + /// A dictionary of tags that can help identify what a key-value may be applicable for. + public IReadOnlyDictionary Tags { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyVaultProperties.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyVaultProperties.Serialization.cs new file mode 100644 index 000000000000..1b91d0f81392 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyVaultProperties.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class KeyVaultProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (KeyIdentifier != null) + { + writer.WritePropertyName("keyIdentifier"); + writer.WriteStringValue(KeyIdentifier); + } + if (IdentityClientId != null) + { + writer.WritePropertyName("identityClientId"); + writer.WriteStringValue(IdentityClientId); + } + writer.WriteEndObject(); + } + + internal static KeyVaultProperties DeserializeKeyVaultProperties(JsonElement element) + { + string keyIdentifier = default; + string identityClientId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("identityClientId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityClientId = property.Value.GetString(); + continue; + } + } + return new KeyVaultProperties(keyIdentifier, identityClientId); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyVaultProperties.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyVaultProperties.cs new file mode 100644 index 000000000000..07c23e93b772 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/KeyVaultProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// Settings concerning key vault encryption for a configuration store. + public partial class KeyVaultProperties + { + /// Initializes a new instance of KeyVaultProperties. + public KeyVaultProperties() + { + } + + /// Initializes a new instance of KeyVaultProperties. + /// The URI of the key vault key used to encrypt data. + /// The client id of the identity which will be used to access key vault. + internal KeyVaultProperties(string keyIdentifier, string identityClientId) + { + KeyIdentifier = keyIdentifier; + IdentityClientId = identityClientId; + } + + /// The URI of the key vault key used to encrypt data. + public string KeyIdentifier { get; set; } + /// The client id of the identity which will be used to access key vault. + public string IdentityClientId { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ListKeyValueParameters.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ListKeyValueParameters.Serialization.cs new file mode 100644 index 000000000000..64ed0f8b7f3a --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ListKeyValueParameters.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class ListKeyValueParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("key"); + writer.WriteStringValue(Key); + if (Label != null) + { + writer.WritePropertyName("label"); + writer.WriteStringValue(Label); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ListKeyValueParameters.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ListKeyValueParameters.cs new file mode 100644 index 000000000000..8c0bc8a81846 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ListKeyValueParameters.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The parameters used to list a configuration store key-value. + public partial class ListKeyValueParameters + { + /// Initializes a new instance of ListKeyValueParameters. + /// The key to retrieve. + public ListKeyValueParameters(string key) + { + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + Key = key; + } + + /// Initializes a new instance of ListKeyValueParameters. + /// The key to retrieve. + /// The label of the key. + internal ListKeyValueParameters(string key, string label) + { + Key = key; + Label = label; + } + + /// The key to retrieve. + public string Key { get; } + /// The label of the key. + public string Label { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/NameAvailabilityStatus.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/NameAvailabilityStatus.Serialization.cs new file mode 100644 index 000000000000..9b8908d999b5 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/NameAvailabilityStatus.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class NameAvailabilityStatus + { + internal static NameAvailabilityStatus DeserializeNameAvailabilityStatus(JsonElement element) + { + bool? nameAvailable = default; + string message = default; + string reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nameAvailable")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nameAvailable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("message")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("reason")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reason = property.Value.GetString(); + continue; + } + } + return new NameAvailabilityStatus(nameAvailable, message, reason); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/NameAvailabilityStatus.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/NameAvailabilityStatus.cs new file mode 100644 index 000000000000..606a75245fc2 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/NameAvailabilityStatus.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// The result of a request to check the availability of a resource name. + public partial class NameAvailabilityStatus + { + /// Initializes a new instance of NameAvailabilityStatus. + internal NameAvailabilityStatus() + { + } + + /// Initializes a new instance of NameAvailabilityStatus. + /// The value indicating whether the resource name is available. + /// If any, the error message that provides more detail for the reason that the name is not available. + /// If any, the reason that the name is not available. + internal NameAvailabilityStatus(bool? nameAvailable, string message, string reason) + { + NameAvailable = nameAvailable; + Message = message; + Reason = reason; + } + + /// The value indicating whether the resource name is available. + public bool? NameAvailable { get; } + /// If any, the error message that provides more detail for the reason that the name is not available. + public string Message { get; } + /// If any, the reason that the name is not available. + public string Reason { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinition.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinition.Serialization.cs new file mode 100644 index 000000000000..00ee081d9fc0 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinition.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class OperationDefinition + { + internal static OperationDefinition DeserializeOperationDefinition(JsonElement element) + { + string name = default; + OperationDefinitionDisplay display = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("display")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + display = OperationDefinitionDisplay.DeserializeOperationDefinitionDisplay(property.Value); + continue; + } + } + return new OperationDefinition(name, display); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinition.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinition.cs new file mode 100644 index 000000000000..204a27ba2f5a --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinition.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// The definition of a configuration store operation. + public partial class OperationDefinition + { + /// Initializes a new instance of OperationDefinition. + internal OperationDefinition() + { + } + + /// Initializes a new instance of OperationDefinition. + /// Operation name: {provider}/{resource}/{operation}. + /// The display information for the configuration store operation. + internal OperationDefinition(string name, OperationDefinitionDisplay display) + { + Name = name; + Display = display; + } + + /// Operation name: {provider}/{resource}/{operation}. + public string Name { get; } + /// The display information for the configuration store operation. + public OperationDefinitionDisplay Display { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionDisplay.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionDisplay.Serialization.cs new file mode 100644 index 000000000000..f47c02109261 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionDisplay.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class OperationDefinitionDisplay + { + internal static OperationDefinitionDisplay DeserializeOperationDefinitionDisplay(JsonElement element) + { + string provider = default; + string resource = default; + string operation = default; + string description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provider")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provider = property.Value.GetString(); + continue; + } + if (property.NameEquals("resource")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resource = property.Value.GetString(); + continue; + } + if (property.NameEquals("operation")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operation = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + description = property.Value.GetString(); + continue; + } + } + return new OperationDefinitionDisplay(provider, resource, operation, description); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionDisplay.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionDisplay.cs new file mode 100644 index 000000000000..6e796e6ff7ac --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionDisplay.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// The display information for a configuration store operation. + public partial class OperationDefinitionDisplay + { + /// Initializes a new instance of OperationDefinitionDisplay. + internal OperationDefinitionDisplay() + { + } + + /// Initializes a new instance of OperationDefinitionDisplay. + /// The resource provider name: Microsoft App Configuration.". + /// The resource on which the operation is performed. + /// The operation that users can perform. + /// The description for the operation. + internal OperationDefinitionDisplay(string provider, string resource, string operation, string description) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + } + + /// The resource provider name: Microsoft App Configuration.". + public string Provider { get; } + /// The resource on which the operation is performed. + public string Resource { get; } + /// The operation that users can perform. + public string Operation { get; } + /// The description for the operation. + public string Description { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionListResult.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionListResult.Serialization.cs new file mode 100644 index 000000000000..ec1df96a3ad9 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionListResult.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class OperationDefinitionListResult + { + internal static OperationDefinitionListResult DeserializeOperationDefinitionListResult(JsonElement element) + { + IReadOnlyList value = default; + string nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(OperationDefinition.DeserializeOperationDefinition(item)); + } + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = property.Value.GetString(); + continue; + } + } + return new OperationDefinitionListResult(value, nextLink); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionListResult.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionListResult.cs new file mode 100644 index 000000000000..54846a659f66 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/OperationDefinitionListResult.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The result of a request to list configuration store operations. + public partial class OperationDefinitionListResult + { + /// Initializes a new instance of OperationDefinitionListResult. + internal OperationDefinitionListResult() + { + } + + /// Initializes a new instance of OperationDefinitionListResult. + /// The collection value. + /// The URI that can be used to request the next set of paged results. + internal OperationDefinitionListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The collection value. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next set of paged results. + public string NextLink { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpoint.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpoint.Serialization.cs new file mode 100644 index 000000000000..1df2f05281c2 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpoint.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class PrivateEndpoint : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Id != null) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + writer.WriteEndObject(); + } + + internal static PrivateEndpoint DeserializePrivateEndpoint(JsonElement element) + { + string id = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = property.Value.GetString(); + continue; + } + } + return new PrivateEndpoint(id); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpoint.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 000000000000..105a07d540b9 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// Private endpoint which a connection belongs to. + public partial class PrivateEndpoint + { + /// Initializes a new instance of PrivateEndpoint. + public PrivateEndpoint() + { + } + + /// Initializes a new instance of PrivateEndpoint. + /// The resource Id for private endpoint. + internal PrivateEndpoint(string id) + { + Id = id; + } + + /// The resource Id for private endpoint. + public string Id { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnection.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnection.Serialization.cs new file mode 100644 index 000000000000..f7ac145db7d2 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnection.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class PrivateEndpointConnection : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Id != null) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + if (Name != null) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Type != null) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (ProvisioningState != null) + { + writer.WritePropertyName("provisioningState"); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (PrivateEndpoint != null) + { + writer.WritePropertyName("privateEndpoint"); + writer.WriteObjectValue(PrivateEndpoint); + } + if (PrivateLinkServiceConnectionState != null) + { + writer.WritePropertyName("privateLinkServiceConnectionState"); + writer.WriteObjectValue(PrivateLinkServiceConnectionState); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PrivateEndpointConnection DeserializePrivateEndpointConnection(JsonElement element) + { + string id = default; + string name = default; + string type = default; + ProvisioningState? provisioningState = default; + PrivateEndpoint privateEndpoint = default; + PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("privateEndpoint")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = PrivateEndpoint.DeserializePrivateEndpoint(property0.Value); + continue; + } + if (property0.NameEquals("privateLinkServiceConnectionState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceConnectionState = PrivateLinkServiceConnectionState.DeserializePrivateLinkServiceConnectionState(property0.Value); + continue; + } + } + continue; + } + } + return new PrivateEndpointConnection(id, name, type, provisioningState, privateEndpoint, privateLinkServiceConnectionState); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..215e9bc7d9f2 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// A private endpoint connection. + public partial class PrivateEndpointConnection + { + /// Initializes a new instance of PrivateEndpointConnection. + public PrivateEndpointConnection() + { + } + + /// Initializes a new instance of PrivateEndpointConnection. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The provisioning status of the private endpoint connection. + /// The resource of private endpoint. + /// A collection of information about the state of the connection between service consumer and provider. + internal PrivateEndpointConnection(string id, string name, string type, ProvisioningState? provisioningState, PrivateEndpoint privateEndpoint, PrivateLinkServiceConnectionState privateLinkServiceConnectionState) + { + Id = id; + Name = name; + Type = type; + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + } + + /// The resource ID. + public string Id { get; } + /// The name of the resource. + public string Name { get; } + /// The type of the resource. + public string Type { get; } + /// The provisioning status of the private endpoint connection. + public ProvisioningState? ProvisioningState { get; } + /// The resource of private endpoint. + public PrivateEndpoint PrivateEndpoint { get; set; } + /// A collection of information about the state of the connection between service consumer and provider. + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionListResult.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionListResult.Serialization.cs new file mode 100644 index 000000000000..2f55d247c574 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionListResult.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class PrivateEndpointConnectionListResult + { + internal static PrivateEndpointConnectionListResult DeserializePrivateEndpointConnectionListResult(JsonElement element) + { + IReadOnlyList value = default; + string nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(PrivateEndpointConnection.DeserializePrivateEndpointConnection(item)); + } + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = property.Value.GetString(); + continue; + } + } + return new PrivateEndpointConnectionListResult(value, nextLink); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionListResult.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..04a7d16dd335 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionListResult.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// A list of private endpoint connections. + public partial class PrivateEndpointConnectionListResult + { + /// Initializes a new instance of PrivateEndpointConnectionListResult. + internal PrivateEndpointConnectionListResult() + { + } + + /// Initializes a new instance of PrivateEndpointConnectionListResult. + /// The collection value. + /// The URI that can be used to request the next set of paged results. + internal PrivateEndpointConnectionListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The collection value. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next set of paged results. + public string NextLink { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionReference.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionReference.Serialization.cs new file mode 100644 index 000000000000..f1ab88440fb9 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionReference.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class PrivateEndpointConnectionReference : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Id != null) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + if (Name != null) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Type != null) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (ProvisioningState != null) + { + writer.WritePropertyName("provisioningState"); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (PrivateEndpoint != null) + { + writer.WritePropertyName("privateEndpoint"); + writer.WriteObjectValue(PrivateEndpoint); + } + if (PrivateLinkServiceConnectionState != null) + { + writer.WritePropertyName("privateLinkServiceConnectionState"); + writer.WriteObjectValue(PrivateLinkServiceConnectionState); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PrivateEndpointConnectionReference DeserializePrivateEndpointConnectionReference(JsonElement element) + { + string id = default; + string name = default; + string type = default; + ProvisioningState? provisioningState = default; + PrivateEndpoint privateEndpoint = default; + PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("privateEndpoint")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = PrivateEndpoint.DeserializePrivateEndpoint(property0.Value); + continue; + } + if (property0.NameEquals("privateLinkServiceConnectionState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceConnectionState = PrivateLinkServiceConnectionState.DeserializePrivateLinkServiceConnectionState(property0.Value); + continue; + } + } + continue; + } + } + return new PrivateEndpointConnectionReference(id, name, type, provisioningState, privateEndpoint, privateLinkServiceConnectionState); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionReference.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionReference.cs new file mode 100644 index 000000000000..9ccc2228cb28 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateEndpointConnectionReference.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// A reference to a related private endpoint connection. + public partial class PrivateEndpointConnectionReference + { + /// Initializes a new instance of PrivateEndpointConnectionReference. + public PrivateEndpointConnectionReference() + { + } + + /// Initializes a new instance of PrivateEndpointConnectionReference. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The provisioning status of the private endpoint connection. + /// The resource of private endpoint. + /// A collection of information about the state of the connection between service consumer and provider. + internal PrivateEndpointConnectionReference(string id, string name, string type, ProvisioningState? provisioningState, PrivateEndpoint privateEndpoint, PrivateLinkServiceConnectionState privateLinkServiceConnectionState) + { + Id = id; + Name = name; + Type = type; + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + } + + /// The resource ID. + public string Id { get; } + /// The name of the resource. + public string Name { get; } + /// The type of the resource. + public string Type { get; } + /// The provisioning status of the private endpoint connection. + public ProvisioningState? ProvisioningState { get; } + /// The resource of private endpoint. + public PrivateEndpoint PrivateEndpoint { get; set; } + /// A collection of information about the state of the connection between service consumer and provider. + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResource.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResource.Serialization.cs new file mode 100644 index 000000000000..f99f526af25b --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResource.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class PrivateLinkResource + { + internal static PrivateLinkResource DeserializePrivateLinkResource(JsonElement element) + { + string id = default; + string name = default; + string type = default; + string groupId = default; + IReadOnlyList requiredMembers = default; + IReadOnlyList requiredZoneNames = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("groupId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + groupId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("requiredMembers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } + } + requiredMembers = array; + continue; + } + if (property0.NameEquals("requiredZoneNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } + } + requiredZoneNames = array; + continue; + } + } + continue; + } + } + return new PrivateLinkResource(id, name, type, groupId, requiredMembers, requiredZoneNames); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResource.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 000000000000..02c25b25ccc4 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// A resource that supports private link capabilities. + public partial class PrivateLinkResource + { + /// Initializes a new instance of PrivateLinkResource. + internal PrivateLinkResource() + { + } + + /// Initializes a new instance of PrivateLinkResource. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The private link resource group id. + /// The private link resource required member names. + /// The list of required DNS zone names of the private link resource. + internal PrivateLinkResource(string id, string name, string type, string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames) + { + Id = id; + Name = name; + Type = type; + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + } + + /// The resource ID. + public string Id { get; } + /// The name of the resource. + public string Name { get; } + /// The type of the resource. + public string Type { get; } + /// The private link resource group id. + public string GroupId { get; } + /// The private link resource required member names. + public IReadOnlyList RequiredMembers { get; } + /// The list of required DNS zone names of the private link resource. + public IReadOnlyList RequiredZoneNames { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResourceListResult.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResourceListResult.Serialization.cs new file mode 100644 index 000000000000..8a775bb7d07d --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResourceListResult.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class PrivateLinkResourceListResult + { + internal static PrivateLinkResourceListResult DeserializePrivateLinkResourceListResult(JsonElement element) + { + IReadOnlyList value = default; + string nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(PrivateLinkResource.DeserializePrivateLinkResource(item)); + } + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = property.Value.GetString(); + continue; + } + } + return new PrivateLinkResourceListResult(value, nextLink); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResourceListResult.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..f57d62e73476 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkResourceListResult.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// A list of private link resources. + public partial class PrivateLinkResourceListResult + { + /// Initializes a new instance of PrivateLinkResourceListResult. + internal PrivateLinkResourceListResult() + { + } + + /// Initializes a new instance of PrivateLinkResourceListResult. + /// The collection value. + /// The URI that can be used to request the next set of paged results. + internal PrivateLinkResourceListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The collection value. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next set of paged results. + public string NextLink { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkServiceConnectionState.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkServiceConnectionState.Serialization.cs new file mode 100644 index 000000000000..1b052dc1d065 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkServiceConnectionState.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class PrivateLinkServiceConnectionState : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Status != null) + { + writer.WritePropertyName("status"); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Description != null) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (ActionsRequired != null) + { + writer.WritePropertyName("actionsRequired"); + writer.WriteStringValue(ActionsRequired.Value.ToString()); + } + writer.WriteEndObject(); + } + + internal static PrivateLinkServiceConnectionState DeserializePrivateLinkServiceConnectionState(JsonElement element) + { + ConnectionStatus? status = default; + string description = default; + ActionsRequired? actionsRequired = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new ConnectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actionsRequired = new ActionsRequired(property.Value.GetString()); + continue; + } + } + return new PrivateLinkServiceConnectionState(status, description, actionsRequired); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkServiceConnectionState.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..5cf52a044a52 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// The state of a private link service connection. + public partial class PrivateLinkServiceConnectionState + { + /// Initializes a new instance of PrivateLinkServiceConnectionState. + public PrivateLinkServiceConnectionState() + { + } + + /// Initializes a new instance of PrivateLinkServiceConnectionState. + /// The private link service connection status. + /// The private link service connection description. + /// Any action that is required beyond basic workflow (approve/ reject/ disconnect). + internal PrivateLinkServiceConnectionState(ConnectionStatus? status, string description, ActionsRequired? actionsRequired) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + } + + /// The private link service connection status. + public ConnectionStatus? Status { get; set; } + /// The private link service connection description. + public string Description { get; set; } + /// Any action that is required beyond basic workflow (approve/ reject/ disconnect). + public ActionsRequired? ActionsRequired { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ProvisioningState.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..b768f43a971b --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Management.AppConfiguration.Models +{ + /// The provisioning state of the configuration store. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Creating. + public static ProvisioningState Creating { get; } = new ProvisioningState(CreatingValue); + /// Updating. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// Deleting. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Succeeded. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PublicNetworkAccess.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 000000000000..d272d0e965d0 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/PublicNetworkAccess.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Management.AppConfiguration.Models +{ + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + public readonly partial struct PublicNetworkAccess : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + public PublicNetworkAccess(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static PublicNetworkAccess Enabled { get; } = new PublicNetworkAccess(EnabledValue); + /// Disabled. + public static PublicNetworkAccess Disabled { get; } = new PublicNetworkAccess(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(PublicNetworkAccess left, PublicNetworkAccess right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PublicNetworkAccess left, PublicNetworkAccess right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PublicNetworkAccess(string value) => new PublicNetworkAccess(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PublicNetworkAccess other && Equals(other); + /// + public bool Equals(PublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/RegenerateKeyParameters.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/RegenerateKeyParameters.Serialization.cs new file mode 100644 index 000000000000..15960190f25c --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/RegenerateKeyParameters.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class RegenerateKeyParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Id != null) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/RegenerateKeyParameters.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/RegenerateKeyParameters.cs new file mode 100644 index 000000000000..824467793957 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/RegenerateKeyParameters.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// The parameters used to regenerate an API key. + public partial class RegenerateKeyParameters + { + /// Initializes a new instance of RegenerateKeyParameters. + public RegenerateKeyParameters() + { + } + + /// Initializes a new instance of RegenerateKeyParameters. + /// The id of the key to regenerate. + internal RegenerateKeyParameters(string id) + { + Id = id; + } + + /// The id of the key to regenerate. + public string Id { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Resource.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Resource.Serialization.cs new file mode 100644 index 000000000000..87ca5b297288 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Resource.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class Resource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Id != null) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + if (Name != null) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Type != null) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Tags != null) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + internal static Resource DeserializeResource(JsonElement element) + { + string id = default; + string name = default; + string type = default; + string location = default; + IDictionary tags = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + } + tags = dictionary; + continue; + } + } + return new Resource(id, name, type, location, tags); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Resource.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Resource.cs new file mode 100644 index 000000000000..f54bd2d9e8eb --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Resource.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// An Azure resource. + public partial class Resource + { + /// Initializes a new instance of Resource. + /// The location of the resource. This cannot be changed after the resource is created. + public Resource(string location) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + Location = location; + } + + /// Initializes a new instance of Resource. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The location of the resource. This cannot be changed after the resource is created. + /// The tags of the resource. + internal Resource(string id, string name, string type, string location, IDictionary tags) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + } + + /// The resource ID. + public string Id { get; } + /// The name of the resource. + public string Name { get; } + /// The type of the resource. + public string Type { get; } + /// The location of the resource. This cannot be changed after the resource is created. + public string Location { get; set; } + /// The tags of the resource. + public IDictionary Tags { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ResourceIdentity.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ResourceIdentity.Serialization.cs new file mode 100644 index 000000000000..19d2dce89d94 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ResourceIdentity.Serialization.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class ResourceIdentity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Type != null) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToString()); + } + if (UserAssignedIdentities != null) + { + writer.WritePropertyName("userAssignedIdentities"); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (PrincipalId != null) + { + writer.WritePropertyName("principalId"); + writer.WriteStringValue(PrincipalId); + } + if (TenantId != null) + { + writer.WritePropertyName("tenantId"); + writer.WriteStringValue(TenantId); + } + writer.WriteEndObject(); + } + + internal static ResourceIdentity DeserializeResourceIdentity(JsonElement element) + { + IdentityType? type = default; + IDictionary userAssignedIdentities = default; + string principalId = default; + string tenantId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new IdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, UserIdentity.DeserializeUserIdentity(property0.Value)); + } + } + userAssignedIdentities = dictionary; + continue; + } + if (property.NameEquals("principalId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetString(); + continue; + } + } + return new ResourceIdentity(type, userAssignedIdentities, principalId, tenantId); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ResourceIdentity.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ResourceIdentity.cs new file mode 100644 index 000000000000..41d8e59dc20b --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/ResourceIdentity.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Management.AppConfiguration.Models +{ + /// An identity that can be associated with a resource. + public partial class ResourceIdentity + { + /// Initializes a new instance of ResourceIdentity. + public ResourceIdentity() + { + } + + /// Initializes a new instance of ResourceIdentity. + /// The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. + /// The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// The principal id of the identity. This property will only be provided for a system-assigned identity. + /// The tenant id associated with the resource's identity. This property will only be provided for a system-assigned identity. + internal ResourceIdentity(IdentityType? type, IDictionary userAssignedIdentities, string principalId, string tenantId) + { + Type = type; + UserAssignedIdentities = userAssignedIdentities; + PrincipalId = principalId; + TenantId = tenantId; + } + + /// The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. + public IdentityType? Type { get; set; } + /// The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public IDictionary UserAssignedIdentities { get; set; } + /// The principal id of the identity. This property will only be provided for a system-assigned identity. + public string PrincipalId { get; } + /// The tenant id associated with the resource's identity. This property will only be provided for a system-assigned identity. + public string TenantId { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Sku.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Sku.Serialization.cs new file mode 100644 index 000000000000..05c37d716fc9 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Sku.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class Sku : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WriteEndObject(); + } + + internal static Sku DeserializeSku(JsonElement element) + { + string name = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + } + return new Sku(name); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Sku.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Sku.cs new file mode 100644 index 000000000000..e8cb2c9d095d --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/Sku.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Management.AppConfiguration.Models +{ + /// Describes a configuration store SKU. + public partial class Sku + { + /// Initializes a new instance of Sku. + /// The SKU name of the configuration store. + public Sku(string name) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + Name = name; + } + + /// The SKU name of the configuration store. + public string Name { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/UserIdentity.Serialization.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/UserIdentity.Serialization.cs new file mode 100644 index 000000000000..ef7e4d9fd3cd --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/UserIdentity.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Management.AppConfiguration.Models +{ + public partial class UserIdentity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (PrincipalId != null) + { + writer.WritePropertyName("principalId"); + writer.WriteStringValue(PrincipalId); + } + if (ClientId != null) + { + writer.WritePropertyName("clientId"); + writer.WriteStringValue(ClientId); + } + writer.WriteEndObject(); + } + + internal static UserIdentity DeserializeUserIdentity(JsonElement element) + { + string principalId = default; + string clientId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientId = property.Value.GetString(); + continue; + } + } + return new UserIdentity(principalId, clientId); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/UserIdentity.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/UserIdentity.cs new file mode 100644 index 000000000000..844ef5ff5207 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/Models/UserIdentity.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Management.AppConfiguration.Models +{ + /// A resource identity that is managed by the user of the service. + public partial class UserIdentity + { + /// Initializes a new instance of UserIdentity. + public UserIdentity() + { + } + + /// Initializes a new instance of UserIdentity. + /// The principal ID of the user-assigned identity. + /// The client ID of the user-assigned identity. + internal UserIdentity(string principalId, string clientId) + { + PrincipalId = principalId; + ClientId = clientId; + } + + /// The principal ID of the user-assigned identity. + public string PrincipalId { get; } + /// The client ID of the user-assigned identity. + public string ClientId { get; } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/OperationsClient.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/OperationsClient.cs new file mode 100644 index 000000000000..e4dbaf2f1433 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/OperationsClient.cs @@ -0,0 +1,153 @@ +// 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.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + /// The Operations service client. + public partial class OperationsClient + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal OperationsRestClient RestClient { get; } + /// Initializes a new instance of OperationsClient for mocking. + protected OperationsClient() + { + } + /// Initializes a new instance of OperationsClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + internal OperationsClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2019-11-01-preview") + { + RestClient = new OperationsRestClient(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Checks whether the configuration store name is available for use. + /// The object containing information for the availability request. + /// The cancellation token to use. + public virtual async Task> CheckNameAvailabilityAsync(CheckNameAvailabilityParameters checkNameAvailabilityParameters, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("OperationsClient.CheckNameAvailability"); + scope.Start(); + try + { + return await RestClient.CheckNameAvailabilityAsync(checkNameAvailabilityParameters, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Checks whether the configuration store name is available for use. + /// The object containing information for the availability request. + /// The cancellation token to use. + public virtual Response CheckNameAvailability(CheckNameAvailabilityParameters checkNameAvailabilityParameters, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("OperationsClient.CheckNameAvailability"); + scope.Start(); + try + { + return RestClient.CheckNameAvailability(checkNameAvailabilityParameters, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the operations available from this provider. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public virtual AsyncPageable ListAsync(string skipToken = null, CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("OperationsClient.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("OperationsClient.List"); + scope.Start(); + try + { + var response = await RestClient.ListNextPageAsync(nextLink, skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Lists the operations available from this provider. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public virtual Pageable List(string skipToken = null, CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("OperationsClient.List"); + scope.Start(); + try + { + var response = RestClient.List(skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("OperationsClient.List"); + scope.Start(); + try + { + var response = RestClient.ListNextPage(nextLink, skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/OperationsRestClient.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/OperationsRestClient.cs new file mode 100644 index 000000000000..8e49d61fa375 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/OperationsRestClient.cs @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + internal partial class OperationsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of OperationsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + /// This occurs when one of the required arguments is null. + public OperationsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2019-11-01-preview") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateCheckNameAvailabilityRequest(CheckNameAvailabilityParameters checkNameAvailabilityParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/checkNameAvailability", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Content-Type", "application/json"); + using var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(checkNameAvailabilityParameters); + request.Content = content; + return message; + } + + /// Checks whether the configuration store name is available for use. + /// The object containing information for the availability request. + /// The cancellation token to use. + public async ValueTask> CheckNameAvailabilityAsync(CheckNameAvailabilityParameters checkNameAvailabilityParameters, CancellationToken cancellationToken = default) + { + if (checkNameAvailabilityParameters == null) + { + throw new ArgumentNullException(nameof(checkNameAvailabilityParameters)); + } + + using var message = CreateCheckNameAvailabilityRequest(checkNameAvailabilityParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NameAvailabilityStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = NameAvailabilityStatus.DeserializeNameAvailabilityStatus(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Checks whether the configuration store name is available for use. + /// The object containing information for the availability request. + /// The cancellation token to use. + public Response CheckNameAvailability(CheckNameAvailabilityParameters checkNameAvailabilityParameters, CancellationToken cancellationToken = default) + { + if (checkNameAvailabilityParameters == null) + { + throw new ArgumentNullException(nameof(checkNameAvailabilityParameters)); + } + + using var message = CreateCheckNameAvailabilityRequest(checkNameAvailabilityParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NameAvailabilityStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = NameAvailabilityStatus.DeserializeNameAvailabilityStatus(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.AppConfiguration/operations", false); + uri.AppendQuery("api-version", apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + return message; + } + + /// Lists the operations available from this provider. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public async ValueTask> ListAsync(string skipToken = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationDefinitionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = OperationDefinitionListResult.DeserializeOperationDefinitionListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the operations available from this provider. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public Response List(string skipToken = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationDefinitionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = OperationDefinitionListResult.DeserializeOperationDefinitionListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + return message; + } + + /// Lists the operations available from this provider. + /// The URL to the next page of results. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public async ValueTask> ListNextPageAsync(string nextLink, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationDefinitionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = OperationDefinitionListResult.DeserializeOperationDefinitionListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the operations available from this provider. + /// The URL to the next page of results. + /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. + /// The cancellation token to use. + public Response ListNextPage(string nextLink, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationDefinitionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = OperationDefinitionListResult.DeserializeOperationDefinitionListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsClient.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsClient.cs new file mode 100644 index 000000000000..67e2938702b7 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsClient.cs @@ -0,0 +1,323 @@ +// 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.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + /// The PrivateEndpointConnections service client. + public partial class PrivateEndpointConnectionsClient + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal PrivateEndpointConnectionsRestClient RestClient { get; } + /// Initializes a new instance of PrivateEndpointConnectionsClient for mocking. + protected PrivateEndpointConnectionsClient() + { + } + /// Initializes a new instance of PrivateEndpointConnectionsClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + internal PrivateEndpointConnectionsClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2019-11-01-preview") + { + RestClient = new PrivateEndpointConnectionsRestClient(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Gets the specified private endpoint connection associated with the configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The cancellation token to use. + public virtual async Task> GetAsync(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.Get"); + scope.Start(); + try + { + return await RestClient.GetAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the specified private endpoint connection associated with the configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The cancellation token to use. + public virtual Response Get(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.Get"); + scope.Start(); + try + { + return RestClient.Get(resourceGroupName, configStoreName, privateEndpointConnectionName, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists all private endpoint connections for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public virtual AsyncPageable ListByConfigurationStoreAsync(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.ListByConfigurationStore"); + scope.Start(); + try + { + var response = await RestClient.ListByConfigurationStoreAsync(resourceGroupName, configStoreName, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.ListByConfigurationStore"); + scope.Start(); + try + { + var response = await RestClient.ListByConfigurationStoreNextPageAsync(nextLink, resourceGroupName, configStoreName, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Lists all private endpoint connections for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public virtual Pageable ListByConfigurationStore(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.ListByConfigurationStore"); + scope.Start(); + try + { + var response = RestClient.ListByConfigurationStore(resourceGroupName, configStoreName, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.ListByConfigurationStore"); + scope.Start(); + try + { + var response = RestClient.ListByConfigurationStoreNextPage(nextLink, resourceGroupName, configStoreName, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Update the state of the specified private endpoint connection associated with the configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The private endpoint connection properties. + /// The cancellation token to use. + public virtual async ValueTask StartCreateOrUpdateAsync(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointConnection == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnection)); + } + + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.StartCreateOrUpdate"); + scope.Start(); + try + { + var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection, cancellationToken).ConfigureAwait(false); + return new PrivateEndpointConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Update the state of the specified private endpoint connection associated with the configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The private endpoint connection properties. + /// The cancellation token to use. + public virtual PrivateEndpointConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointConnection == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnection)); + } + + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.StartCreateOrUpdate"); + scope.Start(); + try + { + var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection, cancellationToken); + return new PrivateEndpointConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a private endpoint connection. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The cancellation token to use. + public virtual async ValueTask StartDeleteAsync(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.StartDelete"); + scope.Start(); + try + { + var originalResponse = await RestClient.DeleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, configStoreName, privateEndpointConnectionName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a private endpoint connection. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The cancellation token to use. + public virtual PrivateEndpointConnectionsDeleteOperation StartDelete(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsClient.StartDelete"); + scope.Start(); + try + { + var originalResponse = RestClient.Delete(resourceGroupName, configStoreName, privateEndpointConnectionName, cancellationToken); + return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, configStoreName, privateEndpointConnectionName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsCreateOrUpdateOperation.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsCreateOrUpdateOperation.cs new file mode 100644 index 000000000000..660de1bf5444 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsCreateOrUpdateOperation.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + /// Update the state of the specified private endpoint connection associated with the configuration store. + public partial class PrivateEndpointConnectionsCreateOrUpdateOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + internal PrivateEndpointConnectionsCreateOrUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "PrivateEndpointConnectionsCreateOrUpdateOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override PrivateEndpointConnection Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + PrivateEndpointConnection IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + return null; + } + else + { + return PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement); + } + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + return null; + } + else + { + return PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsDeleteOperation.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsDeleteOperation.cs new file mode 100644 index 000000000000..9d5789491c7f --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsDeleteOperation.cs @@ -0,0 +1,62 @@ +// 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; + +namespace Azure.Management.AppConfiguration +{ + /// Deletes a private endpoint connection. + public partial class PrivateEndpointConnectionsDeleteOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + internal PrivateEndpointConnectionsDeleteOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "PrivateEndpointConnectionsDeleteOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override Response Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + return response; + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + return await new ValueTask(response).ConfigureAwait(false); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsRestClient.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsRestClient.cs new file mode 100644 index 000000000000..d142bf952e3d --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateEndpointConnectionsRestClient.cs @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + internal partial class PrivateEndpointConnectionsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of PrivateEndpointConnectionsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + /// This occurs when one of the required arguments is null. + public PrivateEndpointConnectionsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2019-11-01-preview") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListByConfigurationStoreRequest(string resourceGroupName, string configStoreName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Lists all private endpoint connections for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public async ValueTask> ListByConfigurationStoreAsync(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreRequest(resourceGroupName, configStoreName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all private endpoint connections for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public Response ListByConfigurationStore(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreRequest(resourceGroupName, configStoreName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string configStoreName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Gets the specified private endpoint connection associated with the configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The cancellation token to use. + public async ValueTask> GetAsync(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateGetRequest(resourceGroupName, configStoreName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets the specified private endpoint connection associated with the configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The cancellation token to use. + public Response Get(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateGetRequest(resourceGroupName, configStoreName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Content-Type", "application/json"); + using var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(privateEndpointConnection); + request.Content = content; + return message; + } + + /// Update the state of the specified private endpoint connection associated with the configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The private endpoint connection properties. + /// The cancellation token to use. + public async ValueTask CreateOrUpdateAsync(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointConnection == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnection)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 201: + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Update the state of the specified private endpoint connection associated with the configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The private endpoint connection properties. + /// The cancellation token to use. + public Response CreateOrUpdate(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointConnection == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnection)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 201: + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string configStoreName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Deletes a private endpoint connection. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The cancellation token to use. + public async ValueTask DeleteAsync(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, configStoreName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Deletes a private endpoint connection. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Private endpoint connection name. + /// The cancellation token to use. + public Response Delete(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, configStoreName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByConfigurationStoreNextPageRequest(string nextLink, string resourceGroupName, string configStoreName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + return message; + } + + /// Lists all private endpoint connections for a configuration store. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public async ValueTask> ListByConfigurationStoreNextPageAsync(string nextLink, string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreNextPageRequest(nextLink, resourceGroupName, configStoreName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all private endpoint connections for a configuration store. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public Response ListByConfigurationStoreNextPage(string nextLink, string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreNextPageRequest(nextLink, resourceGroupName, configStoreName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateLinkResourcesClient.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateLinkResourcesClient.cs new file mode 100644 index 000000000000..45323908e657 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateLinkResourcesClient.cs @@ -0,0 +1,177 @@ +// 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.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + /// The PrivateLinkResources service client. + public partial class PrivateLinkResourcesClient + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal PrivateLinkResourcesRestClient RestClient { get; } + /// Initializes a new instance of PrivateLinkResourcesClient for mocking. + protected PrivateLinkResourcesClient() + { + } + /// Initializes a new instance of PrivateLinkResourcesClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + internal PrivateLinkResourcesClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2019-11-01-preview") + { + RestClient = new PrivateLinkResourcesRestClient(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Gets a private link resource that need to be created for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The name of the private link resource group. + /// The cancellation token to use. + public virtual async Task> GetAsync(string resourceGroupName, string configStoreName, string groupName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesClient.Get"); + scope.Start(); + try + { + return await RestClient.GetAsync(resourceGroupName, configStoreName, groupName, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets a private link resource that need to be created for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The name of the private link resource group. + /// The cancellation token to use. + public virtual Response Get(string resourceGroupName, string configStoreName, string groupName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesClient.Get"); + scope.Start(); + try + { + return RestClient.Get(resourceGroupName, configStoreName, groupName, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the private link resources that need to be created for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public virtual AsyncPageable ListByConfigurationStoreAsync(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesClient.ListByConfigurationStore"); + scope.Start(); + try + { + var response = await RestClient.ListByConfigurationStoreAsync(resourceGroupName, configStoreName, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesClient.ListByConfigurationStore"); + scope.Start(); + try + { + var response = await RestClient.ListByConfigurationStoreNextPageAsync(nextLink, resourceGroupName, configStoreName, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Gets the private link resources that need to be created for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public virtual Pageable ListByConfigurationStore(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesClient.ListByConfigurationStore"); + scope.Start(); + try + { + var response = RestClient.ListByConfigurationStore(resourceGroupName, configStoreName, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesClient.ListByConfigurationStore"); + scope.Start(); + try + { + var response = RestClient.ListByConfigurationStoreNextPage(nextLink, resourceGroupName, configStoreName, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateLinkResourcesRestClient.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateLinkResourcesRestClient.cs new file mode 100644 index 000000000000..51dde4c391ff --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Generated/PrivateLinkResourcesRestClient.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Management.AppConfiguration.Models; + +namespace Azure.Management.AppConfiguration +{ + internal partial class PrivateLinkResourcesRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of PrivateLinkResourcesRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + /// This occurs when one of the required arguments is null. + public PrivateLinkResourcesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2019-11-01-preview") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListByConfigurationStoreRequest(string resourceGroupName, string configStoreName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Gets the private link resources that need to be created for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public async ValueTask> ListByConfigurationStoreAsync(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreRequest(resourceGroupName, configStoreName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateLinkResourceListResult.DeserializePrivateLinkResourceListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets the private link resources that need to be created for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public Response ListByConfigurationStore(string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreRequest(resourceGroupName, configStoreName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateLinkResourceListResult.DeserializePrivateLinkResourceListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string configStoreName, string groupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/privateLinkResources/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Gets a private link resource that need to be created for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The name of the private link resource group. + /// The cancellation token to use. + public async ValueTask> GetAsync(string resourceGroupName, string configStoreName, string groupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (groupName == null) + { + throw new ArgumentNullException(nameof(groupName)); + } + + using var message = CreateGetRequest(resourceGroupName, configStoreName, groupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateLinkResource.DeserializePrivateLinkResource(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets a private link resource that need to be created for a configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The name of the private link resource group. + /// The cancellation token to use. + public Response Get(string resourceGroupName, string configStoreName, string groupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (groupName == null) + { + throw new ArgumentNullException(nameof(groupName)); + } + + using var message = CreateGetRequest(resourceGroupName, configStoreName, groupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateLinkResource.DeserializePrivateLinkResource(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByConfigurationStoreNextPageRequest(string nextLink, string resourceGroupName, string configStoreName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + return message; + } + + /// Gets the private link resources that need to be created for a configuration store. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public async ValueTask> ListByConfigurationStoreNextPageAsync(string nextLink, string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreNextPageRequest(nextLink, resourceGroupName, configStoreName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateLinkResourceListResult.DeserializePrivateLinkResourceListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets the private link resources that need to be created for a configuration store. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// The cancellation token to use. + public Response ListByConfigurationStoreNextPage(string nextLink, string resourceGroupName, string configStoreName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreNextPageRequest(nextLink, resourceGroupName, configStoreName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + if (document.RootElement.ValueKind == JsonValueKind.Null) + { + value = null; + } + else + { + value = PrivateLinkResourceListResult.DeserializePrivateLinkResourceListResult(document.RootElement); + } + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Properties/AssemblyInfo.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..697b4daa5f77 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/Properties/AssemblyInfo.cs @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.AppConfiguration")] + +[assembly: InternalsVisibleTo("Azure.Management.AppConfiguration.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/src/autorest.md b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/autorest.md new file mode 100644 index 000000000000..7c304c143c2e --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/src/autorest.md @@ -0,0 +1,8 @@ +# Generated code configuration + +Run `dotnet msbuild /t:GenerateCode` to generate code. + +``` yaml +azure-arm: true +require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/c81039d056cc5aa0a0025f5b9e5446a7c194bd1f/specification/appconfiguration/resource-manager/readme.md +``` diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/tests/AppConfigurationManagementTestEnvironment.cs b/sdk/appconfiguration/Azure.Management.AppConfiguration/tests/AppConfigurationManagementTestEnvironment.cs new file mode 100644 index 000000000000..1df2553898a0 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/tests/AppConfigurationManagementTestEnvironment.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + + +using Azure.Core.TestFramework; + +namespace Azure.Management.AppConfiguration.Tests +{ + public class AppConfigurationManagementTestEnvironment : TestEnvironment + { + public AppConfigurationManagementTestEnvironment() : base("appconfigurationmgmt") + { + } + } +} diff --git a/sdk/appconfiguration/Azure.Management.AppConfiguration/tests/Azure.Management.AppConfiguration.Tests.csproj b/sdk/appconfiguration/Azure.Management.AppConfiguration/tests/Azure.Management.AppConfiguration.Tests.csproj new file mode 100644 index 000000000000..db840ccb3d50 --- /dev/null +++ b/sdk/appconfiguration/Azure.Management.AppConfiguration/tests/Azure.Management.AppConfiguration.Tests.csproj @@ -0,0 +1,5 @@ + + + + + diff --git a/sdk/appconfiguration/ci.yml b/sdk/appconfiguration/ci.yml index d7c152331c8c..9abf93442b51 100644 --- a/sdk/appconfiguration/ci.yml +++ b/sdk/appconfiguration/ci.yml @@ -40,3 +40,5 @@ stages: Artifacts: - name: Azure.Data.AppConfiguration safeName: AzureDataAppConfiguration + - name: Azure.Management.AppConfiguration + safeName: AzureManagementAppConfiguration