diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/Azure.ResourceManager.HybridData.sln b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/Azure.ResourceManager.HybridData.sln deleted file mode 100644 index f93e8ccd076b..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/Azure.ResourceManager.HybridData.sln +++ /dev/null @@ -1,53 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30309.148 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{C847C6EC-5FD5-4345-BAF4-9711EF3F9ED9}") = "Azure.ResourceManager.HybridData", "src\Azure.ResourceManager.HybridData.csproj", "{8CE7134C-B2F1-4497-BE4E-54DB5012267A}" -EndProject -Project("{C847C6EC-5FD5-4345-BAF4-9711EF3F9ED9}") = "Azure.ResourceManager.HybridData.Tests", "tests\Azure.ResourceManager.HybridData.Tests.csproj", "{D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}" -EndProject -Project("{C847C6EC-5FD5-4345-BAF4-9711EF3F9ED9}") = "Azure.ResourceManager.HybridData.Samples", "samples\Azure.ResourceManager.HybridData.Samples.csproj", "{7938CA22-B6A8-4D28-93D1-F4657C260608}" -EndProject -Global - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A2A8D6CF-F96E-4425-A1AA-1DD7230A776D} - EndGlobalSection - 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 - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Debug|x64.ActiveCfg = Debug|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Debug|x64.Build.0 = Debug|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Debug|x86.ActiveCfg = Debug|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Debug|x86.Build.0 = Debug|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Release|Any CPU.Build.0 = Release|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Release|x64.ActiveCfg = Release|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Release|x64.Build.0 = Release|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Release|x86.ActiveCfg = Release|Any CPU - {8CE7134C-B2F1-4497-BE4E-54DB5012267A}.Release|x86.Build.0 = Release|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Debug|x64.ActiveCfg = Debug|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Debug|x64.Build.0 = Debug|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Debug|x86.ActiveCfg = Debug|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Debug|x86.Build.0 = Debug|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Release|Any CPU.Build.0 = Release|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Release|x64.ActiveCfg = Release|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Release|x64.Build.0 = Release|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Release|x86.ActiveCfg = Release|Any CPU - {D8AC3A0D-D0FB-4AE0-8451-6213278E7F2F}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/CHANGELOG.md b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/CHANGELOG.md deleted file mode 100644 index ba9cf2d09b7d..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/CHANGELOG.md +++ /dev/null @@ -1,62 +0,0 @@ -# Release History - -## 1.1.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.1.0-beta.1 (2023-05-30) - -### Features Added - -- Enable the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). - -### Other Changes - -- Upgraded dependent Azure.Core to 1.32.0. -- Upgraded dependent Azure.ResourceManager to 1.6.0. - -## 1.0.1 (2023-02-17) - -### Other Changes - -- Upgraded dependent `Azure.Core` to `1.28.0`. -- Upgraded dependent `Azure.ResourceManager` to `1.4.0`. - -## 1.0.0 (2022-11-04) - -This package is the first stable release of the Microsoft Azure Hybrid Data management client library. - -### Other Changes - -- Updated the README file according to Azure SDK documentation guidelines. - -## 1.0.0-beta.1 (2022-10-26) - -### Breaking Changes - -New design of track 2 initial commit. - -### Package Name - -The package name has been changed from `Microsoft.Azure.Management.HybridData` to `Azure.ResourceManager.HybridData`. - -### General New Features - -This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: - - - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. - - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. - - HTTP pipeline with custom policies. - - Better error-handling. - - Support uniform telemetry across all languages. - -This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). - -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). - diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/Directory.Build.props b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/Directory.Build.props deleted file mode 100644 index 1a9611bd4924..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/Directory.Build.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/README.md b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/README.md deleted file mode 100644 index 8884d10bce04..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# Microsoft Azure Hybrid Data management client library for .NET - -This library supports managing Microsoft Azure Hybrid Data resources. - -This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: - - - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. - - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. - - HTTP pipeline with custom policies. - - Better error-handling. - - Support uniform telemetry across all languages. - -## Getting started - -### Install the package - -Install the Microsoft Azure Hybrid Data management library for .NET with [NuGet](https://www.nuget.org/): - -```dotnetcli -dotnet add package Azure.ResourceManager.HybridData -``` - -### Prerequisites - -* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). - -### Authenticate the Client - -To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). - -## Key concepts - -Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html). - -## Documentation - -Documentation is available to help you learn how to use this package: - -- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). -- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). - -## Examples - -Code samples for using the management library for .NET can be found in the following locations -- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) - -## Troubleshooting - -- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). -- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. - -## Next steps - -For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). - -## Contributing - -For details on contributing to this repository, see the [contributing -guide][cg]. - -This project welcomes contributions and suggestions. Most contributions -require you to agree to a Contributor License Agreement (CLA) declaring -that you have the right to, and actually do, grant us the rights to use -your contribution. For details, visit . - -When you submit a pull request, a CLA-bot will automatically determine -whether you need to provide a CLA and decorate the PR appropriately -(for example, label, comment). Follow the instructions provided by the -bot. You'll only need to do this action once across all repositories -using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For -more information, see the [Code of Conduct FAQ][coc_faq] or contact - with any other questions or comments. - - -[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md -[coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/api/Azure.ResourceManager.HybridData.netstandard2.0.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/api/Azure.ResourceManager.HybridData.netstandard2.0.cs deleted file mode 100644 index fc92ba6e08a5..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/api/Azure.ResourceManager.HybridData.netstandard2.0.cs +++ /dev/null @@ -1,444 +0,0 @@ -namespace Azure.ResourceManager.HybridData -{ - public static partial class HybridDataExtensions - { - public static Azure.ResourceManager.HybridData.HybridDataJobDefinitionResource GetHybridDataJobDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataJobResource GetHybridDataJobResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.Response GetHybridDataManager(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string dataManagerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetHybridDataManagerAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string dataManagerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataManagerResource GetHybridDataManagerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataManagerCollection GetHybridDataManagers(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetHybridDataManagers(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetHybridDataManagersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataPublicKeyResource GetHybridDataPublicKeyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataServiceResource GetHybridDataServiceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataStoreResource GetHybridDataStoreResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataStoreTypeResource GetHybridDataStoreTypeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - } - public partial class HybridDataJobCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected HybridDataJobCollection() { } - public virtual Azure.Response Exists(string jobId, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string jobId, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string jobId, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string jobId, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class HybridDataJobData : Azure.ResourceManager.Models.ResourceData - { - public HybridDataJobData(Azure.ResourceManager.HybridData.Models.HybridDataJobStatus status, System.DateTimeOffset startOn, Azure.ResourceManager.HybridData.Models.JobCancellationSetting isCancellable) { } - public long? BytesProcessed { get { throw null; } set { } } - public string DataSinkName { get { throw null; } set { } } - public string DataSourceName { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.HybridDataJobDetails Details { get { throw null; } set { } } - public System.DateTimeOffset? EndOn { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.HybridDataJobTopLevelError Error { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.JobCancellationSetting IsCancellable { get { throw null; } set { } } - public long? ItemsProcessed { get { throw null; } set { } } - public System.DateTimeOffset StartOn { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.HybridDataJobStatus Status { get { throw null; } set { } } - public long? TotalBytesToProcess { get { throw null; } set { } } - public long? TotalItemsToProcess { get { throw null; } set { } } - } - public partial class HybridDataJobDefinitionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected HybridDataJobDefinitionCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string jobDefinitionName, Azure.ResourceManager.HybridData.HybridDataJobDefinitionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string jobDefinitionName, Azure.ResourceManager.HybridData.HybridDataJobDefinitionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string jobDefinitionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string jobDefinitionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string jobDefinitionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string jobDefinitionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class HybridDataJobDefinitionData : Azure.ResourceManager.Models.ResourceData - { - public HybridDataJobDefinitionData(string dataSourceId, string dataSinkId, Azure.ResourceManager.HybridData.Models.HybridDataState state) { } - public System.Collections.Generic.IList CustomerSecrets { get { throw null; } } - public System.BinaryData DataServiceInput { get { throw null; } set { } } - public string DataSinkId { get { throw null; } set { } } - public string DataSourceId { get { throw null; } set { } } - public System.DateTimeOffset? LastModifiedOn { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.HybridDataJobRunLocation? RunLocation { get { throw null; } set { } } - public System.Collections.Generic.IList Schedules { get { throw null; } } - public Azure.ResourceManager.HybridData.Models.HybridDataState State { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.UserConfirmationSetting? UserConfirmation { get { throw null; } set { } } - } - public partial class HybridDataJobDefinitionResource : Azure.ResourceManager.ArmResource - { - public static readonly Azure.Core.ResourceType ResourceType; - protected HybridDataJobDefinitionResource() { } - public virtual Azure.ResourceManager.HybridData.HybridDataJobDefinitionData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetHybridDataJob(string jobId, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetHybridDataJobAsync(string jobId, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.HybridData.HybridDataJobCollection GetHybridDataJobs() { throw null; } - public virtual Azure.ResourceManager.ArmOperation Run(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridData.Models.HybridDataJobRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task RunAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridData.Models.HybridDataJobRunContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridData.HybridDataJobDefinitionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridData.HybridDataJobDefinitionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class HybridDataJobResource : Azure.ResourceManager.ArmResource - { - public static readonly Azure.Core.ResourceType ResourceType; - protected HybridDataJobResource() { } - public virtual Azure.ResourceManager.HybridData.HybridDataJobData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.ResourceManager.ArmOperation Cancel(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task CancelAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId) { throw null; } - public virtual Azure.Response Get(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Resume(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task ResumeAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class HybridDataManagerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected HybridDataManagerCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dataManagerName, Azure.ResourceManager.HybridData.HybridDataManagerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dataManagerName, Azure.ResourceManager.HybridData.HybridDataManagerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string dataManagerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string dataManagerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string dataManagerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string dataManagerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class HybridDataManagerData : Azure.ResourceManager.Models.TrackedResourceData - { - public HybridDataManagerData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } - public Azure.ETag? ETag { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.HybridDataSku Sku { get { throw null; } set { } } - } - public partial class HybridDataManagerResource : Azure.ResourceManager.ArmResource - { - public static readonly Azure.Core.ResourceType ResourceType; - protected HybridDataManagerResource() { } - public virtual Azure.ResourceManager.HybridData.HybridDataManagerData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetHybridDataPublicKey(string publicKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetHybridDataPublicKeyAsync(string publicKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.HybridData.HybridDataPublicKeyCollection GetHybridDataPublicKeys() { throw null; } - public virtual Azure.Response GetHybridDataService(string dataServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetHybridDataServiceAsync(string dataServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.HybridData.HybridDataServiceCollection GetHybridDataServices() { throw null; } - public virtual Azure.Response GetHybridDataStore(string dataStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetHybridDataStoreAsync(string dataStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.HybridData.HybridDataStoreCollection GetHybridDataStores() { throw null; } - public virtual Azure.Response GetHybridDataStoreType(string dataStoreTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetHybridDataStoreTypeAsync(string dataStoreTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.HybridData.HybridDataStoreTypeCollection GetHybridDataStoreTypes() { throw null; } - public virtual Azure.Pageable GetJobDefinitions(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetJobDefinitionsAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetJobs(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetJobsAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridData.Models.HybridDataManagerPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridData.Models.HybridDataManagerPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class HybridDataPublicKeyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected HybridDataPublicKeyCollection() { } - public virtual Azure.Response Exists(string publicKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string publicKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string publicKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string publicKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class HybridDataPublicKeyData : Azure.ResourceManager.Models.ResourceData - { - public HybridDataPublicKeyData(Azure.ResourceManager.HybridData.Models.HybridDataEncryptionKey dataServiceLevel1Key, Azure.ResourceManager.HybridData.Models.HybridDataEncryptionKey dataServiceLevel2Key) { } - public Azure.ResourceManager.HybridData.Models.HybridDataEncryptionKey DataServiceLevel1Key { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.HybridDataEncryptionKey DataServiceLevel2Key { get { throw null; } set { } } - } - public partial class HybridDataPublicKeyResource : Azure.ResourceManager.ArmResource - { - public static readonly Azure.Core.ResourceType ResourceType; - protected HybridDataPublicKeyResource() { } - public virtual Azure.ResourceManager.HybridData.HybridDataPublicKeyData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string publicKeyName) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class HybridDataServiceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected HybridDataServiceCollection() { } - public virtual Azure.Response Exists(string dataServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string dataServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string dataServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string dataServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class HybridDataServiceData : Azure.ResourceManager.Models.ResourceData - { - public HybridDataServiceData(Azure.ResourceManager.HybridData.Models.HybridDataState state) { } - public Azure.ResourceManager.HybridData.Models.HybridDataState State { get { throw null; } set { } } - public System.Collections.Generic.IList SupportedDataSinkTypes { get { throw null; } } - public System.Collections.Generic.IList SupportedDataSourceTypes { get { throw null; } } - } - public partial class HybridDataServiceResource : Azure.ResourceManager.ArmResource - { - public static readonly Azure.Core.ResourceType ResourceType; - protected HybridDataServiceResource() { } - public virtual Azure.ResourceManager.HybridData.HybridDataServiceData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetHybridDataJobDefinition(string jobDefinitionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetHybridDataJobDefinitionAsync(string jobDefinitionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.HybridData.HybridDataJobDefinitionCollection GetHybridDataJobDefinitions() { throw null; } - public virtual Azure.Pageable GetJobs(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetJobsAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class HybridDataStoreCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected HybridDataStoreCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dataStoreName, Azure.ResourceManager.HybridData.HybridDataStoreData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dataStoreName, Azure.ResourceManager.HybridData.HybridDataStoreData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string dataStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string dataStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string dataStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string dataStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class HybridDataStoreData : Azure.ResourceManager.Models.ResourceData - { - public HybridDataStoreData(Azure.ResourceManager.HybridData.Models.HybridDataState state, Azure.Core.ResourceIdentifier dataStoreTypeId) { } - public System.Collections.Generic.IList CustomerSecrets { get { throw null; } } - public Azure.Core.ResourceIdentifier DataStoreTypeId { get { throw null; } set { } } - public System.BinaryData ExtendedProperties { get { throw null; } set { } } - public Azure.Core.ResourceIdentifier RepositoryId { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.HybridDataState State { get { throw null; } set { } } - } - public partial class HybridDataStoreResource : Azure.ResourceManager.ArmResource - { - public static readonly Azure.Core.ResourceType ResourceType; - protected HybridDataStoreResource() { } - public virtual Azure.ResourceManager.HybridData.HybridDataStoreData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridData.HybridDataStoreData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridData.HybridDataStoreData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class HybridDataStoreTypeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected HybridDataStoreTypeCollection() { } - public virtual Azure.Response Exists(string dataStoreTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string dataStoreTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string dataStoreTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string dataStoreTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class HybridDataStoreTypeData : Azure.ResourceManager.Models.ResourceData - { - public HybridDataStoreTypeData(Azure.ResourceManager.HybridData.Models.HybridDataState state) { } - public Azure.Core.ResourceType? RepositoryType { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.HybridDataState State { get { throw null; } set { } } - public System.Collections.Generic.IList SupportedDataServicesAsSink { get { throw null; } } - public System.Collections.Generic.IList SupportedDataServicesAsSource { get { throw null; } } - } - public partial class HybridDataStoreTypeResource : Azure.ResourceManager.ArmResource - { - public static readonly Azure.Core.ResourceType ResourceType; - protected HybridDataStoreTypeResource() { } - public virtual Azure.ResourceManager.HybridData.HybridDataStoreTypeData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreTypeName) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } -} -namespace Azure.ResourceManager.HybridData.Models -{ - public static partial class ArmHybridDataModelFactory - { - public static Azure.ResourceManager.HybridData.HybridDataJobData HybridDataJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridData.Models.HybridDataJobStatus status = Azure.ResourceManager.HybridData.Models.HybridDataJobStatus.None, System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridData.Models.HybridDataJobTopLevelError error = null, Azure.ResourceManager.HybridData.Models.JobCancellationSetting isCancellable = Azure.ResourceManager.HybridData.Models.JobCancellationSetting.NotCancellable, long? bytesProcessed = default(long?), long? itemsProcessed = default(long?), long? totalBytesToProcess = default(long?), long? totalItemsToProcess = default(long?), Azure.ResourceManager.HybridData.Models.HybridDataJobDetails details = null, string dataSourceName = null, string dataSinkName = null) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataJobDefinitionData HybridDataJobDefinitionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string dataSourceId = null, string dataSinkId = null, System.Collections.Generic.IEnumerable schedules = null, Azure.ResourceManager.HybridData.Models.HybridDataState state = Azure.ResourceManager.HybridData.Models.HybridDataState.Disabled, System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridData.Models.HybridDataJobRunLocation? runLocation = default(Azure.ResourceManager.HybridData.Models.HybridDataJobRunLocation?), Azure.ResourceManager.HybridData.Models.UserConfirmationSetting? userConfirmation = default(Azure.ResourceManager.HybridData.Models.UserConfirmationSetting?), System.BinaryData dataServiceInput = null, System.Collections.Generic.IEnumerable customerSecrets = null) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataManagerData HybridDataManagerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.HybridData.Models.HybridDataSku sku = null) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataPublicKeyData HybridDataPublicKeyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridData.Models.HybridDataEncryptionKey dataServiceLevel1Key = null, Azure.ResourceManager.HybridData.Models.HybridDataEncryptionKey dataServiceLevel2Key = null) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataServiceData HybridDataServiceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridData.Models.HybridDataState state = Azure.ResourceManager.HybridData.Models.HybridDataState.Disabled, System.Collections.Generic.IEnumerable supportedDataSinkTypes = null, System.Collections.Generic.IEnumerable supportedDataSourceTypes = null) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataStoreData HybridDataStoreData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier repositoryId = null, Azure.ResourceManager.HybridData.Models.HybridDataState state = Azure.ResourceManager.HybridData.Models.HybridDataState.Disabled, System.BinaryData extendedProperties = null, Azure.Core.ResourceIdentifier dataStoreTypeId = null, System.Collections.Generic.IEnumerable customerSecrets = null) { throw null; } - public static Azure.ResourceManager.HybridData.HybridDataStoreTypeData HybridDataStoreTypeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceType? repositoryType = default(Azure.Core.ResourceType?), Azure.ResourceManager.HybridData.Models.HybridDataState state = Azure.ResourceManager.HybridData.Models.HybridDataState.Disabled, System.Collections.Generic.IEnumerable supportedDataServicesAsSink = null, System.Collections.Generic.IEnumerable supportedDataServicesAsSource = null) { throw null; } - } - public partial class HybridDataCustomerSecret - { - public HybridDataCustomerSecret(string keyIdentifier, string keyValue, Azure.ResourceManager.HybridData.Models.SupportedEncryptionAlgorithm algorithm) { } - public Azure.ResourceManager.HybridData.Models.SupportedEncryptionAlgorithm Algorithm { get { throw null; } set { } } - public string KeyIdentifier { get { throw null; } set { } } - public string KeyValue { get { throw null; } set { } } - } - public partial class HybridDataEncryptionKey - { - public HybridDataEncryptionKey(string keyModulus, string keyExponent, int encryptionChunkSizeInBytes) { } - public int EncryptionChunkSizeInBytes { get { throw null; } set { } } - public string KeyExponent { get { throw null; } set { } } - public string KeyModulus { get { throw null; } set { } } - } - public partial class HybridDataJobDetails - { - public HybridDataJobDetails() { } - public System.Collections.Generic.IList ErrorDetails { get { throw null; } } - public string ItemDetailsLink { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.HybridDataJobDefinitionData JobDefinition { get { throw null; } set { } } - public System.Collections.Generic.IList JobStages { get { throw null; } } - } - public partial class HybridDataJobErrorDetails - { - public HybridDataJobErrorDetails() { } - public int? ErrorCode { get { throw null; } set { } } - public string ErrorMessage { get { throw null; } set { } } - public string ExceptionMessage { get { throw null; } set { } } - public string RecommendedAction { get { throw null; } set { } } - } - public partial class HybridDataJobRunContent - { - public HybridDataJobRunContent() { } - public System.Collections.Generic.IList CustomerSecrets { get { throw null; } } - public System.BinaryData DataServiceInput { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.UserConfirmationSetting? UserConfirmation { get { throw null; } set { } } - } - public enum HybridDataJobRunLocation - { - None = 0, - AustraliaEast = 1, - AustraliaSoutheast = 2, - BrazilSouth = 3, - CanadaCentral = 4, - CanadaEast = 5, - CentralIndia = 6, - CentralUS = 7, - EastAsia = 8, - EastUS = 9, - EastUS2 = 10, - JapanEast = 11, - JapanWest = 12, - KoreaCentral = 13, - KoreaSouth = 14, - SoutheastAsia = 15, - SouthCentralUS = 16, - SouthIndia = 17, - NorthCentralUS = 18, - NorthEurope = 19, - UKSouth = 20, - UKWest = 21, - WestCentralUS = 22, - WestEurope = 23, - WestIndia = 24, - WestUS = 25, - WestUS2 = 26, - } - public partial class HybridDataJobRunSchedule - { - public HybridDataJobRunSchedule() { } - public string Name { get { throw null; } set { } } - public System.Collections.Generic.IList PolicyList { get { throw null; } } - } - public partial class HybridDataJobStage - { - public HybridDataJobStage(Azure.ResourceManager.HybridData.Models.HybridDataJobStatus stageStatus) { } - public System.Collections.Generic.IList ErrorDetails { get { throw null; } } - public System.BinaryData JobStageDetails { get { throw null; } set { } } - public string StageName { get { throw null; } set { } } - public Azure.ResourceManager.HybridData.Models.HybridDataJobStatus StageStatus { get { throw null; } set { } } - } - public enum HybridDataJobStatus - { - None = 0, - InProgress = 1, - Succeeded = 2, - WaitingForAction = 3, - Failed = 4, - Cancelled = 5, - Cancelling = 6, - PartiallySucceeded = 7, - } - public partial class HybridDataJobTopLevelError - { - public HybridDataJobTopLevelError(string code) { } - public string Code { get { throw null; } set { } } - public string Message { get { throw null; } set { } } - } - public partial class HybridDataManagerPatch - { - public HybridDataManagerPatch() { } - public Azure.ResourceManager.HybridData.Models.HybridDataSku Sku { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - } - public partial class HybridDataSku - { - public HybridDataSku() { } - public string Name { get { throw null; } set { } } - public string Tier { get { throw null; } set { } } - } - public enum HybridDataState - { - Disabled = 0, - Enabled = 1, - Supported = 2, - } - public enum JobCancellationSetting - { - NotCancellable = 0, - Cancellable = 1, - } - public enum SupportedEncryptionAlgorithm - { - None = 0, - Rsa1_5 = 1, - Rsa_Oaep = 2, - PlainText = 3, - } - public enum UserConfirmationSetting - { - NotRequired = 0, - Required = 1, - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/assets.json b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/assets.json deleted file mode 100644 index d1f49e268f2c..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "net", - "TagPrefix": "net/hybriddatamanager/Azure.ResourceManager.HybridData", - "Tag": "" -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Azure.ResourceManager.HybridData.Samples.csproj b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Azure.ResourceManager.HybridData.Samples.csproj deleted file mode 100644 index 5dfb98fd843e..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Azure.ResourceManager.HybridData.Samples.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobCollection.cs deleted file mode 100644 index 83344f34a49f..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobCollection.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataJobCollection - { - // Jobs_ListByJobDefinitionGET91 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_JobsListByJobDefinitionGET91() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_ListByJobDefinition-GET-example-91.json - // this example is just showing the usage of "Jobs_ListByJobDefinition" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobDefinitionResource created on azure - // for more information of creating HybridDataJobDefinitionResource, please refer to the document of HybridDataJobDefinitionResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - ResourceIdentifier hybridDataJobDefinitionResourceId = HybridDataJobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - HybridDataJobDefinitionResource hybridDataJobDefinition = client.GetHybridDataJobDefinitionResource(hybridDataJobDefinitionResourceId); - - // get the collection of this HybridDataJobResource - HybridDataJobCollection collection = hybridDataJobDefinition.GetHybridDataJobs(); - - // invoke the operation and iterate over the result - await foreach (HybridDataJobResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Jobs_GetGET101 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_JobsGetGET101() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_Get-GET-example-101.json - // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobDefinitionResource created on azure - // for more information of creating HybridDataJobDefinitionResource, please refer to the document of HybridDataJobDefinitionResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - ResourceIdentifier hybridDataJobDefinitionResourceId = HybridDataJobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - HybridDataJobDefinitionResource hybridDataJobDefinition = client.GetHybridDataJobDefinitionResource(hybridDataJobDefinitionResourceId); - - // get the collection of this HybridDataJobResource - HybridDataJobCollection collection = hybridDataJobDefinition.GetHybridDataJobs(); - - // invoke the operation - string jobId = "99ef93fe-36be-43e4-bebf-de6746730601"; - HybridDataJobResource result = await collection.GetAsync(jobId); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Jobs_GetGET101 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_JobsGetGET101() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_Get-GET-example-101.json - // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobDefinitionResource created on azure - // for more information of creating HybridDataJobDefinitionResource, please refer to the document of HybridDataJobDefinitionResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - ResourceIdentifier hybridDataJobDefinitionResourceId = HybridDataJobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - HybridDataJobDefinitionResource hybridDataJobDefinition = client.GetHybridDataJobDefinitionResource(hybridDataJobDefinitionResourceId); - - // get the collection of this HybridDataJobResource - HybridDataJobCollection collection = hybridDataJobDefinition.GetHybridDataJobs(); - - // invoke the operation - string jobId = "99ef93fe-36be-43e4-bebf-de6746730601"; - bool result = await collection.ExistsAsync(jobId); - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobDefinitionCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobDefinitionCollection.cs deleted file mode 100644 index a122b13a7632..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobDefinitionCollection.cs +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; -using Azure.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataJobDefinitionCollection - { - // JobDefinitions_ListByDataServiceGET71 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_JobDefinitionsListByDataServiceGET71() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_ListByDataService-GET-example-71.json - // this example is just showing the usage of "JobDefinitions_ListByDataService" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataServiceResource created on azure - // for more information of creating HybridDataServiceResource, please refer to the document of HybridDataServiceResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - ResourceIdentifier hybridDataServiceResourceId = HybridDataServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName); - HybridDataServiceResource hybridDataService = client.GetHybridDataServiceResource(hybridDataServiceResourceId); - - // get the collection of this HybridDataJobDefinitionResource - HybridDataJobDefinitionCollection collection = hybridDataService.GetHybridDataJobDefinitions(); - - // invoke the operation and iterate over the result - await foreach (HybridDataJobDefinitionResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobDefinitionData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // JobDefinitions_GetGET81 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_JobDefinitionsGetGET81() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_Get-GET-example-81.json - // this example is just showing the usage of "JobDefinitions_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataServiceResource created on azure - // for more information of creating HybridDataServiceResource, please refer to the document of HybridDataServiceResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - ResourceIdentifier hybridDataServiceResourceId = HybridDataServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName); - HybridDataServiceResource hybridDataService = client.GetHybridDataServiceResource(hybridDataServiceResourceId); - - // get the collection of this HybridDataJobDefinitionResource - HybridDataJobDefinitionCollection collection = hybridDataService.GetHybridDataJobDefinitions(); - - // invoke the operation - string jobDefinitionName = "jobdeffromtestcode1"; - HybridDataJobDefinitionResource result = await collection.GetAsync(jobDefinitionName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobDefinitionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // JobDefinitions_GetGET81 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_JobDefinitionsGetGET81() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_Get-GET-example-81.json - // this example is just showing the usage of "JobDefinitions_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataServiceResource created on azure - // for more information of creating HybridDataServiceResource, please refer to the document of HybridDataServiceResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - ResourceIdentifier hybridDataServiceResourceId = HybridDataServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName); - HybridDataServiceResource hybridDataService = client.GetHybridDataServiceResource(hybridDataServiceResourceId); - - // get the collection of this HybridDataJobDefinitionResource - HybridDataJobDefinitionCollection collection = hybridDataService.GetHybridDataJobDefinitions(); - - // invoke the operation - string jobDefinitionName = "jobdeffromtestcode1"; - bool result = await collection.ExistsAsync(jobDefinitionName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // JobDefinitions_CreateOrUpdatePUT83 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_JobDefinitionsCreateOrUpdatePUT83() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_CreateOrUpdate-PUT-example-83.json - // this example is just showing the usage of "JobDefinitions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataServiceResource created on azure - // for more information of creating HybridDataServiceResource, please refer to the document of HybridDataServiceResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - ResourceIdentifier hybridDataServiceResourceId = HybridDataServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName); - HybridDataServiceResource hybridDataService = client.GetHybridDataServiceResource(hybridDataServiceResourceId); - - // get the collection of this HybridDataJobDefinitionResource - HybridDataJobDefinitionCollection collection = hybridDataService.GetHybridDataJobDefinitions(); - - // invoke the operation - string jobDefinitionName = "jobdeffromtestcode1"; - HybridDataJobDefinitionData data = new HybridDataJobDefinitionData("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStores/TestStorSimpleSource1", "/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStores/TestAzureStorage1", HybridDataState.Enabled) - { - RunLocation = HybridDataJobRunLocation.WestUS, - UserConfirmation = UserConfirmationSetting.Required, - DataServiceInput = BinaryData.FromObjectAsJson(new Dictionary() - { - ["AzureStorageType"] = "Blob", - ["BackupChoice"] = "UseExistingLatest", - ["ContainerName"] = "containerfromtest", - ["DeviceName"] = "8600-SHG0997877L71FC", - ["FileNameFilter"] = "*", - ["IsDirectoryMode"] = "false", - ["RootDirectories"] = new object[] { "\\" }, - ["VolumeNames"] = new object[] { "TestAutomation" } - }), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, jobDefinitionName, data); - HybridDataJobDefinitionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobDefinitionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobDefinitionResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobDefinitionResource.cs deleted file mode 100644 index d6e4938817d6..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobDefinitionResource.cs +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; -using Azure.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataJobDefinitionResource - { - // JobDefinitions_GetGET81 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_JobDefinitionsGetGET81() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_Get-GET-example-81.json - // this example is just showing the usage of "JobDefinitions_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobDefinitionResource created on azure - // for more information of creating HybridDataJobDefinitionResource, please refer to the document of HybridDataJobDefinitionResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - ResourceIdentifier hybridDataJobDefinitionResourceId = HybridDataJobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - HybridDataJobDefinitionResource hybridDataJobDefinition = client.GetHybridDataJobDefinitionResource(hybridDataJobDefinitionResourceId); - - // invoke the operation - HybridDataJobDefinitionResource result = await hybridDataJobDefinition.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobDefinitionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // JobDefinitions_CreateOrUpdatePUT83 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_JobDefinitionsCreateOrUpdatePUT83() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_CreateOrUpdate-PUT-example-83.json - // this example is just showing the usage of "JobDefinitions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobDefinitionResource created on azure - // for more information of creating HybridDataJobDefinitionResource, please refer to the document of HybridDataJobDefinitionResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - ResourceIdentifier hybridDataJobDefinitionResourceId = HybridDataJobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - HybridDataJobDefinitionResource hybridDataJobDefinition = client.GetHybridDataJobDefinitionResource(hybridDataJobDefinitionResourceId); - - // invoke the operation - HybridDataJobDefinitionData data = new HybridDataJobDefinitionData("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStores/TestStorSimpleSource1", "/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStores/TestAzureStorage1", HybridDataState.Enabled) - { - RunLocation = HybridDataJobRunLocation.WestUS, - UserConfirmation = UserConfirmationSetting.Required, - DataServiceInput = BinaryData.FromObjectAsJson(new Dictionary() - { - ["AzureStorageType"] = "Blob", - ["BackupChoice"] = "UseExistingLatest", - ["ContainerName"] = "containerfromtest", - ["DeviceName"] = "8600-SHG0997877L71FC", - ["FileNameFilter"] = "*", - ["IsDirectoryMode"] = "false", - ["RootDirectories"] = new object[] { "\\" }, - ["VolumeNames"] = new object[] { "TestAutomation" } - }), - }; - ArmOperation lro = await hybridDataJobDefinition.UpdateAsync(WaitUntil.Completed, data); - HybridDataJobDefinitionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobDefinitionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // JobDefinitions_DeleteDELETE81 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_JobDefinitionsDeleteDELETE81() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_Delete-DELETE-example-81.json - // this example is just showing the usage of "JobDefinitions_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobDefinitionResource created on azure - // for more information of creating HybridDataJobDefinitionResource, please refer to the document of HybridDataJobDefinitionResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - ResourceIdentifier hybridDataJobDefinitionResourceId = HybridDataJobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - HybridDataJobDefinitionResource hybridDataJobDefinition = client.GetHybridDataJobDefinitionResource(hybridDataJobDefinitionResourceId); - - // invoke the operation - await hybridDataJobDefinition.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // JobDefinitions_RunPOST132 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Run_JobDefinitionsRunPOST132() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_Run-POST-example-132.json - // this example is just showing the usage of "JobDefinitions_Run" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobDefinitionResource created on azure - // for more information of creating HybridDataJobDefinitionResource, please refer to the document of HybridDataJobDefinitionResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - ResourceIdentifier hybridDataJobDefinitionResourceId = HybridDataJobDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - HybridDataJobDefinitionResource hybridDataJobDefinition = client.GetHybridDataJobDefinitionResource(hybridDataJobDefinitionResourceId); - - // invoke the operation - HybridDataJobRunContent content = new HybridDataJobRunContent() - { - UserConfirmation = UserConfirmationSetting.NotRequired, - DataServiceInput = BinaryData.FromObjectAsJson(new Dictionary() - { - ["AzureStorageType"] = "Blob", - ["BackupChoice"] = "UseExistingLatest", - ["ContainerName"] = "containerfromtest", - ["DeviceName"] = "8600-SHG0997877L71FC", - ["FileNameFilter"] = "*", - ["IsDirectoryMode"] = "false", - ["RootDirectories"] = new object[] { "\\" }, - ["VolumeNames"] = new object[] { "TestAutomation" } - }), - CustomerSecrets = -{ -}, - }; - await hybridDataJobDefinition.RunAsync(WaitUntil.Completed, content); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobResource.cs deleted file mode 100644 index fb6a548bb5e7..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataJobResource.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataJobResource - { - // Jobs_GetGET101 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_JobsGetGET101() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_Get-GET-example-101.json - // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobResource created on azure - // for more information of creating HybridDataJobResource, please refer to the document of HybridDataJobResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - string jobId = "99ef93fe-36be-43e4-bebf-de6746730601"; - ResourceIdentifier hybridDataJobResourceId = HybridDataJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, jobId); - HybridDataJobResource hybridDataJob = client.GetHybridDataJobResource(hybridDataJobResourceId); - - // invoke the operation - HybridDataJobResource result = await hybridDataJob.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Jobs_CancelPOST111 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Cancel_JobsCancelPOST111() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_Cancel-POST-example-111.json - // this example is just showing the usage of "Jobs_Cancel" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobResource created on azure - // for more information of creating HybridDataJobResource, please refer to the document of HybridDataJobResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - string jobId = "6eca9b3d-5ffe-4b44-9607-1ba838371ff7"; - ResourceIdentifier hybridDataJobResourceId = HybridDataJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, jobId); - HybridDataJobResource hybridDataJob = client.GetHybridDataJobResource(hybridDataJobResourceId); - - // invoke the operation - await hybridDataJob.CancelAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Jobs_ResumePOST121 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Resume_JobsResumePOST121() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_Resume-POST-example-121.json - // this example is just showing the usage of "Jobs_Resume" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataJobResource created on azure - // for more information of creating HybridDataJobResource, please refer to the document of HybridDataJobResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - string jobDefinitionName = "jobdeffromtestcode1"; - string jobId = "99ef93fe-36be-43e4-bebf-de6746730601"; - ResourceIdentifier hybridDataJobResourceId = HybridDataJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, jobId); - HybridDataJobResource hybridDataJob = client.GetHybridDataJobResource(hybridDataJobResourceId); - - // invoke the operation - await hybridDataJob.ResumeAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataManagerCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataManagerCollection.cs deleted file mode 100644 index 285ccb3dfaa9..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataManagerCollection.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataManagerCollection - { - // DataManagers_ListByResourceGroupGET31 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_DataManagersListByResourceGroupGET31() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_ListByResourceGroup-GET-example-31.json - // this example is just showing the usage of "DataManagers_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this HybridDataManagerResource - HybridDataManagerCollection collection = resourceGroupResource.GetHybridDataManagers(); - - // invoke the operation and iterate over the result - await foreach (HybridDataManagerResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataManagerData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // DataManagers_GetGET41 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataManagersGetGET41() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Get-GET-example-41.json - // this example is just showing the usage of "DataManagers_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this HybridDataManagerResource - HybridDataManagerCollection collection = resourceGroupResource.GetHybridDataManagers(); - - // invoke the operation - string dataManagerName = "TestAzureSDKOperations"; - HybridDataManagerResource result = await collection.GetAsync(dataManagerName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataManagerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataManagers_GetGET41 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_DataManagersGetGET41() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Get-GET-example-41.json - // this example is just showing the usage of "DataManagers_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this HybridDataManagerResource - HybridDataManagerCollection collection = resourceGroupResource.GetHybridDataManagers(); - - // invoke the operation - string dataManagerName = "TestAzureSDKOperations"; - bool result = await collection.ExistsAsync(dataManagerName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // DataManagers_CreatePUT41 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_DataManagersCreatePUT41() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Create-PUT-example-41.json - // this example is just showing the usage of "DataManagers_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this HybridDataManagerResource - HybridDataManagerCollection collection = resourceGroupResource.GetHybridDataManagers(); - - // invoke the operation - string dataManagerName = "TestAzureSDKOperations"; - HybridDataManagerData data = new HybridDataManagerData(new AzureLocation("westus")); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataManagerName, data); - HybridDataManagerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataManagerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataManagerResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataManagerResource.cs deleted file mode 100644 index 2b63576a3f5e..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataManagerResource.cs +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataManagerResource - { - // DataManagers_ListGET21 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetHybridDataManagers_DataManagersListGET21() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_List-GET-example-21.json - // this example is just showing the usage of "DataManagers_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (HybridDataManagerResource item in subscriptionResource.GetHybridDataManagersAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataManagerData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // DataManagers_GetGET41 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataManagersGetGET41() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Get-GET-example-41.json - // this example is just showing the usage of "DataManagers_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // invoke the operation - HybridDataManagerResource result = await hybridDataManager.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataManagerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataManagers_DeleteDELETE41 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DataManagersDeleteDELETE41() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Delete-DELETE-example-41.json - // this example is just showing the usage of "DataManagers_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // invoke the operation - await hybridDataManager.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // DataManagers_UpdatePATCH43 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_DataManagersUpdatePATCH43() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Update-PATCH-example-43.json - // this example is just showing the usage of "DataManagers_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // invoke the operation - HybridDataManagerPatch patch = new HybridDataManagerPatch() - { - Sku = new HybridDataSku() - { - Name = "DS0", - Tier = "Standard", - }, - Tags = -{ -["UpdateDateTime"] = "05-Feb-20 2:17:22 PM", -}, - }; - ArmOperation lro = await hybridDataManager.UpdateAsync(WaitUntil.Completed, patch); - HybridDataManagerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataManagerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // JobDefinitions_ListByDataManagerGET191 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetJobDefinitions_JobDefinitionsListByDataManagerGET191() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_ListByDataManager-GET-example-191.json - // this example is just showing the usage of "JobDefinitions_ListByDataManager" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // invoke the operation and iterate over the result - await foreach (HybridDataJobDefinitionResource item in hybridDataManager.GetJobDefinitionsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobDefinitionData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Jobs_ListByDataManagerGET201 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetJobs_JobsListByDataManagerGET201() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_ListByDataManager-GET-example-201.json - // this example is just showing the usage of "Jobs_ListByDataManager" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // invoke the operation and iterate over the result - await foreach (HybridDataJobResource item in hybridDataManager.GetJobsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataPublicKeyCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataPublicKeyCollection.cs deleted file mode 100644 index 53180c59548f..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataPublicKeyCollection.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataPublicKeyCollection - { - // PublicKeys_ListByDataManagerGET211 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_PublicKeysListByDataManagerGET211() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/PublicKeys_ListByDataManager-GET-example-211.json - // this example is just showing the usage of "PublicKeys_ListByDataManager" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataPublicKeyResource - HybridDataPublicKeyCollection collection = hybridDataManager.GetHybridDataPublicKeys(); - - // invoke the operation and iterate over the result - await foreach (HybridDataPublicKeyResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataPublicKeyData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // PublicKeys_GetGET222 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_PublicKeysGetGET222() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/PublicKeys_Get-GET-example-222.json - // this example is just showing the usage of "PublicKeys_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataPublicKeyResource - HybridDataPublicKeyCollection collection = hybridDataManager.GetHybridDataPublicKeys(); - - // invoke the operation - string publicKeyName = "default"; - HybridDataPublicKeyResource result = await collection.GetAsync(publicKeyName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataPublicKeyData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // PublicKeys_GetGET222 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_PublicKeysGetGET222() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/PublicKeys_Get-GET-example-222.json - // this example is just showing the usage of "PublicKeys_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataPublicKeyResource - HybridDataPublicKeyCollection collection = hybridDataManager.GetHybridDataPublicKeys(); - - // invoke the operation - string publicKeyName = "default"; - bool result = await collection.ExistsAsync(publicKeyName); - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataPublicKeyResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataPublicKeyResource.cs deleted file mode 100644 index b416323fa44e..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataPublicKeyResource.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataPublicKeyResource - { - // PublicKeys_GetGET222 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_PublicKeysGetGET222() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/PublicKeys_Get-GET-example-222.json - // this example is just showing the usage of "PublicKeys_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataPublicKeyResource created on azure - // for more information of creating HybridDataPublicKeyResource, please refer to the document of HybridDataPublicKeyResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string publicKeyName = "default"; - ResourceIdentifier hybridDataPublicKeyResourceId = HybridDataPublicKeyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, publicKeyName); - HybridDataPublicKeyResource hybridDataPublicKey = client.GetHybridDataPublicKeyResource(hybridDataPublicKeyResourceId); - - // invoke the operation - HybridDataPublicKeyResource result = await hybridDataPublicKey.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataPublicKeyData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataServiceCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataServiceCollection.cs deleted file mode 100644 index 67522b79bed4..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataServiceCollection.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataServiceCollection - { - // DataServices_ListByDataManagerGET51 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_DataServicesListByDataManagerGET51() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataServices_ListByDataManager-GET-example-51.json - // this example is just showing the usage of "DataServices_ListByDataManager" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataServiceResource - HybridDataServiceCollection collection = hybridDataManager.GetHybridDataServices(); - - // invoke the operation and iterate over the result - await foreach (HybridDataServiceResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataServiceData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // DataServices_GetGET62 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataServicesGetGET62() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataServices_Get-GET-example-62.json - // this example is just showing the usage of "DataServices_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataServiceResource - HybridDataServiceCollection collection = hybridDataManager.GetHybridDataServices(); - - // invoke the operation - string dataServiceName = "DataTransformation"; - HybridDataServiceResource result = await collection.GetAsync(dataServiceName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataServiceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataServices_GetGET62 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_DataServicesGetGET62() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataServices_Get-GET-example-62.json - // this example is just showing the usage of "DataServices_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataServiceResource - HybridDataServiceCollection collection = hybridDataManager.GetHybridDataServices(); - - // invoke the operation - string dataServiceName = "DataTransformation"; - bool result = await collection.ExistsAsync(dataServiceName); - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataServiceResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataServiceResource.cs deleted file mode 100644 index f7f2af148163..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataServiceResource.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataServiceResource - { - // DataServices_GetGET62 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataServicesGetGET62() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataServices_Get-GET-example-62.json - // this example is just showing the usage of "DataServices_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataServiceResource created on azure - // for more information of creating HybridDataServiceResource, please refer to the document of HybridDataServiceResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - ResourceIdentifier hybridDataServiceResourceId = HybridDataServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName); - HybridDataServiceResource hybridDataService = client.GetHybridDataServiceResource(hybridDataServiceResourceId); - - // invoke the operation - HybridDataServiceResource result = await hybridDataService.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataServiceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Jobs_ListByDataServiceGET141 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetJobs_JobsListByDataServiceGET141() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_ListByDataService-GET-example-141.json - // this example is just showing the usage of "Jobs_ListByDataService" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataServiceResource created on azure - // for more information of creating HybridDataServiceResource, please refer to the document of HybridDataServiceResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataServiceName = "DataTransformation"; - ResourceIdentifier hybridDataServiceResourceId = HybridDataServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataServiceName); - HybridDataServiceResource hybridDataService = client.GetHybridDataServiceResource(hybridDataServiceResourceId); - - // invoke the operation and iterate over the result - await foreach (HybridDataJobResource item in hybridDataService.GetJobsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataJobData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreCollection.cs deleted file mode 100644 index 107245925e01..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreCollection.cs +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; -using Azure.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataStoreCollection - { - // DataStores_ListByDataManagerGET151 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_DataStoresListByDataManagerGET151() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_ListByDataManager-GET-example-151.json - // this example is just showing the usage of "DataStores_ListByDataManager" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreResource - HybridDataStoreCollection collection = hybridDataManager.GetHybridDataStores(); - - // invoke the operation and iterate over the result - await foreach (HybridDataStoreResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // DataStores_GetGET161 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataStoresGetGET161() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Get-GET-example-161.json - // this example is just showing the usage of "DataStores_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreResource - HybridDataStoreCollection collection = hybridDataManager.GetHybridDataStores(); - - // invoke the operation - string dataStoreName = "TestStorSimpleSource1"; - HybridDataStoreResource result = await collection.GetAsync(dataStoreName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStores_GetGET161 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_DataStoresGetGET161() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Get-GET-example-161.json - // this example is just showing the usage of "DataStores_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreResource - HybridDataStoreCollection collection = hybridDataManager.GetHybridDataStores(); - - // invoke the operation - string dataStoreName = "TestStorSimpleSource1"; - bool result = await collection.ExistsAsync(dataStoreName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // DataStores_GetGET162 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataStoresGetGET162() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Get-GET-example-162.json - // this example is just showing the usage of "DataStores_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreResource - HybridDataStoreCollection collection = hybridDataManager.GetHybridDataStores(); - - // invoke the operation - string dataStoreName = "TestAzureStorage1"; - HybridDataStoreResource result = await collection.GetAsync(dataStoreName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStores_GetGET162 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_DataStoresGetGET162() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Get-GET-example-162.json - // this example is just showing the usage of "DataStores_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreResource - HybridDataStoreCollection collection = hybridDataManager.GetHybridDataStores(); - - // invoke the operation - string dataStoreName = "TestAzureStorage1"; - bool result = await collection.ExistsAsync(dataStoreName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // DataStores_CreateOrUpdate_DataSinkPUT162 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_DataStoresCreateOrUpdateDataSinkPUT162() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_CreateOrUpdate_DataSink-PUT-example-162.json - // this example is just showing the usage of "DataStores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreResource - HybridDataStoreCollection collection = hybridDataManager.GetHybridDataStores(); - - // invoke the operation - string dataStoreName = "TestAzureStorage1"; - HybridDataStoreData data = new HybridDataStoreData(HybridDataState.Enabled, new ResourceIdentifier("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStoreTypes/AzureStorageAccount")) - { - RepositoryId = new ResourceIdentifier("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.Storage/storageAccounts/dmsdatasink"), - ExtendedProperties = BinaryData.FromObjectAsJson(new Dictionary() - { - ["extendedSaKey"] = null, - ["extendedSaName"] = "/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.Storage/storageAccounts/dmsdatasink", - ["storageAccountNameForQueue"] = "/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.Storage/storageAccounts/dmsdatasink" - }), - CustomerSecrets = -{ -new HybridDataCustomerSecret("StorageAccountAccessKey","Of4H9eF03G8QuxvkZQEbFWv3YdN3U//WugzuqReQekbXXQyg+QSicVKrwSOOKVi1zWMYGbKg7d5/ES2gdz+O5ZEw89bvE4mJD/wQmkIsqhPnbN0gyVK6nZePXVUU1A+UzjLfvhSA6KyUQfzNAZ5/TLt6fo1JyQrKTtkvnkLFyfv1AqBZ+dw8JK3RZi/rEN8HD3R3qsBwUYfyEuGLGiujy2CGrr/1uPiUVMR6QuFWRsjm39eMSHa4maLg4tQ0IY/jIy8rMlx3KjF3CcCbPzAqEq5vXy37wkjZbus771te1gLSrzcpVKIMg4DrmgaoJ02jAu+izBjNgLXAFPSUneQ8yw==:ezMkh4PMhCnjJtYkpTaP0SdblP5VAeRe4glW2PgIzICHw3T8ZyGDoaTrCv4/m5wtcEhWdtxhta+j1MQWlK5MIA+hvf8QjIDIjQv696ov5y+pcFe/upd2ekGOei7FCwB2u7I8WnkAtIKTUkf6eDQBZXm26DjfG1Dlc+Mjjq+AerukEa6WpOyqrD7Qub26Pgmj4AsuBx19X1EAmTZacubkoiNagXM8V+IDanHOhLMvfgQ7rw8oZhWfofxi4m+eJqjOXXaqSyorNK8UEcqP6P9pDP8AN8ulXEx6rZy2B5Oi0vSV+wlRLbUuQslga4ItOGxctW/ZX8uWozt+5A3k4URt6A==",SupportedEncryptionAlgorithm.Rsa1_5),new HybridDataCustomerSecret("StorageAccountAccessKeyForQueue","Of4H9eF03G8QuxvkZQEbFWv3YdN3U//WugzuqReQekbXXQyg+QSicVKrwSOOKVi1zWMYGbKg7d5/ES2gdz+O5ZEw89bvE4mJD/wQmkIsqhPnbN0gyVK6nZePXVUU1A+UzjLfvhSA6KyUQfzNAZ5/TLt6fo1JyQrKTtkvnkLFyfv1AqBZ+dw8JK3RZi/rEN8HD3R3qsBwUYfyEuGLGiujy2CGrr/1uPiUVMR6QuFWRsjm39eMSHa4maLg4tQ0IY/jIy8rMlx3KjF3CcCbPzAqEq5vXy37wkjZbus771te1gLSrzcpVKIMg4DrmgaoJ02jAu+izBjNgLXAFPSUneQ8yw==:ezMkh4PMhCnjJtYkpTaP0SdblP5VAeRe4glW2PgIzICHw3T8ZyGDoaTrCv4/m5wtcEhWdtxhta+j1MQWlK5MIA+hvf8QjIDIjQv696ov5y+pcFe/upd2ekGOei7FCwB2u7I8WnkAtIKTUkf6eDQBZXm26DjfG1Dlc+Mjjq+AerukEa6WpOyqrD7Qub26Pgmj4AsuBx19X1EAmTZacubkoiNagXM8V+IDanHOhLMvfgQ7rw8oZhWfofxi4m+eJqjOXXaqSyorNK8UEcqP6P9pDP8AN8ulXEx6rZy2B5Oi0vSV+wlRLbUuQslga4ItOGxctW/ZX8uWozt+5A3k4URt6A==",SupportedEncryptionAlgorithm.Rsa1_5) -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataStoreName, data); - HybridDataStoreResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStores_CreateOrUpdate_DataSourcePUT162 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_DataStoresCreateOrUpdateDataSourcePUT162() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_CreateOrUpdate_DataSource-PUT-example-162.json - // this example is just showing the usage of "DataStores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreResource - HybridDataStoreCollection collection = hybridDataManager.GetHybridDataStores(); - - // invoke the operation - string dataStoreName = "TestStorSimpleSource1"; - HybridDataStoreData data = new HybridDataStoreData(HybridDataState.Enabled, new ResourceIdentifier("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStoreTypes/StorSimple8000Series")) - { - RepositoryId = new ResourceIdentifier("/subscriptions/c5fc377d-0085-41b9-86b7-cc96dc56d1e9/resourceGroups/ForDMS/providers/Microsoft.StorSimple/managers/BLR8600"), - ExtendedProperties = BinaryData.FromObjectAsJson(new Dictionary() - { - ["extendedSaKey"] = null, - ["resourceId"] = "/subscriptions/c5fc377d-0085-41b9-86b7-cc96dc56d1e9/resourceGroups/ForDMS/providers/Microsoft.StorSimple/managers/BLR8600" - }), - CustomerSecrets = -{ -new HybridDataCustomerSecret("ServiceEncryptionKey","EVuEBV40qv23xDRL4NZBuMms4e3So6ikHjrQYRvG9NloqxdgPOg+ZYzpho5lytI4fmv0ANmRIvDiDboRXcUVSjbB9T2gm19fMIuwZa4FK2+LYEgMqKK1GaLkk7xC8f5IeFUXLo6KyBBpaAiayTnWDcHuYEpMiGrV7trDDcbhMRefO3CHecmH3Z7ye8L0RQ/e7WW8GlCKZj3m0BaG7OrJgjai8gyDfMfGAG5rTqEhDVh2hLQ+TjvUjcOFwHvJusqKTENtbJTNQYmL9wZXsnwBvUwxqrGieILNB7V3GD1Ow9OiV0UCDW1e9LnMueukg+l7YJCU9FUhIPh/nSif6p32zw==:jCfio+pDtY3BSPZDpDJ0L6QdXLYMeOmxaFWtYTOZkNqNTgT8Loc/KSQRjtWS5K4N4btbznuSJ/dzg0aZEzlXgKDSuZgMfd4Ch92ZwAC/BkeCmVrTjiKJsoQXO1IICCUf7GHGBbYnnpsNJcEn4vyc9NXyKwOBjeU+I9AyK7PtYiC03RLpTS6xttFCICteBV0uoBHAiV0chZ5VIIUUMjO9u8EhHqRY7NNcGbWdVJeAb6J3vH4E/DHkQj+DXlpjcLvmK/uqBwxfNju30RJhR04Nmz6zcv/zTcvS0uN5hEPQoHLyv84hjnc4omg/gmNjo2cDW64QxA3RTJ5Sl///4xTBkg==",SupportedEncryptionAlgorithm.Rsa1_5) -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataStoreName, data); - HybridDataStoreResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreResource.cs deleted file mode 100644 index a50a0b62ed3b..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreResource.cs +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; -using Azure.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataStoreResource - { - // DataStores_GetGET161 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataStoresGetGET161() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Get-GET-example-161.json - // this example is just showing the usage of "DataStores_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataStoreResource created on azure - // for more information of creating HybridDataStoreResource, please refer to the document of HybridDataStoreResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataStoreName = "TestStorSimpleSource1"; - ResourceIdentifier hybridDataStoreResourceId = HybridDataStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - HybridDataStoreResource hybridDataStore = client.GetHybridDataStoreResource(hybridDataStoreResourceId); - - // invoke the operation - HybridDataStoreResource result = await hybridDataStore.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStores_GetGET162 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataStoresGetGET162() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Get-GET-example-162.json - // this example is just showing the usage of "DataStores_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataStoreResource created on azure - // for more information of creating HybridDataStoreResource, please refer to the document of HybridDataStoreResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataStoreName = "TestAzureStorage1"; - ResourceIdentifier hybridDataStoreResourceId = HybridDataStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - HybridDataStoreResource hybridDataStore = client.GetHybridDataStoreResource(hybridDataStoreResourceId); - - // invoke the operation - HybridDataStoreResource result = await hybridDataStore.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStores_CreateOrUpdate_DataSinkPUT162 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_DataStoresCreateOrUpdateDataSinkPUT162() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_CreateOrUpdate_DataSink-PUT-example-162.json - // this example is just showing the usage of "DataStores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataStoreResource created on azure - // for more information of creating HybridDataStoreResource, please refer to the document of HybridDataStoreResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataStoreName = "TestAzureStorage1"; - ResourceIdentifier hybridDataStoreResourceId = HybridDataStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - HybridDataStoreResource hybridDataStore = client.GetHybridDataStoreResource(hybridDataStoreResourceId); - - // invoke the operation - HybridDataStoreData data = new HybridDataStoreData(HybridDataState.Enabled, new ResourceIdentifier("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStoreTypes/AzureStorageAccount")) - { - RepositoryId = new ResourceIdentifier("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.Storage/storageAccounts/dmsdatasink"), - ExtendedProperties = BinaryData.FromObjectAsJson(new Dictionary() - { - ["extendedSaKey"] = null, - ["extendedSaName"] = "/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.Storage/storageAccounts/dmsdatasink", - ["storageAccountNameForQueue"] = "/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.Storage/storageAccounts/dmsdatasink" - }), - CustomerSecrets = -{ -new HybridDataCustomerSecret("StorageAccountAccessKey","Of4H9eF03G8QuxvkZQEbFWv3YdN3U//WugzuqReQekbXXQyg+QSicVKrwSOOKVi1zWMYGbKg7d5/ES2gdz+O5ZEw89bvE4mJD/wQmkIsqhPnbN0gyVK6nZePXVUU1A+UzjLfvhSA6KyUQfzNAZ5/TLt6fo1JyQrKTtkvnkLFyfv1AqBZ+dw8JK3RZi/rEN8HD3R3qsBwUYfyEuGLGiujy2CGrr/1uPiUVMR6QuFWRsjm39eMSHa4maLg4tQ0IY/jIy8rMlx3KjF3CcCbPzAqEq5vXy37wkjZbus771te1gLSrzcpVKIMg4DrmgaoJ02jAu+izBjNgLXAFPSUneQ8yw==:ezMkh4PMhCnjJtYkpTaP0SdblP5VAeRe4glW2PgIzICHw3T8ZyGDoaTrCv4/m5wtcEhWdtxhta+j1MQWlK5MIA+hvf8QjIDIjQv696ov5y+pcFe/upd2ekGOei7FCwB2u7I8WnkAtIKTUkf6eDQBZXm26DjfG1Dlc+Mjjq+AerukEa6WpOyqrD7Qub26Pgmj4AsuBx19X1EAmTZacubkoiNagXM8V+IDanHOhLMvfgQ7rw8oZhWfofxi4m+eJqjOXXaqSyorNK8UEcqP6P9pDP8AN8ulXEx6rZy2B5Oi0vSV+wlRLbUuQslga4ItOGxctW/ZX8uWozt+5A3k4URt6A==",SupportedEncryptionAlgorithm.Rsa1_5),new HybridDataCustomerSecret("StorageAccountAccessKeyForQueue","Of4H9eF03G8QuxvkZQEbFWv3YdN3U//WugzuqReQekbXXQyg+QSicVKrwSOOKVi1zWMYGbKg7d5/ES2gdz+O5ZEw89bvE4mJD/wQmkIsqhPnbN0gyVK6nZePXVUU1A+UzjLfvhSA6KyUQfzNAZ5/TLt6fo1JyQrKTtkvnkLFyfv1AqBZ+dw8JK3RZi/rEN8HD3R3qsBwUYfyEuGLGiujy2CGrr/1uPiUVMR6QuFWRsjm39eMSHa4maLg4tQ0IY/jIy8rMlx3KjF3CcCbPzAqEq5vXy37wkjZbus771te1gLSrzcpVKIMg4DrmgaoJ02jAu+izBjNgLXAFPSUneQ8yw==:ezMkh4PMhCnjJtYkpTaP0SdblP5VAeRe4glW2PgIzICHw3T8ZyGDoaTrCv4/m5wtcEhWdtxhta+j1MQWlK5MIA+hvf8QjIDIjQv696ov5y+pcFe/upd2ekGOei7FCwB2u7I8WnkAtIKTUkf6eDQBZXm26DjfG1Dlc+Mjjq+AerukEa6WpOyqrD7Qub26Pgmj4AsuBx19X1EAmTZacubkoiNagXM8V+IDanHOhLMvfgQ7rw8oZhWfofxi4m+eJqjOXXaqSyorNK8UEcqP6P9pDP8AN8ulXEx6rZy2B5Oi0vSV+wlRLbUuQslga4ItOGxctW/ZX8uWozt+5A3k4URt6A==",SupportedEncryptionAlgorithm.Rsa1_5) -}, - }; - ArmOperation lro = await hybridDataStore.UpdateAsync(WaitUntil.Completed, data); - HybridDataStoreResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStores_CreateOrUpdate_DataSourcePUT162 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_DataStoresCreateOrUpdateDataSourcePUT162() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_CreateOrUpdate_DataSource-PUT-example-162.json - // this example is just showing the usage of "DataStores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataStoreResource created on azure - // for more information of creating HybridDataStoreResource, please refer to the document of HybridDataStoreResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataStoreName = "TestStorSimpleSource1"; - ResourceIdentifier hybridDataStoreResourceId = HybridDataStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - HybridDataStoreResource hybridDataStore = client.GetHybridDataStoreResource(hybridDataStoreResourceId); - - // invoke the operation - HybridDataStoreData data = new HybridDataStoreData(HybridDataState.Enabled, new ResourceIdentifier("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStoreTypes/StorSimple8000Series")) - { - RepositoryId = new ResourceIdentifier("/subscriptions/c5fc377d-0085-41b9-86b7-cc96dc56d1e9/resourceGroups/ForDMS/providers/Microsoft.StorSimple/managers/BLR8600"), - ExtendedProperties = BinaryData.FromObjectAsJson(new Dictionary() - { - ["extendedSaKey"] = null, - ["resourceId"] = "/subscriptions/c5fc377d-0085-41b9-86b7-cc96dc56d1e9/resourceGroups/ForDMS/providers/Microsoft.StorSimple/managers/BLR8600" - }), - CustomerSecrets = -{ -new HybridDataCustomerSecret("ServiceEncryptionKey","EVuEBV40qv23xDRL4NZBuMms4e3So6ikHjrQYRvG9NloqxdgPOg+ZYzpho5lytI4fmv0ANmRIvDiDboRXcUVSjbB9T2gm19fMIuwZa4FK2+LYEgMqKK1GaLkk7xC8f5IeFUXLo6KyBBpaAiayTnWDcHuYEpMiGrV7trDDcbhMRefO3CHecmH3Z7ye8L0RQ/e7WW8GlCKZj3m0BaG7OrJgjai8gyDfMfGAG5rTqEhDVh2hLQ+TjvUjcOFwHvJusqKTENtbJTNQYmL9wZXsnwBvUwxqrGieILNB7V3GD1Ow9OiV0UCDW1e9LnMueukg+l7YJCU9FUhIPh/nSif6p32zw==:jCfio+pDtY3BSPZDpDJ0L6QdXLYMeOmxaFWtYTOZkNqNTgT8Loc/KSQRjtWS5K4N4btbznuSJ/dzg0aZEzlXgKDSuZgMfd4Ch92ZwAC/BkeCmVrTjiKJsoQXO1IICCUf7GHGBbYnnpsNJcEn4vyc9NXyKwOBjeU+I9AyK7PtYiC03RLpTS6xttFCICteBV0uoBHAiV0chZ5VIIUUMjO9u8EhHqRY7NNcGbWdVJeAb6J3vH4E/DHkQj+DXlpjcLvmK/uqBwxfNju30RJhR04Nmz6zcv/zTcvS0uN5hEPQoHLyv84hjnc4omg/gmNjo2cDW64QxA3RTJ5Sl///4xTBkg==",SupportedEncryptionAlgorithm.Rsa1_5) -}, - }; - ArmOperation lro = await hybridDataStore.UpdateAsync(WaitUntil.Completed, data); - HybridDataStoreResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStores_Delete_DataSinkDELETE161 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DataStoresDeleteDataSinkDELETE161() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Delete_DataSink-DELETE-example-161.json - // this example is just showing the usage of "DataStores_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataStoreResource created on azure - // for more information of creating HybridDataStoreResource, please refer to the document of HybridDataStoreResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataStoreName = "TestAzureStorage1"; - ResourceIdentifier hybridDataStoreResourceId = HybridDataStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - HybridDataStoreResource hybridDataStore = client.GetHybridDataStoreResource(hybridDataStoreResourceId); - - // invoke the operation - await hybridDataStore.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // DataStores_Delete_DataSourceDELETE161 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DataStoresDeleteDataSourceDELETE161() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Delete_DataSource-DELETE-example-161.json - // this example is just showing the usage of "DataStores_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataStoreResource created on azure - // for more information of creating HybridDataStoreResource, please refer to the document of HybridDataStoreResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataStoreName = "TestStorSimpleSource1"; - ResourceIdentifier hybridDataStoreResourceId = HybridDataStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - HybridDataStoreResource hybridDataStore = client.GetHybridDataStoreResource(hybridDataStoreResourceId); - - // invoke the operation - await hybridDataStore.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreTypeCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreTypeCollection.cs deleted file mode 100644 index 2092b61f599e..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreTypeCollection.cs +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataStoreTypeCollection - { - // DataStoreTypes_ListByDataManagerGET171 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_DataStoreTypesListByDataManagerGET171() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStoreTypes_ListByDataManager-GET-example-171.json - // this example is just showing the usage of "DataStoreTypes_ListByDataManager" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreTypeResource - HybridDataStoreTypeCollection collection = hybridDataManager.GetHybridDataStoreTypes(); - - // invoke the operation and iterate over the result - await foreach (HybridDataStoreTypeResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreTypeData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // DataStoreTypes_GetGET182 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataStoreTypesGetGET182() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStoreTypes_Get-GET-example-182.json - // this example is just showing the usage of "DataStoreTypes_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreTypeResource - HybridDataStoreTypeCollection collection = hybridDataManager.GetHybridDataStoreTypes(); - - // invoke the operation - string dataStoreTypeName = "StorSimple8000Series"; - HybridDataStoreTypeResource result = await collection.GetAsync(dataStoreTypeName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreTypeData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStoreTypes_GetGET182 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_DataStoreTypesGetGET182() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStoreTypes_Get-GET-example-182.json - // this example is just showing the usage of "DataStoreTypes_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreTypeResource - HybridDataStoreTypeCollection collection = hybridDataManager.GetHybridDataStoreTypes(); - - // invoke the operation - string dataStoreTypeName = "StorSimple8000Series"; - bool result = await collection.ExistsAsync(dataStoreTypeName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // DataStoreTypes_GetGET183 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataStoreTypesGetGET183() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStoreTypes_Get-GET-example-183.json - // this example is just showing the usage of "DataStoreTypes_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreTypeResource - HybridDataStoreTypeCollection collection = hybridDataManager.GetHybridDataStoreTypes(); - - // invoke the operation - string dataStoreTypeName = "AzureStorageAccount"; - HybridDataStoreTypeResource result = await collection.GetAsync(dataStoreTypeName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreTypeData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStoreTypes_GetGET183 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_DataStoreTypesGetGET183() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStoreTypes_Get-GET-example-183.json - // this example is just showing the usage of "DataStoreTypes_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataManagerResource created on azure - // for more information of creating HybridDataManagerResource, please refer to the document of HybridDataManagerResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - ResourceIdentifier hybridDataManagerResourceId = HybridDataManagerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName); - HybridDataManagerResource hybridDataManager = client.GetHybridDataManagerResource(hybridDataManagerResourceId); - - // get the collection of this HybridDataStoreTypeResource - HybridDataStoreTypeCollection collection = hybridDataManager.GetHybridDataStoreTypes(); - - // invoke the operation - string dataStoreTypeName = "AzureStorageAccount"; - bool result = await collection.ExistsAsync(dataStoreTypeName); - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreTypeResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreTypeResource.cs deleted file mode 100644 index e95592f52d46..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/Generated/Samples/Sample_HybridDataStoreTypeResource.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Samples -{ - public partial class Sample_HybridDataStoreTypeResource - { - // DataStoreTypes_GetGET182 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataStoreTypesGetGET182() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStoreTypes_Get-GET-example-182.json - // this example is just showing the usage of "DataStoreTypes_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataStoreTypeResource created on azure - // for more information of creating HybridDataStoreTypeResource, please refer to the document of HybridDataStoreTypeResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataStoreTypeName = "StorSimple8000Series"; - ResourceIdentifier hybridDataStoreTypeResourceId = HybridDataStoreTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataStoreTypeName); - HybridDataStoreTypeResource hybridDataStoreType = client.GetHybridDataStoreTypeResource(hybridDataStoreTypeResourceId); - - // invoke the operation - HybridDataStoreTypeResource result = await hybridDataStoreType.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreTypeData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // DataStoreTypes_GetGET183 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_DataStoreTypesGetGET183() - { - // Generated from example definition: specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStoreTypes_Get-GET-example-183.json - // this example is just showing the usage of "DataStoreTypes_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridDataStoreTypeResource created on azure - // for more information of creating HybridDataStoreTypeResource, please refer to the document of HybridDataStoreTypeResource - string subscriptionId = "6e0219f5-327a-4365-904f-05eed4227ad7"; - string resourceGroupName = "ResourceGroupForSDKTest"; - string dataManagerName = "TestAzureSDKOperations"; - string dataStoreTypeName = "AzureStorageAccount"; - ResourceIdentifier hybridDataStoreTypeResourceId = HybridDataStoreTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, dataManagerName, dataStoreTypeName); - HybridDataStoreTypeResource hybridDataStoreType = client.GetHybridDataStoreTypeResource(hybridDataStoreTypeResourceId); - - // invoke the operation - HybridDataStoreTypeResource result = await hybridDataStoreType.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridDataStoreTypeData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/autorest.tests.md b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/autorest.tests.md deleted file mode 100644 index 6f47dbfd181f..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/samples/autorest.tests.md +++ /dev/null @@ -1,13 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateTests` to generate code. - -# Azure.ResourceManager.HybridData.Tests - -> see https://aka.ms/autorest -``` yaml -require: ../src/autorest.md -include-x-ms-examples-original-file: true -testgen: - sample: true -``` \ No newline at end of file diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Azure.ResourceManager.HybridData.csproj b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Azure.ResourceManager.HybridData.csproj deleted file mode 100644 index bf48fb070cd3..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Azure.ResourceManager.HybridData.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - 1.1.0-beta.2 - - 1.0.1 - Azure.ResourceManager.HybridData - Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.HybridData. - azure;management;arm;resource manager;hybriddata - - diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Customized/Models/SupportedEncryptionAlgorithm.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Customized/Models/SupportedEncryptionAlgorithm.cs deleted file mode 100644 index 4e784b125491..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Customized/Models/SupportedEncryptionAlgorithm.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// The encryption algorithm used to encrypt data. - public enum SupportedEncryptionAlgorithm - { - /// None. - None, -#pragma warning disable CA1707 - /// RSA1_5. - [CodeGenMember("RSA15")] - Rsa1_5, - /// RSA_OAEP. - [CodeGenMember("RsaOaep")] - Rsa_Oaep, -#pragma warning restore CA1707 - /// PlainText. - PlainText - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/ArmHybridDataModelFactory.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/ArmHybridDataModelFactory.cs deleted file mode 100644 index 71ecd9cbea9c..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/ArmHybridDataModelFactory.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure; -using Azure.Core; -using Azure.ResourceManager.HybridData; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Model factory for models. - public static partial class ArmHybridDataModelFactory - { - /// Initializes a new instance of HybridDataManagerData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Etag of the Resource. - /// The sku type. - /// A new instance for mocking. - public static HybridDataManagerData HybridDataManagerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, HybridDataSku sku = null) - { - tags ??= new Dictionary(); - - return new HybridDataManagerData(id, name, resourceType, systemData, tags, location, etag, sku); - } - - /// Initializes a new instance of HybridDataServiceData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// State of the data service. - /// Supported data store types which can be used as a sink. - /// Supported data store types which can be used as a source. - /// A new instance for mocking. - public static HybridDataServiceData HybridDataServiceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, HybridDataState state = default, IEnumerable supportedDataSinkTypes = null, IEnumerable supportedDataSourceTypes = null) - { - supportedDataSinkTypes ??= new List(); - supportedDataSourceTypes ??= new List(); - - return new HybridDataServiceData(id, name, resourceType, systemData, state, supportedDataSinkTypes?.ToList(), supportedDataSourceTypes?.ToList()); - } - - /// Initializes a new instance of HybridDataJobDefinitionData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Data Source Id associated to the job definition. - /// Data Sink Id associated to the job definition. - /// Schedule for running the job definition. - /// State of the job definition. - /// Last modified time of the job definition. - /// This is the preferred geo location for the job to run. - /// Enum to detect if user confirmation is required. If not passed will default to NotRequired. - /// A generic json used differently by each data service type. - /// List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. - /// A new instance for mocking. - public static HybridDataJobDefinitionData HybridDataJobDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string dataSourceId = null, string dataSinkId = null, IEnumerable schedules = null, HybridDataState state = default, DateTimeOffset? lastModifiedOn = null, HybridDataJobRunLocation? runLocation = null, UserConfirmationSetting? userConfirmation = null, BinaryData dataServiceInput = null, IEnumerable customerSecrets = null) - { - schedules ??= new List(); - customerSecrets ??= new List(); - - return new HybridDataJobDefinitionData(id, name, resourceType, systemData, dataSourceId, dataSinkId, schedules?.ToList(), state, lastModifiedOn, runLocation, userConfirmation, dataServiceInput, customerSecrets?.ToList()); - } - - /// Initializes a new instance of HybridDataJobData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Status of the job. - /// Time at which the job was started in UTC ISO 8601 format. - /// Time at which the job ended in UTC ISO 8601 format. - /// Top level error for the job. - /// Describes whether the job is cancellable. - /// Number of bytes processed by the job as of now. - /// Number of items processed by the job as of now. - /// Number of bytes to be processed by the job in total. - /// Number of items to be processed by the job in total. - /// Details of a job run. This field will only be sent for expand details filter. - /// Name of the data source on which the job was triggered. - /// Name of the data sink on which the job was triggered. - /// A new instance for mocking. - public static HybridDataJobData HybridDataJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, HybridDataJobStatus status = default, DateTimeOffset startOn = default, DateTimeOffset? endOn = null, HybridDataJobTopLevelError error = null, JobCancellationSetting isCancellable = default, long? bytesProcessed = null, long? itemsProcessed = null, long? totalBytesToProcess = null, long? totalItemsToProcess = null, HybridDataJobDetails details = null, string dataSourceName = null, string dataSinkName = null) - { - return new HybridDataJobData(id, name, resourceType, systemData, status, startOn, endOn, error, isCancellable, bytesProcessed, itemsProcessed, totalBytesToProcess, totalItemsToProcess, details, dataSourceName, dataSinkName); - } - - /// Initializes a new instance of HybridDataStoreData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Arm Id for the manager resource to which the data source is associated. This is optional. - /// State of the data source. - /// A generic json used differently by each data source type. - /// The arm id of the data store type. - /// List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. - /// A new instance for mocking. - public static HybridDataStoreData HybridDataStoreData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier repositoryId = null, HybridDataState state = default, BinaryData extendedProperties = null, ResourceIdentifier dataStoreTypeId = null, IEnumerable customerSecrets = null) - { - customerSecrets ??= new List(); - - return new HybridDataStoreData(id, name, resourceType, systemData, repositoryId, state, extendedProperties, dataStoreTypeId, customerSecrets?.ToList()); - } - - /// Initializes a new instance of HybridDataStoreTypeData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Arm type for the manager resource to which the data source type is associated. This is optional. - /// State of the data store type. - /// Supported data services where it can be used as a sink. - /// Supported data services where it can be used as a source. - /// A new instance for mocking. - public static HybridDataStoreTypeData HybridDataStoreTypeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceType? repositoryType = null, HybridDataState state = default, IEnumerable supportedDataServicesAsSink = null, IEnumerable supportedDataServicesAsSource = null) - { - supportedDataServicesAsSink ??= new List(); - supportedDataServicesAsSource ??= new List(); - - return new HybridDataStoreTypeData(id, name, resourceType, systemData, repositoryType, state, supportedDataServicesAsSink?.ToList(), supportedDataServicesAsSource?.ToList()); - } - - /// Initializes a new instance of HybridDataPublicKeyData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Level one public key for encryption. - /// Level two public key for encryption. - /// A new instance for mocking. - public static HybridDataPublicKeyData HybridDataPublicKeyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, HybridDataEncryptionKey dataServiceLevel1Key = null, HybridDataEncryptionKey dataServiceLevel2Key = null) - { - return new HybridDataPublicKeyData(id, name, resourceType, systemData, dataServiceLevel1Key, dataServiceLevel2Key); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Extensions/HybridDataExtensions.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Extensions/HybridDataExtensions.cs deleted file mode 100644 index 985f757def8b..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Extensions/HybridDataExtensions.cs +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridData -{ - /// A class to add extension methods to Azure.ResourceManager.HybridData. - public static partial class HybridDataExtensions - { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); - } - - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region HybridDataManagerResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridDataManagerResource GetHybridDataManagerResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridDataManagerResource.ValidateResourceId(id); - return new HybridDataManagerResource(client, id); - } - ); - } - #endregion - - #region HybridDataServiceResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridDataServiceResource GetHybridDataServiceResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridDataServiceResource.ValidateResourceId(id); - return new HybridDataServiceResource(client, id); - } - ); - } - #endregion - - #region HybridDataJobDefinitionResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridDataJobDefinitionResource GetHybridDataJobDefinitionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridDataJobDefinitionResource.ValidateResourceId(id); - return new HybridDataJobDefinitionResource(client, id); - } - ); - } - #endregion - - #region HybridDataJobResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridDataJobResource GetHybridDataJobResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridDataJobResource.ValidateResourceId(id); - return new HybridDataJobResource(client, id); - } - ); - } - #endregion - - #region HybridDataStoreResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridDataStoreResource GetHybridDataStoreResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridDataStoreResource.ValidateResourceId(id); - return new HybridDataStoreResource(client, id); - } - ); - } - #endregion - - #region HybridDataStoreTypeResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridDataStoreTypeResource GetHybridDataStoreTypeResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridDataStoreTypeResource.ValidateResourceId(id); - return new HybridDataStoreTypeResource(client, id); - } - ); - } - #endregion - - #region HybridDataPublicKeyResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridDataPublicKeyResource GetHybridDataPublicKeyResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridDataPublicKeyResource.ValidateResourceId(id); - return new HybridDataPublicKeyResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of HybridDataManagerResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// An object representing collection of HybridDataManagerResources and their operations over a HybridDataManagerResource. - public static HybridDataManagerCollection GetHybridDataManagers(this ResourceGroupResource resourceGroupResource) - { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHybridDataManagers(); - } - - /// - /// Gets information about the specified data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The instance the method will execute against. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetHybridDataManagerAsync(this ResourceGroupResource resourceGroupResource, string dataManagerName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetHybridDataManagers().GetAsync(dataManagerName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets information about the specified data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The instance the method will execute against. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetHybridDataManager(this ResourceGroupResource resourceGroupResource, string dataManagerName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetHybridDataManagers().Get(dataManagerName, cancellationToken); - } - - /// - /// Lists all the data manager resources available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridData/dataManagers - /// - /// - /// Operation Id - /// DataManagers_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetHybridDataManagersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHybridDataManagersAsync(cancellationToken); - } - - /// - /// Lists all the data manager resources available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridData/dataManagers - /// - /// - /// Operation Id - /// DataManagers_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetHybridDataManagers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHybridDataManagers(cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index b67ff921541f..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of HybridDataManagerResources in the ResourceGroupResource. - /// An object representing collection of HybridDataManagerResources and their operations over a HybridDataManagerResource. - public virtual HybridDataManagerCollection GetHybridDataManagers() - { - return GetCachedClient(Client => new HybridDataManagerCollection(Client, Id)); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs deleted file mode 100644 index 925c48e7f54e..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource - { - private ClientDiagnostics _hybridDataManagerDataManagersClientDiagnostics; - private DataManagersRestOperations _hybridDataManagerDataManagersRestClient; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics HybridDataManagerDataManagersClientDiagnostics => _hybridDataManagerDataManagersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataManagerResource.ResourceType.Namespace, Diagnostics); - private DataManagersRestOperations HybridDataManagerDataManagersRestClient => _hybridDataManagerDataManagersRestClient ??= new DataManagersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HybridDataManagerResource.ResourceType)); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// - /// Lists all the data manager resources available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridData/dataManagers - /// - /// - /// Operation Id - /// DataManagers_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetHybridDataManagersAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => HybridDataManagerDataManagersRestClient.CreateListRequest(Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new HybridDataManagerResource(Client, HybridDataManagerData.DeserializeHybridDataManagerData(e)), HybridDataManagerDataManagersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHybridDataManagers", "value", null, cancellationToken); - } - - /// - /// Lists all the data manager resources available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridData/dataManagers - /// - /// - /// Operation Id - /// DataManagers_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetHybridDataManagers(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => HybridDataManagerDataManagersRestClient.CreateListRequest(Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new HybridDataManagerResource(Client, HybridDataManagerData.DeserializeHybridDataManagerData(e)), HybridDataManagerDataManagersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHybridDataManagers", "value", null, cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobCollection.cs deleted file mode 100644 index e621c3b31036..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobCollection.cs +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetHybridDataJobs method from an instance of . - /// - public partial class HybridDataJobCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _hybridDataJobJobsClientDiagnostics; - private readonly JobsRestOperations _hybridDataJobJobsRestClient; - - /// Initializes a new instance of the class for mocking. - protected HybridDataJobCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal HybridDataJobCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataJobJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataJobResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataJobResource.ResourceType, out string hybridDataJobJobsApiVersion); - _hybridDataJobJobsRestClient = new JobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataJobJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != HybridDataJobDefinitionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HybridDataJobDefinitionResource.ResourceType), nameof(id)); - } - - /// - /// This method gets a data manager job given the jobId. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId} - /// - /// - /// Operation Id - /// Jobs_Get - /// - /// - /// - /// The job id of the job queried. - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string jobId, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobCollection.Get"); - scope.Start(); - try - { - var response = await _hybridDataJobJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, expand, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets a data manager job given the jobId. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId} - /// - /// - /// Operation Id - /// Jobs_Get - /// - /// - /// - /// The job id of the job queried. - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string jobId, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobCollection.Get"); - scope.Start(); - try - { - var response = _hybridDataJobJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, expand, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets all the jobs of a given job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs - /// - /// - /// Operation Id - /// Jobs_ListByJobDefinition - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobJobsRestClient.CreateListByJobDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobJobsRestClient.CreateListByJobDefinitionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobResource(Client, HybridDataJobData.DeserializeHybridDataJobData(e)), _hybridDataJobJobsClientDiagnostics, Pipeline, "HybridDataJobCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// This method gets all the jobs of a given job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs - /// - /// - /// Operation Id - /// Jobs_ListByJobDefinition - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobJobsRestClient.CreateListByJobDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobJobsRestClient.CreateListByJobDefinitionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobResource(Client, HybridDataJobData.DeserializeHybridDataJobData(e)), _hybridDataJobJobsClientDiagnostics, Pipeline, "HybridDataJobCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId} - /// - /// - /// Operation Id - /// Jobs_Get - /// - /// - /// - /// The job id of the job queried. - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string jobId, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobCollection.Exists"); - scope.Start(); - try - { - var response = await _hybridDataJobJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, expand, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId} - /// - /// - /// Operation Id - /// Jobs_Get - /// - /// - /// - /// The job id of the job queried. - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string jobId, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobCollection.Exists"); - scope.Start(); - try - { - var response = _hybridDataJobJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, expand, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobData.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobData.cs deleted file mode 100644 index 6da8da0d0e2f..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobData.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing the HybridDataJob data model. - /// Data service job. - /// - public partial class HybridDataJobData : ResourceData - { - /// Initializes a new instance of HybridDataJobData. - /// Status of the job. - /// Time at which the job was started in UTC ISO 8601 format. - /// Describes whether the job is cancellable. - public HybridDataJobData(HybridDataJobStatus status, DateTimeOffset startOn, JobCancellationSetting isCancellable) - { - Status = status; - StartOn = startOn; - IsCancellable = isCancellable; - } - - /// Initializes a new instance of HybridDataJobData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Status of the job. - /// Time at which the job was started in UTC ISO 8601 format. - /// Time at which the job ended in UTC ISO 8601 format. - /// Top level error for the job. - /// Describes whether the job is cancellable. - /// Number of bytes processed by the job as of now. - /// Number of items processed by the job as of now. - /// Number of bytes to be processed by the job in total. - /// Number of items to be processed by the job in total. - /// Details of a job run. This field will only be sent for expand details filter. - /// Name of the data source on which the job was triggered. - /// Name of the data sink on which the job was triggered. - internal HybridDataJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HybridDataJobStatus status, DateTimeOffset startOn, DateTimeOffset? endOn, HybridDataJobTopLevelError error, JobCancellationSetting isCancellable, long? bytesProcessed, long? itemsProcessed, long? totalBytesToProcess, long? totalItemsToProcess, HybridDataJobDetails details, string dataSourceName, string dataSinkName) : base(id, name, resourceType, systemData) - { - Status = status; - StartOn = startOn; - EndOn = endOn; - Error = error; - IsCancellable = isCancellable; - BytesProcessed = bytesProcessed; - ItemsProcessed = itemsProcessed; - TotalBytesToProcess = totalBytesToProcess; - TotalItemsToProcess = totalItemsToProcess; - Details = details; - DataSourceName = dataSourceName; - DataSinkName = dataSinkName; - } - - /// Status of the job. - public HybridDataJobStatus Status { get; set; } - /// Time at which the job was started in UTC ISO 8601 format. - public DateTimeOffset StartOn { get; set; } - /// Time at which the job ended in UTC ISO 8601 format. - public DateTimeOffset? EndOn { get; set; } - /// Top level error for the job. - public HybridDataJobTopLevelError Error { get; set; } - /// Describes whether the job is cancellable. - public JobCancellationSetting IsCancellable { get; set; } - /// Number of bytes processed by the job as of now. - public long? BytesProcessed { get; set; } - /// Number of items processed by the job as of now. - public long? ItemsProcessed { get; set; } - /// Number of bytes to be processed by the job in total. - public long? TotalBytesToProcess { get; set; } - /// Number of items to be processed by the job in total. - public long? TotalItemsToProcess { get; set; } - /// Details of a job run. This field will only be sent for expand details filter. - public HybridDataJobDetails Details { get; set; } - /// Name of the data source on which the job was triggered. - public string DataSourceName { get; set; } - /// Name of the data sink on which the job was triggered. - public string DataSinkName { get; set; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobDefinitionCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobDefinitionCollection.cs deleted file mode 100644 index 39e59f8db874..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobDefinitionCollection.cs +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetHybridDataJobDefinitions method from an instance of . - /// - public partial class HybridDataJobDefinitionCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _hybridDataJobDefinitionJobDefinitionsClientDiagnostics; - private readonly JobDefinitionsRestOperations _hybridDataJobDefinitionJobDefinitionsRestClient; - - /// Initializes a new instance of the class for mocking. - protected HybridDataJobDefinitionCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal HybridDataJobDefinitionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataJobDefinitionJobDefinitionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataJobDefinitionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataJobDefinitionResource.ResourceType, out string hybridDataJobDefinitionJobDefinitionsApiVersion); - _hybridDataJobDefinitionJobDefinitionsRestClient = new JobDefinitionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataJobDefinitionJobDefinitionsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != HybridDataServiceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HybridDataServiceResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The job definition name to be created or updated. - /// Job Definition object to be created or updated. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string jobDefinitionName, HybridDataJobDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _hybridDataJobDefinitionJobDefinitionsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, jobDefinitionName, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(new HybridDataJobDefinitionOperationSource(Client), _hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, _hybridDataJobDefinitionJobDefinitionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, jobDefinitionName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The job definition name to be created or updated. - /// Job Definition object to be created or updated. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string jobDefinitionName, HybridDataJobDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _hybridDataJobDefinitionJobDefinitionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, jobDefinitionName, data, cancellationToken); - var operation = new HybridDataArmOperation(new HybridDataJobDefinitionOperationSource(Client), _hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, _hybridDataJobDefinitionJobDefinitionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, jobDefinitionName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets job definition object by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Get - /// - /// - /// - /// The job definition name that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string jobDefinitionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionCollection.Get"); - scope.Start(); - try - { - var response = await _hybridDataJobDefinitionJobDefinitionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, jobDefinitionName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataJobDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets job definition object by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Get - /// - /// - /// - /// The job definition name that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string jobDefinitionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionCollection.Get"); - scope.Start(); - try - { - var response = _hybridDataJobDefinitionJobDefinitionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, jobDefinitionName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataJobDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets all the job definitions of the given data service name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions - /// - /// - /// Operation Id - /// JobDefinitions_ListByDataService - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobDefinitionJobDefinitionsRestClient.CreateListByDataServiceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobDefinitionJobDefinitionsRestClient.CreateListByDataServiceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobDefinitionResource(Client, HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(e)), _hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, "HybridDataJobDefinitionCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// This method gets all the job definitions of the given data service name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions - /// - /// - /// Operation Id - /// JobDefinitions_ListByDataService - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobDefinitionJobDefinitionsRestClient.CreateListByDataServiceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobDefinitionJobDefinitionsRestClient.CreateListByDataServiceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobDefinitionResource(Client, HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(e)), _hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, "HybridDataJobDefinitionCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Get - /// - /// - /// - /// The job definition name that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string jobDefinitionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionCollection.Exists"); - scope.Start(); - try - { - var response = await _hybridDataJobDefinitionJobDefinitionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, jobDefinitionName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Get - /// - /// - /// - /// The job definition name that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string jobDefinitionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionCollection.Exists"); - scope.Start(); - try - { - var response = _hybridDataJobDefinitionJobDefinitionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, jobDefinitionName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobDefinitionData.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobDefinitionData.cs deleted file mode 100644 index afe740eda2bb..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobDefinitionData.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing the HybridDataJobDefinition data model. - /// Job Definition. - /// - public partial class HybridDataJobDefinitionData : ResourceData - { - /// Initializes a new instance of HybridDataJobDefinitionData. - /// Data Source Id associated to the job definition. - /// Data Sink Id associated to the job definition. - /// State of the job definition. - /// or is null. - public HybridDataJobDefinitionData(string dataSourceId, string dataSinkId, HybridDataState state) - { - Argument.AssertNotNull(dataSourceId, nameof(dataSourceId)); - Argument.AssertNotNull(dataSinkId, nameof(dataSinkId)); - - DataSourceId = dataSourceId; - DataSinkId = dataSinkId; - Schedules = new ChangeTrackingList(); - State = state; - CustomerSecrets = new ChangeTrackingList(); - } - - /// Initializes a new instance of HybridDataJobDefinitionData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Data Source Id associated to the job definition. - /// Data Sink Id associated to the job definition. - /// Schedule for running the job definition. - /// State of the job definition. - /// Last modified time of the job definition. - /// This is the preferred geo location for the job to run. - /// Enum to detect if user confirmation is required. If not passed will default to NotRequired. - /// A generic json used differently by each data service type. - /// List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. - internal HybridDataJobDefinitionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string dataSourceId, string dataSinkId, IList schedules, HybridDataState state, DateTimeOffset? lastModifiedOn, HybridDataJobRunLocation? runLocation, UserConfirmationSetting? userConfirmation, BinaryData dataServiceInput, IList customerSecrets) : base(id, name, resourceType, systemData) - { - DataSourceId = dataSourceId; - DataSinkId = dataSinkId; - Schedules = schedules; - State = state; - LastModifiedOn = lastModifiedOn; - RunLocation = runLocation; - UserConfirmation = userConfirmation; - DataServiceInput = dataServiceInput; - CustomerSecrets = customerSecrets; - } - - /// Data Source Id associated to the job definition. - public string DataSourceId { get; set; } - /// Data Sink Id associated to the job definition. - public string DataSinkId { get; set; } - /// Schedule for running the job definition. - public IList Schedules { get; } - /// State of the job definition. - public HybridDataState State { get; set; } - /// Last modified time of the job definition. - public DateTimeOffset? LastModifiedOn { get; set; } - /// This is the preferred geo location for the job to run. - public HybridDataJobRunLocation? RunLocation { get; set; } - /// Enum to detect if user confirmation is required. If not passed will default to NotRequired. - public UserConfirmationSetting? UserConfirmation { get; set; } - /// - /// A generic json used differently by each data service type. - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData DataServiceInput { get; set; } - /// List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. - public IList CustomerSecrets { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobDefinitionResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobDefinitionResource.cs deleted file mode 100644 index a5b78db5721d..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobDefinitionResource.cs +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A Class representing a HybridDataJobDefinition along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetHybridDataJobDefinitionResource method. - /// Otherwise you can get one from its parent resource using the GetHybridDataJobDefinition method. - /// - public partial class HybridDataJobDefinitionResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _hybridDataJobDefinitionJobDefinitionsClientDiagnostics; - private readonly JobDefinitionsRestOperations _hybridDataJobDefinitionJobDefinitionsRestClient; - private readonly HybridDataJobDefinitionData _data; - - /// Initializes a new instance of the class for mocking. - protected HybridDataJobDefinitionResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal HybridDataJobDefinitionResource(ArmClient client, HybridDataJobDefinitionData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal HybridDataJobDefinitionResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataJobDefinitionJobDefinitionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string hybridDataJobDefinitionJobDefinitionsApiVersion); - _hybridDataJobDefinitionJobDefinitionsRestClient = new JobDefinitionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataJobDefinitionJobDefinitionsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.HybridData/dataManagers/dataServices/jobDefinitions"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual HybridDataJobDefinitionData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of HybridDataJobResources in the HybridDataJobDefinition. - /// An object representing collection of HybridDataJobResources and their operations over a HybridDataJobResource. - public virtual HybridDataJobCollection GetHybridDataJobs() - { - return GetCachedClient(Client => new HybridDataJobCollection(Client, Id)); - } - - /// - /// This method gets a data manager job given the jobId. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId} - /// - /// - /// Operation Id - /// Jobs_Get - /// - /// - /// - /// The job id of the job queried. - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetHybridDataJobAsync(string jobId, string expand = null, CancellationToken cancellationToken = default) - { - return await GetHybridDataJobs().GetAsync(jobId, expand, cancellationToken).ConfigureAwait(false); - } - - /// - /// This method gets a data manager job given the jobId. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId} - /// - /// - /// Operation Id - /// Jobs_Get - /// - /// - /// - /// The job id of the job queried. - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetHybridDataJob(string jobId, string expand = null, CancellationToken cancellationToken = default) - { - return GetHybridDataJobs().Get(jobId, expand, cancellationToken); - } - - /// - /// This method gets job definition object by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionResource.Get"); - scope.Start(); - try - { - var response = await _hybridDataJobDefinitionJobDefinitionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataJobDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets job definition object by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionResource.Get"); - scope.Start(); - try - { - var response = _hybridDataJobDefinitionJobDefinitionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataJobDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method deletes the given job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionResource.Delete"); - scope.Start(); - try - { - var response = await _hybridDataJobDefinitionJobDefinitionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(_hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, _hybridDataJobDefinitionJobDefinitionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method deletes the given job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionResource.Delete"); - scope.Start(); - try - { - var response = _hybridDataJobDefinitionJobDefinitionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new HybridDataArmOperation(_hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, _hybridDataJobDefinitionJobDefinitionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Job Definition object to be created or updated. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, HybridDataJobDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionResource.Update"); - scope.Start(); - try - { - var response = await _hybridDataJobDefinitionJobDefinitionsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(new HybridDataJobDefinitionOperationSource(Client), _hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, _hybridDataJobDefinitionJobDefinitionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Job Definition object to be created or updated. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, HybridDataJobDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionResource.Update"); - scope.Start(); - try - { - var response = _hybridDataJobDefinitionJobDefinitionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new HybridDataArmOperation(new HybridDataJobDefinitionOperationSource(Client), _hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, _hybridDataJobDefinitionJobDefinitionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method runs a job instance of the given job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/run - /// - /// - /// Operation Id - /// JobDefinitions_Run - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Run time parameters for the job definition. - /// The cancellation token to use. - /// is null. - public virtual async Task RunAsync(WaitUntil waitUntil, HybridDataJobRunContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionResource.Run"); - scope.Start(); - try - { - var response = await _hybridDataJobDefinitionJobDefinitionsRestClient.RunAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(_hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, _hybridDataJobDefinitionJobDefinitionsRestClient.CreateRunRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method runs a job instance of the given job definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/run - /// - /// - /// Operation Id - /// JobDefinitions_Run - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Run time parameters for the job definition. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Run(WaitUntil waitUntil, HybridDataJobRunContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _hybridDataJobDefinitionJobDefinitionsClientDiagnostics.CreateScope("HybridDataJobDefinitionResource.Run"); - scope.Start(); - try - { - var response = _hybridDataJobDefinitionJobDefinitionsRestClient.Run(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new HybridDataArmOperation(_hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, _hybridDataJobDefinitionJobDefinitionsRestClient.CreateRunRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobResource.cs deleted file mode 100644 index e28f99646344..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataJobResource.cs +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A Class representing a HybridDataJob along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetHybridDataJobResource method. - /// Otherwise you can get one from its parent resource using the GetHybridDataJob method. - /// - public partial class HybridDataJobResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _hybridDataJobJobsClientDiagnostics; - private readonly JobsRestOperations _hybridDataJobJobsRestClient; - private readonly HybridDataJobData _data; - - /// Initializes a new instance of the class for mocking. - protected HybridDataJobResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal HybridDataJobResource(ArmClient client, HybridDataJobData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal HybridDataJobResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataJobJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string hybridDataJobJobsApiVersion); - _hybridDataJobJobsRestClient = new JobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataJobJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.HybridData/dataManagers/dataServices/jobDefinitions/jobs"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual HybridDataJobData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// This method gets a data manager job given the jobId. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId} - /// - /// - /// Operation Id - /// Jobs_Get - /// - /// - /// - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - public virtual async Task> GetAsync(string expand = null, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobResource.Get"); - scope.Start(); - try - { - var response = await _hybridDataJobJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, expand, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets a data manager job given the jobId. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId} - /// - /// - /// Operation Id - /// Jobs_Get - /// - /// - /// - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - public virtual Response Get(string expand = null, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobResource.Get"); - scope.Start(); - try - { - var response = _hybridDataJobJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, expand, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cancels the given job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/cancel - /// - /// - /// Operation Id - /// Jobs_Cancel - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task CancelAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobResource.Cancel"); - scope.Start(); - try - { - var response = await _hybridDataJobJobsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(_hybridDataJobJobsClientDiagnostics, Pipeline, _hybridDataJobJobsRestClient.CreateCancelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cancels the given job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/cancel - /// - /// - /// Operation Id - /// Jobs_Cancel - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Cancel(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobResource.Cancel"); - scope.Start(); - try - { - var response = _hybridDataJobJobsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new HybridDataArmOperation(_hybridDataJobJobsClientDiagnostics, Pipeline, _hybridDataJobJobsRestClient.CreateCancelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resumes the given job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/resume - /// - /// - /// Operation Id - /// Jobs_Resume - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task ResumeAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobResource.Resume"); - scope.Start(); - try - { - var response = await _hybridDataJobJobsRestClient.ResumeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(_hybridDataJobJobsClientDiagnostics, Pipeline, _hybridDataJobJobsRestClient.CreateResumeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resumes the given job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/resume - /// - /// - /// Operation Id - /// Jobs_Resume - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Resume(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataJobJobsClientDiagnostics.CreateScope("HybridDataJobResource.Resume"); - scope.Start(); - try - { - var response = _hybridDataJobJobsRestClient.Resume(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new HybridDataArmOperation(_hybridDataJobJobsClientDiagnostics, Pipeline, _hybridDataJobJobsRestClient.CreateResumeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataManagerCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataManagerCollection.cs deleted file mode 100644 index c9df3a54091f..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataManagerCollection.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetHybridDataManagers method from an instance of . - /// - public partial class HybridDataManagerCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _hybridDataManagerDataManagersClientDiagnostics; - private readonly DataManagersRestOperations _hybridDataManagerDataManagersRestClient; - - /// Initializes a new instance of the class for mocking. - protected HybridDataManagerCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal HybridDataManagerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataManagerDataManagersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataManagerResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataManagerResource.ResourceType, out string hybridDataManagerDataManagersApiVersion); - _hybridDataManagerDataManagersRestClient = new DataManagersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataManagerDataManagersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API - /// and should instead be updated with the Update data manager resource API. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Data manager resource details from request body. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dataManagerName, HybridDataManagerData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _hybridDataManagerDataManagersRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, dataManagerName, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(new HybridDataManagerOperationSource(Client), _hybridDataManagerDataManagersClientDiagnostics, Pipeline, _hybridDataManagerDataManagersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, dataManagerName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API - /// and should instead be updated with the Update data manager resource API. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Data manager resource details from request body. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dataManagerName, HybridDataManagerData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _hybridDataManagerDataManagersRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, dataManagerName, data, cancellationToken); - var operation = new HybridDataArmOperation(new HybridDataManagerOperationSource(Client), _hybridDataManagerDataManagersClientDiagnostics, Pipeline, _hybridDataManagerDataManagersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, dataManagerName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets information about the specified data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerCollection.Get"); - scope.Start(); - try - { - var response = await _hybridDataManagerDataManagersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, dataManagerName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataManagerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets information about the specified data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerCollection.Get"); - scope.Start(); - try - { - var response = _hybridDataManagerDataManagersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, dataManagerName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataManagerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all the data manager resources available under the given resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers - /// - /// - /// Operation Id - /// DataManagers_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataManagerDataManagersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new HybridDataManagerResource(Client, HybridDataManagerData.DeserializeHybridDataManagerData(e)), _hybridDataManagerDataManagersClientDiagnostics, Pipeline, "HybridDataManagerCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Lists all the data manager resources available under the given resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers - /// - /// - /// Operation Id - /// DataManagers_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataManagerDataManagersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new HybridDataManagerResource(Client, HybridDataManagerData.DeserializeHybridDataManagerData(e)), _hybridDataManagerDataManagersClientDiagnostics, Pipeline, "HybridDataManagerCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerCollection.Exists"); - scope.Start(); - try - { - var response = await _hybridDataManagerDataManagersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, dataManagerName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerCollection.Exists"); - scope.Start(); - try - { - var response = _hybridDataManagerDataManagersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, dataManagerName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataManagerData.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataManagerData.cs deleted file mode 100644 index f239ce10ced0..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataManagerData.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing the HybridDataManager data model. - /// The DataManager resource. - /// - public partial class HybridDataManagerData : TrackedResourceData - { - /// Initializes a new instance of HybridDataManagerData. - /// The location. - public HybridDataManagerData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of HybridDataManagerData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Etag of the Resource. - /// The sku type. - internal HybridDataManagerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, HybridDataSku sku) : base(id, name, resourceType, systemData, tags, location) - { - ETag = etag; - Sku = sku; - } - - /// Etag of the Resource. - public ETag? ETag { get; set; } - /// The sku type. - public HybridDataSku Sku { get; set; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataManagerResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataManagerResource.cs deleted file mode 100644 index 76e0f9be17f6..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataManagerResource.cs +++ /dev/null @@ -1,926 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A Class representing a HybridDataManager along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetHybridDataManagerResource method. - /// Otherwise you can get one from its parent resource using the GetHybridDataManager method. - /// - public partial class HybridDataManagerResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _hybridDataManagerDataManagersClientDiagnostics; - private readonly DataManagersRestOperations _hybridDataManagerDataManagersRestClient; - private readonly ClientDiagnostics _hybridDataJobDefinitionJobDefinitionsClientDiagnostics; - private readonly JobDefinitionsRestOperations _hybridDataJobDefinitionJobDefinitionsRestClient; - private readonly ClientDiagnostics _hybridDataJobJobsClientDiagnostics; - private readonly JobsRestOperations _hybridDataJobJobsRestClient; - private readonly HybridDataManagerData _data; - - /// Initializes a new instance of the class for mocking. - protected HybridDataManagerResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal HybridDataManagerResource(ArmClient client, HybridDataManagerData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal HybridDataManagerResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataManagerDataManagersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string hybridDataManagerDataManagersApiVersion); - _hybridDataManagerDataManagersRestClient = new DataManagersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataManagerDataManagersApiVersion); - _hybridDataJobDefinitionJobDefinitionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataJobDefinitionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataJobDefinitionResource.ResourceType, out string hybridDataJobDefinitionJobDefinitionsApiVersion); - _hybridDataJobDefinitionJobDefinitionsRestClient = new JobDefinitionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataJobDefinitionJobDefinitionsApiVersion); - _hybridDataJobJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataJobResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataJobResource.ResourceType, out string hybridDataJobJobsApiVersion); - _hybridDataJobJobsRestClient = new JobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataJobJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.HybridData/dataManagers"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual HybridDataManagerData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of HybridDataServiceResources in the HybridDataManager. - /// An object representing collection of HybridDataServiceResources and their operations over a HybridDataServiceResource. - public virtual HybridDataServiceCollection GetHybridDataServices() - { - return GetCachedClient(Client => new HybridDataServiceCollection(Client, Id)); - } - - /// - /// Gets the data service that matches the data service name given. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName} - /// - /// - /// Operation Id - /// DataServices_Get - /// - /// - /// - /// The name of the data service that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetHybridDataServiceAsync(string dataServiceName, CancellationToken cancellationToken = default) - { - return await GetHybridDataServices().GetAsync(dataServiceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the data service that matches the data service name given. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName} - /// - /// - /// Operation Id - /// DataServices_Get - /// - /// - /// - /// The name of the data service that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetHybridDataService(string dataServiceName, CancellationToken cancellationToken = default) - { - return GetHybridDataServices().Get(dataServiceName, cancellationToken); - } - - /// Gets a collection of HybridDataStoreResources in the HybridDataManager. - /// An object representing collection of HybridDataStoreResources and their operations over a HybridDataStoreResource. - public virtual HybridDataStoreCollection GetHybridDataStores() - { - return GetCachedClient(Client => new HybridDataStoreCollection(Client, Id)); - } - - /// - /// This method gets the data store/repository by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Get - /// - /// - /// - /// The data store/repository name queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetHybridDataStoreAsync(string dataStoreName, CancellationToken cancellationToken = default) - { - return await GetHybridDataStores().GetAsync(dataStoreName, cancellationToken).ConfigureAwait(false); - } - - /// - /// This method gets the data store/repository by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Get - /// - /// - /// - /// The data store/repository name queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetHybridDataStore(string dataStoreName, CancellationToken cancellationToken = default) - { - return GetHybridDataStores().Get(dataStoreName, cancellationToken); - } - - /// Gets a collection of HybridDataStoreTypeResources in the HybridDataManager. - /// An object representing collection of HybridDataStoreTypeResources and their operations over a HybridDataStoreTypeResource. - public virtual HybridDataStoreTypeCollection GetHybridDataStoreTypes() - { - return GetCachedClient(Client => new HybridDataStoreTypeCollection(Client, Id)); - } - - /// - /// Gets the data store/repository type given its name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName} - /// - /// - /// Operation Id - /// DataStoreTypes_Get - /// - /// - /// - /// The data store/repository type name for which details are needed. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetHybridDataStoreTypeAsync(string dataStoreTypeName, CancellationToken cancellationToken = default) - { - return await GetHybridDataStoreTypes().GetAsync(dataStoreTypeName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the data store/repository type given its name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName} - /// - /// - /// Operation Id - /// DataStoreTypes_Get - /// - /// - /// - /// The data store/repository type name for which details are needed. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetHybridDataStoreType(string dataStoreTypeName, CancellationToken cancellationToken = default) - { - return GetHybridDataStoreTypes().Get(dataStoreTypeName, cancellationToken); - } - - /// Gets a collection of HybridDataPublicKeyResources in the HybridDataManager. - /// An object representing collection of HybridDataPublicKeyResources and their operations over a HybridDataPublicKeyResource. - public virtual HybridDataPublicKeyCollection GetHybridDataPublicKeys() - { - return GetCachedClient(Client => new HybridDataPublicKeyCollection(Client, Id)); - } - - /// - /// This method gets the public keys. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName} - /// - /// - /// Operation Id - /// PublicKeys_Get - /// - /// - /// - /// Name of the public key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetHybridDataPublicKeyAsync(string publicKeyName, CancellationToken cancellationToken = default) - { - return await GetHybridDataPublicKeys().GetAsync(publicKeyName, cancellationToken).ConfigureAwait(false); - } - - /// - /// This method gets the public keys. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName} - /// - /// - /// Operation Id - /// PublicKeys_Get - /// - /// - /// - /// Name of the public key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetHybridDataPublicKey(string publicKeyName, CancellationToken cancellationToken = default) - { - return GetHybridDataPublicKeys().Get(publicKeyName, cancellationToken); - } - - /// - /// Gets information about the specified data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.Get"); - scope.Start(); - try - { - var response = await _hybridDataManagerDataManagersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataManagerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets information about the specified data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.Get"); - scope.Start(); - try - { - var response = _hybridDataManagerDataManagersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataManagerResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a data manager resource in Microsoft Azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.Delete"); - scope.Start(); - try - { - var response = await _hybridDataManagerDataManagersRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(_hybridDataManagerDataManagersClientDiagnostics, Pipeline, _hybridDataManagerDataManagersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a data manager resource in Microsoft Azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.Delete"); - scope.Start(); - try - { - var response = _hybridDataManagerDataManagersRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new HybridDataArmOperation(_hybridDataManagerDataManagersClientDiagnostics, Pipeline, _hybridDataManagerDataManagersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Data manager resource details from request body. - /// Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, HybridDataManagerPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.Update"); - scope.Start(); - try - { - var response = await _hybridDataManagerDataManagersRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(new HybridDataManagerOperationSource(Client), _hybridDataManagerDataManagersClientDiagnostics, Pipeline, _hybridDataManagerDataManagersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Data manager resource details from request body. - /// Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, HybridDataManagerPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.Update"); - scope.Start(); - try - { - var response = _hybridDataManagerDataManagersRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); - var operation = new HybridDataArmOperation(new HybridDataManagerOperationSource(Client), _hybridDataManagerDataManagersClientDiagnostics, Pipeline, _hybridDataManagerDataManagersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets all the job definitions of the given data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/jobDefinitions - /// - /// - /// Operation Id - /// JobDefinitions_ListByDataManager - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetJobDefinitionsAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobDefinitionJobDefinitionsRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobDefinitionJobDefinitionsRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobDefinitionResource(Client, HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(e)), _hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, "HybridDataManagerResource.GetJobDefinitions", "value", "nextLink", cancellationToken); - } - - /// - /// This method gets all the job definitions of the given data manager resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/jobDefinitions - /// - /// - /// Operation Id - /// JobDefinitions_ListByDataManager - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetJobDefinitions(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobDefinitionJobDefinitionsRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobDefinitionJobDefinitionsRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobDefinitionResource(Client, HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(e)), _hybridDataJobDefinitionJobDefinitionsClientDiagnostics, Pipeline, "HybridDataManagerResource.GetJobDefinitions", "value", "nextLink", cancellationToken); - } - - /// - /// This method gets all the jobs at the data manager resource level. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/jobs - /// - /// - /// Operation Id - /// Jobs_ListByDataManager - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetJobsAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobJobsRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobJobsRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobResource(Client, HybridDataJobData.DeserializeHybridDataJobData(e)), _hybridDataJobJobsClientDiagnostics, Pipeline, "HybridDataManagerResource.GetJobs", "value", "nextLink", cancellationToken); - } - - /// - /// This method gets all the jobs at the data manager resource level. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/jobs - /// - /// - /// Operation Id - /// Jobs_ListByDataManager - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetJobs(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobJobsRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobJobsRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobResource(Client, HybridDataJobData.DeserializeHybridDataJobData(e)), _hybridDataJobJobsClientDiagnostics, Pipeline, "HybridDataManagerResource.GetJobs", "value", "nextLink", cancellationToken); - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _hybridDataManagerDataManagersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new HybridDataManagerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new HybridDataManagerPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _hybridDataManagerDataManagersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new HybridDataManagerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new HybridDataManagerPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _hybridDataManagerDataManagersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new HybridDataManagerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new HybridDataManagerPatch(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _hybridDataManagerDataManagersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new HybridDataManagerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new HybridDataManagerPatch(); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _hybridDataManagerDataManagersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new HybridDataManagerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new HybridDataManagerPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName} - /// - /// - /// Operation Id - /// DataManagers_Get - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _hybridDataManagerDataManagersClientDiagnostics.CreateScope("HybridDataManagerResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _hybridDataManagerDataManagersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new HybridDataManagerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new HybridDataManagerPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataPublicKeyCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataPublicKeyCollection.cs deleted file mode 100644 index b3a9f07393b5..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataPublicKeyCollection.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetHybridDataPublicKeys method from an instance of . - /// - public partial class HybridDataPublicKeyCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _hybridDataPublicKeyPublicKeysClientDiagnostics; - private readonly PublicKeysRestOperations _hybridDataPublicKeyPublicKeysRestClient; - - /// Initializes a new instance of the class for mocking. - protected HybridDataPublicKeyCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal HybridDataPublicKeyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataPublicKeyPublicKeysClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataPublicKeyResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataPublicKeyResource.ResourceType, out string hybridDataPublicKeyPublicKeysApiVersion); - _hybridDataPublicKeyPublicKeysRestClient = new PublicKeysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataPublicKeyPublicKeysApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != HybridDataManagerResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HybridDataManagerResource.ResourceType), nameof(id)); - } - - /// - /// This method gets the public keys. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName} - /// - /// - /// Operation Id - /// PublicKeys_Get - /// - /// - /// - /// Name of the public key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string publicKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(publicKeyName, nameof(publicKeyName)); - - using var scope = _hybridDataPublicKeyPublicKeysClientDiagnostics.CreateScope("HybridDataPublicKeyCollection.Get"); - scope.Start(); - try - { - var response = await _hybridDataPublicKeyPublicKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, publicKeyName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataPublicKeyResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets the public keys. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName} - /// - /// - /// Operation Id - /// PublicKeys_Get - /// - /// - /// - /// Name of the public key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string publicKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(publicKeyName, nameof(publicKeyName)); - - using var scope = _hybridDataPublicKeyPublicKeysClientDiagnostics.CreateScope("HybridDataPublicKeyCollection.Get"); - scope.Start(); - try - { - var response = _hybridDataPublicKeyPublicKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, publicKeyName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataPublicKeyResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets the list view of public keys, however it will only have one element. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys - /// - /// - /// Operation Id - /// PublicKeys_ListByDataManager - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataPublicKeyPublicKeysRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataPublicKeyPublicKeysRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridDataPublicKeyResource(Client, HybridDataPublicKeyData.DeserializeHybridDataPublicKeyData(e)), _hybridDataPublicKeyPublicKeysClientDiagnostics, Pipeline, "HybridDataPublicKeyCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// This method gets the list view of public keys, however it will only have one element. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys - /// - /// - /// Operation Id - /// PublicKeys_ListByDataManager - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataPublicKeyPublicKeysRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataPublicKeyPublicKeysRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridDataPublicKeyResource(Client, HybridDataPublicKeyData.DeserializeHybridDataPublicKeyData(e)), _hybridDataPublicKeyPublicKeysClientDiagnostics, Pipeline, "HybridDataPublicKeyCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName} - /// - /// - /// Operation Id - /// PublicKeys_Get - /// - /// - /// - /// Name of the public key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string publicKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(publicKeyName, nameof(publicKeyName)); - - using var scope = _hybridDataPublicKeyPublicKeysClientDiagnostics.CreateScope("HybridDataPublicKeyCollection.Exists"); - scope.Start(); - try - { - var response = await _hybridDataPublicKeyPublicKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, publicKeyName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName} - /// - /// - /// Operation Id - /// PublicKeys_Get - /// - /// - /// - /// Name of the public key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string publicKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(publicKeyName, nameof(publicKeyName)); - - using var scope = _hybridDataPublicKeyPublicKeysClientDiagnostics.CreateScope("HybridDataPublicKeyCollection.Exists"); - scope.Start(); - try - { - var response = _hybridDataPublicKeyPublicKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, publicKeyName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataPublicKeyData.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataPublicKeyData.cs deleted file mode 100644 index d778f03520a6..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataPublicKeyData.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing the HybridDataPublicKey data model. - /// Public key - /// - public partial class HybridDataPublicKeyData : ResourceData - { - /// Initializes a new instance of HybridDataPublicKeyData. - /// Level one public key for encryption. - /// Level two public key for encryption. - /// or is null. - public HybridDataPublicKeyData(HybridDataEncryptionKey dataServiceLevel1Key, HybridDataEncryptionKey dataServiceLevel2Key) - { - Argument.AssertNotNull(dataServiceLevel1Key, nameof(dataServiceLevel1Key)); - Argument.AssertNotNull(dataServiceLevel2Key, nameof(dataServiceLevel2Key)); - - DataServiceLevel1Key = dataServiceLevel1Key; - DataServiceLevel2Key = dataServiceLevel2Key; - } - - /// Initializes a new instance of HybridDataPublicKeyData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Level one public key for encryption. - /// Level two public key for encryption. - internal HybridDataPublicKeyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HybridDataEncryptionKey dataServiceLevel1Key, HybridDataEncryptionKey dataServiceLevel2Key) : base(id, name, resourceType, systemData) - { - DataServiceLevel1Key = dataServiceLevel1Key; - DataServiceLevel2Key = dataServiceLevel2Key; - } - - /// Level one public key for encryption. - public HybridDataEncryptionKey DataServiceLevel1Key { get; set; } - /// Level two public key for encryption. - public HybridDataEncryptionKey DataServiceLevel2Key { get; set; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataPublicKeyResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataPublicKeyResource.cs deleted file mode 100644 index 09140098939a..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataPublicKeyResource.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A Class representing a HybridDataPublicKey along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetHybridDataPublicKeyResource method. - /// Otherwise you can get one from its parent resource using the GetHybridDataPublicKey method. - /// - public partial class HybridDataPublicKeyResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string publicKeyName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _hybridDataPublicKeyPublicKeysClientDiagnostics; - private readonly PublicKeysRestOperations _hybridDataPublicKeyPublicKeysRestClient; - private readonly HybridDataPublicKeyData _data; - - /// Initializes a new instance of the class for mocking. - protected HybridDataPublicKeyResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal HybridDataPublicKeyResource(ArmClient client, HybridDataPublicKeyData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal HybridDataPublicKeyResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataPublicKeyPublicKeysClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string hybridDataPublicKeyPublicKeysApiVersion); - _hybridDataPublicKeyPublicKeysRestClient = new PublicKeysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataPublicKeyPublicKeysApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.HybridData/dataManagers/publicKeys"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual HybridDataPublicKeyData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// This method gets the public keys. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName} - /// - /// - /// Operation Id - /// PublicKeys_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataPublicKeyPublicKeysClientDiagnostics.CreateScope("HybridDataPublicKeyResource.Get"); - scope.Start(); - try - { - var response = await _hybridDataPublicKeyPublicKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataPublicKeyResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets the public keys. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName} - /// - /// - /// Operation Id - /// PublicKeys_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataPublicKeyPublicKeysClientDiagnostics.CreateScope("HybridDataPublicKeyResource.Get"); - scope.Start(); - try - { - var response = _hybridDataPublicKeyPublicKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataPublicKeyResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataServiceCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataServiceCollection.cs deleted file mode 100644 index 268c4f34bd4c..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataServiceCollection.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetHybridDataServices method from an instance of . - /// - public partial class HybridDataServiceCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _hybridDataServiceDataServicesClientDiagnostics; - private readonly DataServicesRestOperations _hybridDataServiceDataServicesRestClient; - - /// Initializes a new instance of the class for mocking. - protected HybridDataServiceCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal HybridDataServiceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataServiceDataServicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataServiceResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataServiceResource.ResourceType, out string hybridDataServiceDataServicesApiVersion); - _hybridDataServiceDataServicesRestClient = new DataServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataServiceDataServicesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != HybridDataManagerResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HybridDataManagerResource.ResourceType), nameof(id)); - } - - /// - /// Gets the data service that matches the data service name given. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName} - /// - /// - /// Operation Id - /// DataServices_Get - /// - /// - /// - /// The name of the data service that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string dataServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var scope = _hybridDataServiceDataServicesClientDiagnostics.CreateScope("HybridDataServiceCollection.Get"); - scope.Start(); - try - { - var response = await _hybridDataServiceDataServicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataServiceName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataServiceResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the data service that matches the data service name given. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName} - /// - /// - /// Operation Id - /// DataServices_Get - /// - /// - /// - /// The name of the data service that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string dataServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var scope = _hybridDataServiceDataServicesClientDiagnostics.CreateScope("HybridDataServiceCollection.Get"); - scope.Start(); - try - { - var response = _hybridDataServiceDataServicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataServiceName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataServiceResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets all the data services. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices - /// - /// - /// Operation Id - /// DataServices_ListByDataManager - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataServiceDataServicesRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataServiceDataServicesRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridDataServiceResource(Client, HybridDataServiceData.DeserializeHybridDataServiceData(e)), _hybridDataServiceDataServicesClientDiagnostics, Pipeline, "HybridDataServiceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// This method gets all the data services. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices - /// - /// - /// Operation Id - /// DataServices_ListByDataManager - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataServiceDataServicesRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataServiceDataServicesRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridDataServiceResource(Client, HybridDataServiceData.DeserializeHybridDataServiceData(e)), _hybridDataServiceDataServicesClientDiagnostics, Pipeline, "HybridDataServiceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName} - /// - /// - /// Operation Id - /// DataServices_Get - /// - /// - /// - /// The name of the data service that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string dataServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var scope = _hybridDataServiceDataServicesClientDiagnostics.CreateScope("HybridDataServiceCollection.Exists"); - scope.Start(); - try - { - var response = await _hybridDataServiceDataServicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataServiceName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName} - /// - /// - /// Operation Id - /// DataServices_Get - /// - /// - /// - /// The name of the data service that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string dataServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var scope = _hybridDataServiceDataServicesClientDiagnostics.CreateScope("HybridDataServiceCollection.Exists"); - scope.Start(); - try - { - var response = _hybridDataServiceDataServicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataServiceName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataServiceData.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataServiceData.cs deleted file mode 100644 index a29f8a2ba182..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataServiceData.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing the HybridDataService data model. - /// Data Service. - /// - public partial class HybridDataServiceData : ResourceData - { - /// Initializes a new instance of HybridDataServiceData. - /// State of the data service. - public HybridDataServiceData(HybridDataState state) - { - State = state; - SupportedDataSinkTypes = new ChangeTrackingList(); - SupportedDataSourceTypes = new ChangeTrackingList(); - } - - /// Initializes a new instance of HybridDataServiceData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// State of the data service. - /// Supported data store types which can be used as a sink. - /// Supported data store types which can be used as a source. - internal HybridDataServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HybridDataState state, IList supportedDataSinkTypes, IList supportedDataSourceTypes) : base(id, name, resourceType, systemData) - { - State = state; - SupportedDataSinkTypes = supportedDataSinkTypes; - SupportedDataSourceTypes = supportedDataSourceTypes; - } - - /// State of the data service. - public HybridDataState State { get; set; } - /// Supported data store types which can be used as a sink. - public IList SupportedDataSinkTypes { get; } - /// Supported data store types which can be used as a source. - public IList SupportedDataSourceTypes { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataServiceResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataServiceResource.cs deleted file mode 100644 index 76508d4247e7..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataServiceResource.cs +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A Class representing a HybridDataService along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetHybridDataServiceResource method. - /// Otherwise you can get one from its parent resource using the GetHybridDataService method. - /// - public partial class HybridDataServiceResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _hybridDataServiceDataServicesClientDiagnostics; - private readonly DataServicesRestOperations _hybridDataServiceDataServicesRestClient; - private readonly ClientDiagnostics _hybridDataJobJobsClientDiagnostics; - private readonly JobsRestOperations _hybridDataJobJobsRestClient; - private readonly HybridDataServiceData _data; - - /// Initializes a new instance of the class for mocking. - protected HybridDataServiceResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal HybridDataServiceResource(ArmClient client, HybridDataServiceData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal HybridDataServiceResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataServiceDataServicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string hybridDataServiceDataServicesApiVersion); - _hybridDataServiceDataServicesRestClient = new DataServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataServiceDataServicesApiVersion); - _hybridDataJobJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataJobResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataJobResource.ResourceType, out string hybridDataJobJobsApiVersion); - _hybridDataJobJobsRestClient = new JobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataJobJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.HybridData/dataManagers/dataServices"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual HybridDataServiceData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of HybridDataJobDefinitionResources in the HybridDataService. - /// An object representing collection of HybridDataJobDefinitionResources and their operations over a HybridDataJobDefinitionResource. - public virtual HybridDataJobDefinitionCollection GetHybridDataJobDefinitions() - { - return GetCachedClient(Client => new HybridDataJobDefinitionCollection(Client, Id)); - } - - /// - /// This method gets job definition object by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Get - /// - /// - /// - /// The job definition name that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetHybridDataJobDefinitionAsync(string jobDefinitionName, CancellationToken cancellationToken = default) - { - return await GetHybridDataJobDefinitions().GetAsync(jobDefinitionName, cancellationToken).ConfigureAwait(false); - } - - /// - /// This method gets job definition object by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName} - /// - /// - /// Operation Id - /// JobDefinitions_Get - /// - /// - /// - /// The job definition name that is being queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetHybridDataJobDefinition(string jobDefinitionName, CancellationToken cancellationToken = default) - { - return GetHybridDataJobDefinitions().Get(jobDefinitionName, cancellationToken); - } - - /// - /// Gets the data service that matches the data service name given. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName} - /// - /// - /// Operation Id - /// DataServices_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataServiceDataServicesClientDiagnostics.CreateScope("HybridDataServiceResource.Get"); - scope.Start(); - try - { - var response = await _hybridDataServiceDataServicesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataServiceResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the data service that matches the data service name given. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName} - /// - /// - /// Operation Id - /// DataServices_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataServiceDataServicesClientDiagnostics.CreateScope("HybridDataServiceResource.Get"); - scope.Start(); - try - { - var response = _hybridDataServiceDataServicesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataServiceResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets all the jobs of a data service type in a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobs - /// - /// - /// Operation Id - /// Jobs_ListByDataService - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetJobsAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobJobsRestClient.CreateListByDataServiceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobJobsRestClient.CreateListByDataServiceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobResource(Client, HybridDataJobData.DeserializeHybridDataJobData(e)), _hybridDataJobJobsClientDiagnostics, Pipeline, "HybridDataServiceResource.GetJobs", "value", "nextLink", cancellationToken); - } - - /// - /// This method gets all the jobs of a data service type in a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobs - /// - /// - /// Operation Id - /// Jobs_ListByDataService - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetJobs(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataJobJobsRestClient.CreateListByDataServiceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataJobJobsRestClient.CreateListByDataServiceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridDataJobResource(Client, HybridDataJobData.DeserializeHybridDataJobData(e)), _hybridDataJobJobsClientDiagnostics, Pipeline, "HybridDataServiceResource.GetJobs", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreCollection.cs deleted file mode 100644 index 525497063d4f..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreCollection.cs +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetHybridDataStores method from an instance of . - /// - public partial class HybridDataStoreCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _hybridDataStoreDataStoresClientDiagnostics; - private readonly DataStoresRestOperations _hybridDataStoreDataStoresRestClient; - - /// Initializes a new instance of the class for mocking. - protected HybridDataStoreCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal HybridDataStoreCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataStoreDataStoresClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataStoreResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataStoreResource.ResourceType, out string hybridDataStoreDataStoresApiVersion); - _hybridDataStoreDataStoresRestClient = new DataStoresRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataStoreDataStoresApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != HybridDataManagerResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HybridDataManagerResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates the data store/repository in the data manager. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The data store/repository name to be created or updated. - /// The data store/repository object to be created or updated. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dataStoreName, HybridDataStoreData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _hybridDataStoreDataStoresRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreName, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(new HybridDataStoreOperationSource(Client), _hybridDataStoreDataStoresClientDiagnostics, Pipeline, _hybridDataStoreDataStoresRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates the data store/repository in the data manager. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The data store/repository name to be created or updated. - /// The data store/repository object to be created or updated. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dataStoreName, HybridDataStoreData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _hybridDataStoreDataStoresRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreName, data, cancellationToken); - var operation = new HybridDataArmOperation(new HybridDataStoreOperationSource(Client), _hybridDataStoreDataStoresClientDiagnostics, Pipeline, _hybridDataStoreDataStoresRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets the data store/repository by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Get - /// - /// - /// - /// The data store/repository name queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string dataStoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreCollection.Get"); - scope.Start(); - try - { - var response = await _hybridDataStoreDataStoresRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataStoreResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets the data store/repository by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Get - /// - /// - /// - /// The data store/repository name queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string dataStoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreCollection.Get"); - scope.Start(); - try - { - var response = _hybridDataStoreDataStoresRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataStoreResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets all the data stores/repositories in the given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores - /// - /// - /// Operation Id - /// DataStores_ListByDataManager - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataStoreDataStoresRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataStoreDataStoresRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridDataStoreResource(Client, HybridDataStoreData.DeserializeHybridDataStoreData(e)), _hybridDataStoreDataStoresClientDiagnostics, Pipeline, "HybridDataStoreCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets all the data stores/repositories in the given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores - /// - /// - /// Operation Id - /// DataStores_ListByDataManager - /// - /// - /// - /// OData Filter options. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataStoreDataStoresRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataStoreDataStoresRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridDataStoreResource(Client, HybridDataStoreData.DeserializeHybridDataStoreData(e)), _hybridDataStoreDataStoresClientDiagnostics, Pipeline, "HybridDataStoreCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Get - /// - /// - /// - /// The data store/repository name queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string dataStoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreCollection.Exists"); - scope.Start(); - try - { - var response = await _hybridDataStoreDataStoresRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Get - /// - /// - /// - /// The data store/repository name queried. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string dataStoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreCollection.Exists"); - scope.Start(); - try - { - var response = _hybridDataStoreDataStoresRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreData.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreData.cs deleted file mode 100644 index d8b7a4039d05..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreData.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing the HybridDataStore data model. - /// Data store. - /// - public partial class HybridDataStoreData : ResourceData - { - /// Initializes a new instance of HybridDataStoreData. - /// State of the data source. - /// The arm id of the data store type. - /// is null. - public HybridDataStoreData(HybridDataState state, ResourceIdentifier dataStoreTypeId) - { - Argument.AssertNotNull(dataStoreTypeId, nameof(dataStoreTypeId)); - - State = state; - DataStoreTypeId = dataStoreTypeId; - CustomerSecrets = new ChangeTrackingList(); - } - - /// Initializes a new instance of HybridDataStoreData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Arm Id for the manager resource to which the data source is associated. This is optional. - /// State of the data source. - /// A generic json used differently by each data source type. - /// The arm id of the data store type. - /// List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. - internal HybridDataStoreData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier repositoryId, HybridDataState state, BinaryData extendedProperties, ResourceIdentifier dataStoreTypeId, IList customerSecrets) : base(id, name, resourceType, systemData) - { - RepositoryId = repositoryId; - State = state; - ExtendedProperties = extendedProperties; - DataStoreTypeId = dataStoreTypeId; - CustomerSecrets = customerSecrets; - } - - /// Arm Id for the manager resource to which the data source is associated. This is optional. - public ResourceIdentifier RepositoryId { get; set; } - /// State of the data source. - public HybridDataState State { get; set; } - /// - /// A generic json used differently by each data source type. - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData ExtendedProperties { get; set; } - /// The arm id of the data store type. - public ResourceIdentifier DataStoreTypeId { get; set; } - /// List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. - public IList CustomerSecrets { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreResource.cs deleted file mode 100644 index ec147b83ed85..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreResource.cs +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A Class representing a HybridDataStore along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetHybridDataStoreResource method. - /// Otherwise you can get one from its parent resource using the GetHybridDataStore method. - /// - public partial class HybridDataStoreResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _hybridDataStoreDataStoresClientDiagnostics; - private readonly DataStoresRestOperations _hybridDataStoreDataStoresRestClient; - private readonly HybridDataStoreData _data; - - /// Initializes a new instance of the class for mocking. - protected HybridDataStoreResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal HybridDataStoreResource(ArmClient client, HybridDataStoreData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal HybridDataStoreResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataStoreDataStoresClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string hybridDataStoreDataStoresApiVersion); - _hybridDataStoreDataStoresRestClient = new DataStoresRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataStoreDataStoresApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.HybridData/dataManagers/dataStores"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual HybridDataStoreData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// This method gets the data store/repository by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreResource.Get"); - scope.Start(); - try - { - var response = await _hybridDataStoreDataStoresRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataStoreResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method gets the data store/repository by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreResource.Get"); - scope.Start(); - try - { - var response = _hybridDataStoreDataStoresRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataStoreResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method deletes the given data store/repository. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreResource.Delete"); - scope.Start(); - try - { - var response = await _hybridDataStoreDataStoresRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(_hybridDataStoreDataStoresClientDiagnostics, Pipeline, _hybridDataStoreDataStoresRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This method deletes the given data store/repository. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreResource.Delete"); - scope.Start(); - try - { - var response = _hybridDataStoreDataStoresRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new HybridDataArmOperation(_hybridDataStoreDataStoresClientDiagnostics, Pipeline, _hybridDataStoreDataStoresRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates the data store/repository in the data manager. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The data store/repository object to be created or updated. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, HybridDataStoreData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreResource.Update"); - scope.Start(); - try - { - var response = await _hybridDataStoreDataStoresRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridDataArmOperation(new HybridDataStoreOperationSource(Client), _hybridDataStoreDataStoresClientDiagnostics, Pipeline, _hybridDataStoreDataStoresRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates the data store/repository in the data manager. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName} - /// - /// - /// Operation Id - /// DataStores_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The data store/repository object to be created or updated. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, HybridDataStoreData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridDataStoreDataStoresClientDiagnostics.CreateScope("HybridDataStoreResource.Update"); - scope.Start(); - try - { - var response = _hybridDataStoreDataStoresRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new HybridDataArmOperation(new HybridDataStoreOperationSource(Client), _hybridDataStoreDataStoresClientDiagnostics, Pipeline, _hybridDataStoreDataStoresRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreTypeCollection.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreTypeCollection.cs deleted file mode 100644 index 33d241e24562..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreTypeCollection.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetHybridDataStoreTypes method from an instance of . - /// - public partial class HybridDataStoreTypeCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _hybridDataStoreTypeDataStoreTypesClientDiagnostics; - private readonly DataStoreTypesRestOperations _hybridDataStoreTypeDataStoreTypesRestClient; - - /// Initializes a new instance of the class for mocking. - protected HybridDataStoreTypeCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal HybridDataStoreTypeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataStoreTypeDataStoreTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", HybridDataStoreTypeResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridDataStoreTypeResource.ResourceType, out string hybridDataStoreTypeDataStoreTypesApiVersion); - _hybridDataStoreTypeDataStoreTypesRestClient = new DataStoreTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataStoreTypeDataStoreTypesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != HybridDataManagerResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HybridDataManagerResource.ResourceType), nameof(id)); - } - - /// - /// Gets the data store/repository type given its name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName} - /// - /// - /// Operation Id - /// DataStoreTypes_Get - /// - /// - /// - /// The data store/repository type name for which details are needed. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string dataStoreTypeName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreTypeName, nameof(dataStoreTypeName)); - - using var scope = _hybridDataStoreTypeDataStoreTypesClientDiagnostics.CreateScope("HybridDataStoreTypeCollection.Get"); - scope.Start(); - try - { - var response = await _hybridDataStoreTypeDataStoreTypesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreTypeName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataStoreTypeResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the data store/repository type given its name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName} - /// - /// - /// Operation Id - /// DataStoreTypes_Get - /// - /// - /// - /// The data store/repository type name for which details are needed. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string dataStoreTypeName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreTypeName, nameof(dataStoreTypeName)); - - using var scope = _hybridDataStoreTypeDataStoreTypesClientDiagnostics.CreateScope("HybridDataStoreTypeCollection.Get"); - scope.Start(); - try - { - var response = _hybridDataStoreTypeDataStoreTypesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreTypeName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataStoreTypeResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets all the data store/repository types that the resource supports. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes - /// - /// - /// Operation Id - /// DataStoreTypes_ListByDataManager - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataStoreTypeDataStoreTypesRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataStoreTypeDataStoreTypesRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridDataStoreTypeResource(Client, HybridDataStoreTypeData.DeserializeHybridDataStoreTypeData(e)), _hybridDataStoreTypeDataStoreTypesClientDiagnostics, Pipeline, "HybridDataStoreTypeCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets all the data store/repository types that the resource supports. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes - /// - /// - /// Operation Id - /// DataStoreTypes_ListByDataManager - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridDataStoreTypeDataStoreTypesRestClient.CreateListByDataManagerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridDataStoreTypeDataStoreTypesRestClient.CreateListByDataManagerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridDataStoreTypeResource(Client, HybridDataStoreTypeData.DeserializeHybridDataStoreTypeData(e)), _hybridDataStoreTypeDataStoreTypesClientDiagnostics, Pipeline, "HybridDataStoreTypeCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName} - /// - /// - /// Operation Id - /// DataStoreTypes_Get - /// - /// - /// - /// The data store/repository type name for which details are needed. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string dataStoreTypeName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreTypeName, nameof(dataStoreTypeName)); - - using var scope = _hybridDataStoreTypeDataStoreTypesClientDiagnostics.CreateScope("HybridDataStoreTypeCollection.Exists"); - scope.Start(); - try - { - var response = await _hybridDataStoreTypeDataStoreTypesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreTypeName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName} - /// - /// - /// Operation Id - /// DataStoreTypes_Get - /// - /// - /// - /// The data store/repository type name for which details are needed. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string dataStoreTypeName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(dataStoreTypeName, nameof(dataStoreTypeName)); - - using var scope = _hybridDataStoreTypeDataStoreTypesClientDiagnostics.CreateScope("HybridDataStoreTypeCollection.Exists"); - scope.Start(); - try - { - var response = _hybridDataStoreTypeDataStoreTypesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataStoreTypeName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreTypeData.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreTypeData.cs deleted file mode 100644 index cef734ae32e6..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreTypeData.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A class representing the HybridDataStoreType data model. - /// Data Store Type. - /// - public partial class HybridDataStoreTypeData : ResourceData - { - /// Initializes a new instance of HybridDataStoreTypeData. - /// State of the data store type. - public HybridDataStoreTypeData(HybridDataState state) - { - State = state; - SupportedDataServicesAsSink = new ChangeTrackingList(); - SupportedDataServicesAsSource = new ChangeTrackingList(); - } - - /// Initializes a new instance of HybridDataStoreTypeData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Arm type for the manager resource to which the data source type is associated. This is optional. - /// State of the data store type. - /// Supported data services where it can be used as a sink. - /// Supported data services where it can be used as a source. - internal HybridDataStoreTypeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceType? repositoryType, HybridDataState state, IList supportedDataServicesAsSink, IList supportedDataServicesAsSource) : base(id, name, resourceType, systemData) - { - RepositoryType = repositoryType; - State = state; - SupportedDataServicesAsSink = supportedDataServicesAsSink; - SupportedDataServicesAsSource = supportedDataServicesAsSource; - } - - /// Arm type for the manager resource to which the data source type is associated. This is optional. - public ResourceType? RepositoryType { get; set; } - /// State of the data store type. - public HybridDataState State { get; set; } - /// Supported data services where it can be used as a sink. - public IList SupportedDataServicesAsSink { get; } - /// Supported data services where it can be used as a source. - public IList SupportedDataServicesAsSource { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreTypeResource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreTypeResource.cs deleted file mode 100644 index 859d255b69a6..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/HybridDataStoreTypeResource.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - /// - /// A Class representing a HybridDataStoreType along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetHybridDataStoreTypeResource method. - /// Otherwise you can get one from its parent resource using the GetHybridDataStoreType method. - /// - public partial class HybridDataStoreTypeResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreTypeName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _hybridDataStoreTypeDataStoreTypesClientDiagnostics; - private readonly DataStoreTypesRestOperations _hybridDataStoreTypeDataStoreTypesRestClient; - private readonly HybridDataStoreTypeData _data; - - /// Initializes a new instance of the class for mocking. - protected HybridDataStoreTypeResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal HybridDataStoreTypeResource(ArmClient client, HybridDataStoreTypeData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal HybridDataStoreTypeResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridDataStoreTypeDataStoreTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridData", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string hybridDataStoreTypeDataStoreTypesApiVersion); - _hybridDataStoreTypeDataStoreTypesRestClient = new DataStoreTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridDataStoreTypeDataStoreTypesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.HybridData/dataManagers/dataStoreTypes"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual HybridDataStoreTypeData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the data store/repository type given its name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName} - /// - /// - /// Operation Id - /// DataStoreTypes_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataStoreTypeDataStoreTypesClientDiagnostics.CreateScope("HybridDataStoreTypeResource.Get"); - scope.Start(); - try - { - var response = await _hybridDataStoreTypeDataStoreTypesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataStoreTypeResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the data store/repository type given its name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName} - /// - /// - /// Operation Id - /// DataStoreTypes_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _hybridDataStoreTypeDataStoreTypesClientDiagnostics.CreateScope("HybridDataStoreTypeResource.Get"); - scope.Start(); - try - { - var response = _hybridDataStoreTypeDataStoreTypesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridDataStoreTypeResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataArmOperation.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataArmOperation.cs deleted file mode 100644 index a010a6a79e20..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataArmOperation.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ -#pragma warning disable SA1649 // File name should match first type name - internal class HybridDataArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name - { - private readonly OperationInternal _operation; - - /// Initializes a new instance of HybridDataArmOperation for mocking. - protected HybridDataArmOperation() - { - } - - internal HybridDataArmOperation(Response response) - { - _operation = OperationInternal.Succeeded(response); - } - - internal HybridDataArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) - { - var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); - _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "HybridDataArmOperation", fallbackStrategy: new SequentialDelayStrategy()); - } - - /// -#pragma warning disable CA1822 - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public override string Id => throw new NotImplementedException(); -#pragma warning restore CA1822 - - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// - public override Response GetRawResponse() => _operation.RawResponse; - - /// - public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - - /// - public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - - /// - public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); - - /// - public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); - - /// - public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); - - /// - public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataArmOperationOfT.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataArmOperationOfT.cs deleted file mode 100644 index d21fc9ede8dd..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataArmOperationOfT.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ -#pragma warning disable SA1649 // File name should match first type name - internal class HybridDataArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name - { - private readonly OperationInternal _operation; - - /// Initializes a new instance of HybridDataArmOperation for mocking. - protected HybridDataArmOperation() - { - } - - internal HybridDataArmOperation(Response response) - { - _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); - } - - internal HybridDataArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) - { - var nextLinkOperation = NextLinkOperationImplementation.Create(source, pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); - _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "HybridDataArmOperation", fallbackStrategy: new SequentialDelayStrategy()); - } - - /// -#pragma warning disable CA1822 - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public override string Id => throw new NotImplementedException(); -#pragma warning restore CA1822 - - /// - public override T Value => _operation.Value; - - /// - public override bool HasValue => _operation.HasValue; - - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// - public override Response GetRawResponse() => _operation.RawResponse; - - /// - public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - - /// - public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - - /// - public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); - - /// - public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); - - /// - public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); - - /// - public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataJobDefinitionOperationSource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataJobDefinitionOperationSource.cs deleted file mode 100644 index 862c24b1b3ae..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataJobDefinitionOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - internal class HybridDataJobDefinitionOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal HybridDataJobDefinitionOperationSource(ArmClient client) - { - _client = client; - } - - HybridDataJobDefinitionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(document.RootElement); - return new HybridDataJobDefinitionResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(document.RootElement); - return new HybridDataJobDefinitionResource(_client, data); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataManagerOperationSource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataManagerOperationSource.cs deleted file mode 100644 index f996c7486401..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataManagerOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - internal class HybridDataManagerOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal HybridDataManagerOperationSource(ArmClient client) - { - _client = client; - } - - HybridDataManagerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = HybridDataManagerData.DeserializeHybridDataManagerData(document.RootElement); - return new HybridDataManagerResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = HybridDataManagerData.DeserializeHybridDataManagerData(document.RootElement); - return new HybridDataManagerResource(_client, data); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataStoreOperationSource.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataStoreOperationSource.cs deleted file mode 100644 index 710c978c2d77..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/LongRunningOperation/HybridDataStoreOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridData -{ - internal class HybridDataStoreOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal HybridDataStoreOperationSource(ArmClient client) - { - _client = client; - } - - HybridDataStoreResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = HybridDataStoreData.DeserializeHybridDataStoreData(document.RootElement); - return new HybridDataStoreResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = HybridDataStoreData.DeserializeHybridDataStoreData(document.RootElement); - return new HybridDataStoreResource(_client, data); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataManagerList.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataManagerList.Serialization.cs deleted file mode 100644 index 676af736af25..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataManagerList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal partial class DataManagerList - { - internal static DataManagerList DeserializeDataManagerList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataManagerData.DeserializeHybridDataManagerData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DataManagerList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataManagerList.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataManagerList.cs deleted file mode 100644 index daf5a3a9f41d..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataManagerList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// DataManager resources Collection. - internal partial class DataManagerList - { - /// Initializes a new instance of DataManagerList. - internal DataManagerList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of DataManagerList. - /// List of data manager resources. - /// Link for the next set of data stores. - internal DataManagerList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of data manager resources. - public IReadOnlyList Value { get; } - /// Link for the next set of data stores. - public string NextLink { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataServiceList.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataServiceList.Serialization.cs deleted file mode 100644 index afb53d34c668..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataServiceList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal partial class DataServiceList - { - internal static DataServiceList DeserializeDataServiceList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataServiceData.DeserializeHybridDataServiceData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DataServiceList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataServiceList.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataServiceList.cs deleted file mode 100644 index 221c19d99dfc..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataServiceList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Data Service Collection. - internal partial class DataServiceList - { - /// Initializes a new instance of DataServiceList. - internal DataServiceList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of DataServiceList. - /// List of data services. - /// Link for the next set of data services. - internal DataServiceList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of data services. - public IReadOnlyList Value { get; } - /// Link for the next set of data services. - public string NextLink { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreList.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreList.Serialization.cs deleted file mode 100644 index 35044e903dcb..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal partial class DataStoreList - { - internal static DataStoreList DeserializeDataStoreList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataStoreData.DeserializeHybridDataStoreData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DataStoreList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreList.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreList.cs deleted file mode 100644 index 84a872caea26..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Data Store Collection. - internal partial class DataStoreList - { - /// Initializes a new instance of DataStoreList. - internal DataStoreList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of DataStoreList. - /// List of data stores. - /// Link for the next set of data stores. - internal DataStoreList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of data stores. - public IReadOnlyList Value { get; } - /// Link for the next set of data stores. - public string NextLink { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreTypeList.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreTypeList.Serialization.cs deleted file mode 100644 index e58108b8cbad..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreTypeList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal partial class DataStoreTypeList - { - internal static DataStoreTypeList DeserializeDataStoreTypeList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataStoreTypeData.DeserializeHybridDataStoreTypeData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DataStoreTypeList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreTypeList.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreTypeList.cs deleted file mode 100644 index 67b9f08f0514..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/DataStoreTypeList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Data Store Type Collection. - internal partial class DataStoreTypeList - { - /// Initializes a new instance of DataStoreTypeList. - internal DataStoreTypeList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of DataStoreTypeList. - /// List of DataStoreType. - /// Link for the next set of data store types. - internal DataStoreTypeList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of DataStoreType. - public IReadOnlyList Value { get; } - /// Link for the next set of data store types. - public string NextLink { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataCustomerSecret.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataCustomerSecret.Serialization.cs deleted file mode 100644 index 15054eecce99..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataCustomerSecret.Serialization.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - public partial class HybridDataCustomerSecret : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("keyIdentifier"u8); - writer.WriteStringValue(KeyIdentifier); - writer.WritePropertyName("keyValue"u8); - writer.WriteStringValue(KeyValue); - writer.WritePropertyName("algorithm"u8); - writer.WriteStringValue(Algorithm.ToSerialString()); - writer.WriteEndObject(); - } - - internal static HybridDataCustomerSecret DeserializeHybridDataCustomerSecret(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string keyIdentifier = default; - string keyValue = default; - SupportedEncryptionAlgorithm algorithm = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keyIdentifier"u8)) - { - keyIdentifier = property.Value.GetString(); - continue; - } - if (property.NameEquals("keyValue"u8)) - { - keyValue = property.Value.GetString(); - continue; - } - if (property.NameEquals("algorithm"u8)) - { - algorithm = property.Value.GetString().ToSupportedEncryptionAlgorithm(); - continue; - } - } - return new HybridDataCustomerSecret(keyIdentifier, keyValue, algorithm); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataCustomerSecret.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataCustomerSecret.cs deleted file mode 100644 index b32035b832bc..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataCustomerSecret.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// The pair of customer secret. - public partial class HybridDataCustomerSecret - { - /// Initializes a new instance of HybridDataCustomerSecret. - /// The identifier to the data service input object which this secret corresponds to. - /// It contains the encrypted customer secret. - /// The encryption algorithm used to encrypt data. - /// or is null. - public HybridDataCustomerSecret(string keyIdentifier, string keyValue, SupportedEncryptionAlgorithm algorithm) - { - Argument.AssertNotNull(keyIdentifier, nameof(keyIdentifier)); - Argument.AssertNotNull(keyValue, nameof(keyValue)); - - KeyIdentifier = keyIdentifier; - KeyValue = keyValue; - Algorithm = algorithm; - } - - /// The identifier to the data service input object which this secret corresponds to. - public string KeyIdentifier { get; set; } - /// It contains the encrypted customer secret. - public string KeyValue { get; set; } - /// The encryption algorithm used to encrypt data. - public SupportedEncryptionAlgorithm Algorithm { get; set; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataEncryptionKey.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataEncryptionKey.Serialization.cs deleted file mode 100644 index 44747aba5536..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataEncryptionKey.Serialization.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - public partial class HybridDataEncryptionKey : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("keyModulus"u8); - writer.WriteStringValue(KeyModulus); - writer.WritePropertyName("keyExponent"u8); - writer.WriteStringValue(KeyExponent); - writer.WritePropertyName("encryptionChunkSizeInBytes"u8); - writer.WriteNumberValue(EncryptionChunkSizeInBytes); - writer.WriteEndObject(); - } - - internal static HybridDataEncryptionKey DeserializeHybridDataEncryptionKey(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string keyModulus = default; - string keyExponent = default; - int encryptionChunkSizeInBytes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keyModulus"u8)) - { - keyModulus = property.Value.GetString(); - continue; - } - if (property.NameEquals("keyExponent"u8)) - { - keyExponent = property.Value.GetString(); - continue; - } - if (property.NameEquals("encryptionChunkSizeInBytes"u8)) - { - encryptionChunkSizeInBytes = property.Value.GetInt32(); - continue; - } - } - return new HybridDataEncryptionKey(keyModulus, keyExponent, encryptionChunkSizeInBytes); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataEncryptionKey.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataEncryptionKey.cs deleted file mode 100644 index b80836c383dc..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataEncryptionKey.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Encryption Key. - public partial class HybridDataEncryptionKey - { - /// Initializes a new instance of HybridDataEncryptionKey. - /// Modulus of the encryption key. - /// Exponent of the encryption key. - /// The maximum byte size that can be encrypted by the key. For a key size larger than the size, break into chunks and encrypt each chunk, append each encrypted chunk with : to mark the end of the chunk. - /// or is null. - public HybridDataEncryptionKey(string keyModulus, string keyExponent, int encryptionChunkSizeInBytes) - { - Argument.AssertNotNull(keyModulus, nameof(keyModulus)); - Argument.AssertNotNull(keyExponent, nameof(keyExponent)); - - KeyModulus = keyModulus; - KeyExponent = keyExponent; - EncryptionChunkSizeInBytes = encryptionChunkSizeInBytes; - } - - /// Modulus of the encryption key. - public string KeyModulus { get; set; } - /// Exponent of the encryption key. - public string KeyExponent { get; set; } - /// The maximum byte size that can be encrypted by the key. For a key size larger than the size, break into chunks and encrypt each chunk, append each encrypted chunk with : to mark the end of the chunk. - public int EncryptionChunkSizeInBytes { get; set; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobData.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobData.Serialization.cs deleted file mode 100644 index a7894fd13cd7..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobData.Serialization.cs +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - public partial class HybridDataJobData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToSerialString()); - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartOn, "O"); - if (Optional.IsDefined(EndOn)) - { - writer.WritePropertyName("endTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - if (Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("isCancellable"u8); - writer.WriteStringValue(IsCancellable.ToSerialString()); - if (Optional.IsDefined(BytesProcessed)) - { - writer.WritePropertyName("bytesProcessed"u8); - writer.WriteNumberValue(BytesProcessed.Value); - } - if (Optional.IsDefined(ItemsProcessed)) - { - writer.WritePropertyName("itemsProcessed"u8); - writer.WriteNumberValue(ItemsProcessed.Value); - } - if (Optional.IsDefined(TotalBytesToProcess)) - { - writer.WritePropertyName("totalBytesToProcess"u8); - writer.WriteNumberValue(TotalBytesToProcess.Value); - } - if (Optional.IsDefined(TotalItemsToProcess)) - { - writer.WritePropertyName("totalItemsToProcess"u8); - writer.WriteNumberValue(TotalItemsToProcess.Value); - } - if (Optional.IsDefined(Details)) - { - writer.WritePropertyName("details"u8); - writer.WriteObjectValue(Details); - } - if (Optional.IsDefined(DataSourceName)) - { - writer.WritePropertyName("dataSourceName"u8); - writer.WriteStringValue(DataSourceName); - } - if (Optional.IsDefined(DataSinkName)) - { - writer.WritePropertyName("dataSinkName"u8); - writer.WriteStringValue(DataSinkName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HybridDataJobData DeserializeHybridDataJobData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - HybridDataJobStatus status = default; - DateTimeOffset startTime = default; - Optional endTime = default; - Optional error = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - JobCancellationSetting isCancellable = default; - Optional bytesProcessed = default; - Optional itemsProcessed = default; - Optional totalBytesToProcess = default; - Optional totalItemsToProcess = default; - Optional details = default; - Optional dataSourceName = default; - Optional dataSinkName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status"u8)) - { - status = property.Value.GetString().ToHybridDataJobStatus(); - continue; - } - if (property.NameEquals("startTime"u8)) - { - startTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("endTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - endTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = HybridDataJobTopLevelError.DeserializeHybridDataJobTopLevelError(property.Value); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("isCancellable"u8)) - { - isCancellable = property0.Value.GetString().ToJobCancellationSetting(); - continue; - } - if (property0.NameEquals("bytesProcessed"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - bytesProcessed = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("itemsProcessed"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - itemsProcessed = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("totalBytesToProcess"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - totalBytesToProcess = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("totalItemsToProcess"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - totalItemsToProcess = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("details"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - details = HybridDataJobDetails.DeserializeHybridDataJobDetails(property0.Value); - continue; - } - if (property0.NameEquals("dataSourceName"u8)) - { - dataSourceName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("dataSinkName"u8)) - { - dataSinkName = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new HybridDataJobData(id, name, type, systemData.Value, status, startTime, Optional.ToNullable(endTime), error.Value, isCancellable, Optional.ToNullable(bytesProcessed), Optional.ToNullable(itemsProcessed), Optional.ToNullable(totalBytesToProcess), Optional.ToNullable(totalItemsToProcess), details.Value, dataSourceName.Value, dataSinkName.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobDefinitionData.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobDefinitionData.Serialization.cs deleted file mode 100644 index dcb9a37993c4..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobDefinitionData.Serialization.cs +++ /dev/null @@ -1,218 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - public partial class HybridDataJobDefinitionData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("dataSourceId"u8); - writer.WriteStringValue(DataSourceId); - writer.WritePropertyName("dataSinkId"u8); - writer.WriteStringValue(DataSinkId); - if (Optional.IsCollectionDefined(Schedules)) - { - writer.WritePropertyName("schedules"u8); - writer.WriteStartArray(); - foreach (var item in Schedules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToSerialString()); - if (Optional.IsDefined(LastModifiedOn)) - { - writer.WritePropertyName("lastModifiedTime"u8); - writer.WriteStringValue(LastModifiedOn.Value, "O"); - } - if (Optional.IsDefined(RunLocation)) - { - writer.WritePropertyName("runLocation"u8); - writer.WriteStringValue(RunLocation.Value.ToSerialString()); - } - if (Optional.IsDefined(UserConfirmation)) - { - writer.WritePropertyName("userConfirmation"u8); - writer.WriteStringValue(UserConfirmation.Value.ToSerialString()); - } - if (Optional.IsDefined(DataServiceInput)) - { - writer.WritePropertyName("dataServiceInput"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(DataServiceInput); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(DataServiceInput.ToString()).RootElement); -#endif - } - if (Optional.IsCollectionDefined(CustomerSecrets)) - { - writer.WritePropertyName("customerSecrets"u8); - writer.WriteStartArray(); - foreach (var item in CustomerSecrets) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HybridDataJobDefinitionData DeserializeHybridDataJobDefinitionData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - string dataSourceId = default; - string dataSinkId = default; - Optional> schedules = default; - HybridDataState state = default; - Optional lastModifiedTime = default; - Optional runLocation = default; - Optional userConfirmation = default; - Optional dataServiceInput = default; - Optional> customerSecrets = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("dataSourceId"u8)) - { - dataSourceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("dataSinkId"u8)) - { - dataSinkId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("schedules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(HybridDataJobRunSchedule.DeserializeHybridDataJobRunSchedule(item)); - } - schedules = array; - continue; - } - if (property0.NameEquals("state"u8)) - { - state = property0.Value.GetString().ToHybridDataState(); - continue; - } - if (property0.NameEquals("lastModifiedTime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastModifiedTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("runLocation"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - runLocation = property0.Value.GetString().ToHybridDataJobRunLocation(); - continue; - } - if (property0.NameEquals("userConfirmation"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - userConfirmation = property0.Value.GetString().ToUserConfirmationSetting(); - continue; - } - if (property0.NameEquals("dataServiceInput"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - dataServiceInput = BinaryData.FromString(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("customerSecrets"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(HybridDataCustomerSecret.DeserializeHybridDataCustomerSecret(item)); - } - customerSecrets = array; - continue; - } - } - continue; - } - } - return new HybridDataJobDefinitionData(id, name, type, systemData.Value, dataSourceId, dataSinkId, Optional.ToList(schedules), state, Optional.ToNullable(lastModifiedTime), Optional.ToNullable(runLocation), Optional.ToNullable(userConfirmation), dataServiceInput.Value, Optional.ToList(customerSecrets)); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobDetails.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobDetails.Serialization.cs deleted file mode 100644 index e6e67a652768..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobDetails.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - public partial class HybridDataJobDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(JobStages)) - { - writer.WritePropertyName("jobStages"u8); - writer.WriteStartArray(); - foreach (var item in JobStages) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(JobDefinition)) - { - writer.WritePropertyName("jobDefinition"u8); - writer.WriteObjectValue(JobDefinition); - } - if (Optional.IsCollectionDefined(ErrorDetails)) - { - writer.WritePropertyName("errorDetails"u8); - writer.WriteStartArray(); - foreach (var item in ErrorDetails) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ItemDetailsLink)) - { - writer.WritePropertyName("itemDetailsLink"u8); - writer.WriteStringValue(ItemDetailsLink); - } - writer.WriteEndObject(); - } - - internal static HybridDataJobDetails DeserializeHybridDataJobDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> jobStages = default; - Optional jobDefinition = default; - Optional> errorDetails = default; - Optional itemDetailsLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("jobStages"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataJobStage.DeserializeHybridDataJobStage(item)); - } - jobStages = array; - continue; - } - if (property.NameEquals("jobDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - jobDefinition = HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(property.Value); - continue; - } - if (property.NameEquals("errorDetails"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataJobErrorDetails.DeserializeHybridDataJobErrorDetails(item)); - } - errorDetails = array; - continue; - } - if (property.NameEquals("itemDetailsLink"u8)) - { - itemDetailsLink = property.Value.GetString(); - continue; - } - } - return new HybridDataJobDetails(Optional.ToList(jobStages), jobDefinition.Value, Optional.ToList(errorDetails), itemDetailsLink.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobDetails.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobDetails.cs deleted file mode 100644 index 8eb3bbb64df0..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobDetails.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Job details. - public partial class HybridDataJobDetails - { - /// Initializes a new instance of HybridDataJobDetails. - public HybridDataJobDetails() - { - JobStages = new ChangeTrackingList(); - ErrorDetails = new ChangeTrackingList(); - } - - /// Initializes a new instance of HybridDataJobDetails. - /// List of stages that ran in the job. - /// JobDefinition at the time of the run. - /// Error details for failure. This is optional. - /// Item Details Link to download files or see details. - internal HybridDataJobDetails(IList jobStages, HybridDataJobDefinitionData jobDefinition, IList errorDetails, string itemDetailsLink) - { - JobStages = jobStages; - JobDefinition = jobDefinition; - ErrorDetails = errorDetails; - ItemDetailsLink = itemDetailsLink; - } - - /// List of stages that ran in the job. - public IList JobStages { get; } - /// JobDefinition at the time of the run. - public HybridDataJobDefinitionData JobDefinition { get; set; } - /// Error details for failure. This is optional. - public IList ErrorDetails { get; } - /// Item Details Link to download files or see details. - public string ItemDetailsLink { get; set; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobErrorDetails.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobErrorDetails.Serialization.cs deleted file mode 100644 index 70d90486633a..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobErrorDetails.Serialization.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - public partial class HybridDataJobErrorDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ErrorMessage)) - { - writer.WritePropertyName("errorMessage"u8); - writer.WriteStringValue(ErrorMessage); - } - if (Optional.IsDefined(ErrorCode)) - { - writer.WritePropertyName("errorCode"u8); - writer.WriteNumberValue(ErrorCode.Value); - } - if (Optional.IsDefined(RecommendedAction)) - { - writer.WritePropertyName("recommendedAction"u8); - writer.WriteStringValue(RecommendedAction); - } - if (Optional.IsDefined(ExceptionMessage)) - { - writer.WritePropertyName("exceptionMessage"u8); - writer.WriteStringValue(ExceptionMessage); - } - writer.WriteEndObject(); - } - - internal static HybridDataJobErrorDetails DeserializeHybridDataJobErrorDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional errorMessage = default; - Optional errorCode = default; - Optional recommendedAction = default; - Optional exceptionMessage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("errorMessage"u8)) - { - errorMessage = property.Value.GetString(); - continue; - } - if (property.NameEquals("errorCode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - errorCode = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("recommendedAction"u8)) - { - recommendedAction = property.Value.GetString(); - continue; - } - if (property.NameEquals("exceptionMessage"u8)) - { - exceptionMessage = property.Value.GetString(); - continue; - } - } - return new HybridDataJobErrorDetails(errorMessage.Value, Optional.ToNullable(errorCode), recommendedAction.Value, exceptionMessage.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobErrorDetails.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobErrorDetails.cs deleted file mode 100644 index 6d597fef82d9..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobErrorDetails.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Error Details. - public partial class HybridDataJobErrorDetails - { - /// Initializes a new instance of HybridDataJobErrorDetails. - public HybridDataJobErrorDetails() - { - } - - /// Initializes a new instance of HybridDataJobErrorDetails. - /// Error message. - /// Error code. - /// Recommended action for the error. - /// Contains the non localized exception message. - internal HybridDataJobErrorDetails(string errorMessage, int? errorCode, string recommendedAction, string exceptionMessage) - { - ErrorMessage = errorMessage; - ErrorCode = errorCode; - RecommendedAction = recommendedAction; - ExceptionMessage = exceptionMessage; - } - - /// Error message. - public string ErrorMessage { get; set; } - /// Error code. - public int? ErrorCode { get; set; } - /// Recommended action for the error. - public string RecommendedAction { get; set; } - /// Contains the non localized exception message. - public string ExceptionMessage { get; set; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunContent.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunContent.Serialization.cs deleted file mode 100644 index 43814e90940e..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunContent.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - public partial class HybridDataJobRunContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(UserConfirmation)) - { - writer.WritePropertyName("userConfirmation"u8); - writer.WriteStringValue(UserConfirmation.Value.ToSerialString()); - } - if (Optional.IsDefined(DataServiceInput)) - { - writer.WritePropertyName("dataServiceInput"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(DataServiceInput); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(DataServiceInput.ToString()).RootElement); -#endif - } - if (Optional.IsCollectionDefined(CustomerSecrets)) - { - writer.WritePropertyName("customerSecrets"u8); - writer.WriteStartArray(); - foreach (var item in CustomerSecrets) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunContent.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunContent.cs deleted file mode 100644 index c88e2a1ae0d6..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunContent.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Run parameters for a job. - public partial class HybridDataJobRunContent - { - /// Initializes a new instance of HybridDataJobRunContent. - public HybridDataJobRunContent() - { - CustomerSecrets = new ChangeTrackingList(); - } - - /// Enum to detect if user confirmation is required. If not passed will default to NotRequired. - public UserConfirmationSetting? UserConfirmation { get; set; } - /// - /// A generic json used differently by each data service type. - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData DataServiceInput { get; set; } - /// List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys. - public IList CustomerSecrets { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunLocation.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunLocation.Serialization.cs deleted file mode 100644 index 1f63b752fb35..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunLocation.Serialization.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal static partial class HybridDataJobRunLocationExtensions - { - public static string ToSerialString(this HybridDataJobRunLocation value) => value switch - { - HybridDataJobRunLocation.None => "none", - HybridDataJobRunLocation.AustraliaEast => "australiaeast", - HybridDataJobRunLocation.AustraliaSoutheast => "australiasoutheast", - HybridDataJobRunLocation.BrazilSouth => "brazilsouth", - HybridDataJobRunLocation.CanadaCentral => "canadacentral", - HybridDataJobRunLocation.CanadaEast => "canadaeast", - HybridDataJobRunLocation.CentralIndia => "centralindia", - HybridDataJobRunLocation.CentralUS => "centralus", - HybridDataJobRunLocation.EastAsia => "eastasia", - HybridDataJobRunLocation.EastUS => "eastus", - HybridDataJobRunLocation.EastUS2 => "eastus2", - HybridDataJobRunLocation.JapanEast => "japaneast", - HybridDataJobRunLocation.JapanWest => "japanwest", - HybridDataJobRunLocation.KoreaCentral => "koreacentral", - HybridDataJobRunLocation.KoreaSouth => "koreasouth", - HybridDataJobRunLocation.SoutheastAsia => "southeastasia", - HybridDataJobRunLocation.SouthCentralUS => "southcentralus", - HybridDataJobRunLocation.SouthIndia => "southindia", - HybridDataJobRunLocation.NorthCentralUS => "northcentralus", - HybridDataJobRunLocation.NorthEurope => "northeurope", - HybridDataJobRunLocation.UKSouth => "uksouth", - HybridDataJobRunLocation.UKWest => "ukwest", - HybridDataJobRunLocation.WestCentralUS => "westcentralus", - HybridDataJobRunLocation.WestEurope => "westeurope", - HybridDataJobRunLocation.WestIndia => "westindia", - HybridDataJobRunLocation.WestUS => "westus", - HybridDataJobRunLocation.WestUS2 => "westus2", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HybridDataJobRunLocation value.") - }; - - public static HybridDataJobRunLocation ToHybridDataJobRunLocation(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "none")) return HybridDataJobRunLocation.None; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "australiaeast")) return HybridDataJobRunLocation.AustraliaEast; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "australiasoutheast")) return HybridDataJobRunLocation.AustraliaSoutheast; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "brazilsouth")) return HybridDataJobRunLocation.BrazilSouth; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "canadacentral")) return HybridDataJobRunLocation.CanadaCentral; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "canadaeast")) return HybridDataJobRunLocation.CanadaEast; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "centralindia")) return HybridDataJobRunLocation.CentralIndia; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "centralus")) return HybridDataJobRunLocation.CentralUS; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "eastasia")) return HybridDataJobRunLocation.EastAsia; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "eastus")) return HybridDataJobRunLocation.EastUS; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "eastus2")) return HybridDataJobRunLocation.EastUS2; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "japaneast")) return HybridDataJobRunLocation.JapanEast; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "japanwest")) return HybridDataJobRunLocation.JapanWest; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "koreacentral")) return HybridDataJobRunLocation.KoreaCentral; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "koreasouth")) return HybridDataJobRunLocation.KoreaSouth; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "southeastasia")) return HybridDataJobRunLocation.SoutheastAsia; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "southcentralus")) return HybridDataJobRunLocation.SouthCentralUS; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "southindia")) return HybridDataJobRunLocation.SouthIndia; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "northcentralus")) return HybridDataJobRunLocation.NorthCentralUS; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "northeurope")) return HybridDataJobRunLocation.NorthEurope; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "uksouth")) return HybridDataJobRunLocation.UKSouth; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "ukwest")) return HybridDataJobRunLocation.UKWest; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "westcentralus")) return HybridDataJobRunLocation.WestCentralUS; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "westeurope")) return HybridDataJobRunLocation.WestEurope; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "westindia")) return HybridDataJobRunLocation.WestIndia; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "westus")) return HybridDataJobRunLocation.WestUS; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "westus2")) return HybridDataJobRunLocation.WestUS2; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HybridDataJobRunLocation value."); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunLocation.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunLocation.cs deleted file mode 100644 index 7ed71614597c..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunLocation.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridData.Models -{ - /// This is the preferred geo location for the job to run. - public enum HybridDataJobRunLocation - { - /// none. - None, - /// australiaeast. - AustraliaEast, - /// australiasoutheast. - AustraliaSoutheast, - /// brazilsouth. - BrazilSouth, - /// canadacentral. - CanadaCentral, - /// canadaeast. - CanadaEast, - /// centralindia. - CentralIndia, - /// centralus. - CentralUS, - /// eastasia. - EastAsia, - /// eastus. - EastUS, - /// eastus2. - EastUS2, - /// japaneast. - JapanEast, - /// japanwest. - JapanWest, - /// koreacentral. - KoreaCentral, - /// koreasouth. - KoreaSouth, - /// southeastasia. - SoutheastAsia, - /// southcentralus. - SouthCentralUS, - /// southindia. - SouthIndia, - /// northcentralus. - NorthCentralUS, - /// northeurope. - NorthEurope, - /// uksouth. - UKSouth, - /// ukwest. - UKWest, - /// westcentralus. - WestCentralUS, - /// westeurope. - WestEurope, - /// westindia. - WestIndia, - /// westus. - WestUS, - /// westus2. - WestUS2 - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunSchedule.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunSchedule.Serialization.cs deleted file mode 100644 index d7c1274dffe3..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunSchedule.Serialization.cs +++ /dev/null @@ -1,70 +0,0 @@ -// 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.ResourceManager.HybridData.Models -{ - public partial class HybridDataJobRunSchedule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsCollectionDefined(PolicyList)) - { - writer.WritePropertyName("policyList"u8); - writer.WriteStartArray(); - foreach (var item in PolicyList) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static HybridDataJobRunSchedule DeserializeHybridDataJobRunSchedule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional name = default; - Optional> policyList = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("policyList"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - policyList = array; - continue; - } - } - return new HybridDataJobRunSchedule(name.Value, Optional.ToList(policyList)); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunSchedule.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunSchedule.cs deleted file mode 100644 index d2cb34c29864..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobRunSchedule.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Schedule for the job run. - public partial class HybridDataJobRunSchedule - { - /// Initializes a new instance of HybridDataJobRunSchedule. - public HybridDataJobRunSchedule() - { - PolicyList = new ChangeTrackingList(); - } - - /// Initializes a new instance of HybridDataJobRunSchedule. - /// Name of the schedule. - /// A list of repetition intervals in ISO 8601 format. - internal HybridDataJobRunSchedule(string name, IList policyList) - { - Name = name; - PolicyList = policyList; - } - - /// Name of the schedule. - public string Name { get; set; } - /// A list of repetition intervals in ISO 8601 format. - public IList PolicyList { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStage.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStage.Serialization.cs deleted file mode 100644 index 13ae5591686e..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStage.Serialization.cs +++ /dev/null @@ -1,98 +0,0 @@ -// 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.ResourceManager.HybridData.Models -{ - public partial class HybridDataJobStage : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(StageName)) - { - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName); - } - writer.WritePropertyName("stageStatus"u8); - writer.WriteStringValue(StageStatus.ToSerialString()); - if (Optional.IsDefined(JobStageDetails)) - { - writer.WritePropertyName("jobStageDetails"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(JobStageDetails); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(JobStageDetails.ToString()).RootElement); -#endif - } - if (Optional.IsCollectionDefined(ErrorDetails)) - { - writer.WritePropertyName("errorDetails"u8); - writer.WriteStartArray(); - foreach (var item in ErrorDetails) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static HybridDataJobStage DeserializeHybridDataJobStage(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional stageName = default; - HybridDataJobStatus stageStatus = default; - Optional jobStageDetails = default; - Optional> errorDetails = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("stageName"u8)) - { - stageName = property.Value.GetString(); - continue; - } - if (property.NameEquals("stageStatus"u8)) - { - stageStatus = property.Value.GetString().ToHybridDataJobStatus(); - continue; - } - if (property.NameEquals("jobStageDetails"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - jobStageDetails = BinaryData.FromString(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("errorDetails"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataJobErrorDetails.DeserializeHybridDataJobErrorDetails(item)); - } - errorDetails = array; - continue; - } - } - return new HybridDataJobStage(stageName.Value, stageStatus, jobStageDetails.Value, Optional.ToList(errorDetails)); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStage.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStage.cs deleted file mode 100644 index ab994aa4860f..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStage.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Job stages. - public partial class HybridDataJobStage - { - /// Initializes a new instance of HybridDataJobStage. - /// Status of the job stage. - public HybridDataJobStage(HybridDataJobStatus stageStatus) - { - StageStatus = stageStatus; - ErrorDetails = new ChangeTrackingList(); - } - - /// Initializes a new instance of HybridDataJobStage. - /// Name of the job stage. - /// Status of the job stage. - /// Job Stage Details. - /// Error details for the stage. This is optional. - internal HybridDataJobStage(string stageName, HybridDataJobStatus stageStatus, BinaryData jobStageDetails, IList errorDetails) - { - StageName = stageName; - StageStatus = stageStatus; - JobStageDetails = jobStageDetails; - ErrorDetails = errorDetails; - } - - /// Name of the job stage. - public string StageName { get; set; } - /// Status of the job stage. - public HybridDataJobStatus StageStatus { get; set; } - /// - /// Job Stage Details - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData JobStageDetails { get; set; } - /// Error details for the stage. This is optional. - public IList ErrorDetails { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStatus.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStatus.Serialization.cs deleted file mode 100644 index e80e3020a02e..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStatus.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal static partial class HybridDataJobStatusExtensions - { - public static string ToSerialString(this HybridDataJobStatus value) => value switch - { - HybridDataJobStatus.None => "None", - HybridDataJobStatus.InProgress => "InProgress", - HybridDataJobStatus.Succeeded => "Succeeded", - HybridDataJobStatus.WaitingForAction => "WaitingForAction", - HybridDataJobStatus.Failed => "Failed", - HybridDataJobStatus.Cancelled => "Cancelled", - HybridDataJobStatus.Cancelling => "Cancelling", - HybridDataJobStatus.PartiallySucceeded => "PartiallySucceeded", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HybridDataJobStatus value.") - }; - - public static HybridDataJobStatus ToHybridDataJobStatus(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return HybridDataJobStatus.None; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "InProgress")) return HybridDataJobStatus.InProgress; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Succeeded")) return HybridDataJobStatus.Succeeded; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "WaitingForAction")) return HybridDataJobStatus.WaitingForAction; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Failed")) return HybridDataJobStatus.Failed; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Cancelled")) return HybridDataJobStatus.Cancelled; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Cancelling")) return HybridDataJobStatus.Cancelling; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "PartiallySucceeded")) return HybridDataJobStatus.PartiallySucceeded; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HybridDataJobStatus value."); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStatus.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStatus.cs deleted file mode 100644 index ceb0d529bd6e..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobStatus.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Status of the job. - public enum HybridDataJobStatus - { - /// None. - None, - /// InProgress. - InProgress, - /// Succeeded. - Succeeded, - /// WaitingForAction. - WaitingForAction, - /// Failed. - Failed, - /// Cancelled. - Cancelled, - /// Cancelling. - Cancelling, - /// PartiallySucceeded. - PartiallySucceeded - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobTopLevelError.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobTopLevelError.Serialization.cs deleted file mode 100644 index 8f67bf5f33a0..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobTopLevelError.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - public partial class HybridDataJobTopLevelError : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - } - writer.WriteEndObject(); - } - - internal static HybridDataJobTopLevelError DeserializeHybridDataJobTopLevelError(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - Optional message = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - } - return new HybridDataJobTopLevelError(code, message.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobTopLevelError.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobTopLevelError.cs deleted file mode 100644 index e8133c06441f..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataJobTopLevelError.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Top level error for the job. - public partial class HybridDataJobTopLevelError - { - /// Initializes a new instance of HybridDataJobTopLevelError. - /// Error code that can be used to programmatically identify the error. - /// is null. - public HybridDataJobTopLevelError(string code) - { - Argument.AssertNotNull(code, nameof(code)); - - Code = code; - } - - /// Initializes a new instance of HybridDataJobTopLevelError. - /// Error code that can be used to programmatically identify the error. - /// Describes the error in detail and provides debugging information. - internal HybridDataJobTopLevelError(string code, string message) - { - Code = code; - Message = message; - } - - /// Error code that can be used to programmatically identify the error. - public string Code { get; set; } - /// Describes the error in detail and provides debugging information. - public string Message { get; set; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataManagerData.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataManagerData.Serialization.cs deleted file mode 100644 index 7461a04dca85..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataManagerData.Serialization.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - public partial class HybridDataManagerData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ETag)) - { - writer.WritePropertyName("etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); - } - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"u8); - writer.WriteObjectValue(Sku); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - writer.WriteEndObject(); - } - - internal static HybridDataManagerData DeserializeHybridDataManagerData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional etag = default; - Optional sku = default; - Optional> tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("etag"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); - continue; - } - if (property.NameEquals("sku"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sku = HybridDataSku.DeserializeHybridDataSku(property.Value); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new HybridDataManagerData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(etag), sku.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataManagerPatch.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataManagerPatch.Serialization.cs deleted file mode 100644 index fd7eee4e314d..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataManagerPatch.Serialization.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - public partial class HybridDataManagerPatch : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"u8); - writer.WriteObjectValue(Sku); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataManagerPatch.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataManagerPatch.cs deleted file mode 100644 index 93e735fb0322..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataManagerPatch.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// The DataManagerUpdateParameter. - public partial class HybridDataManagerPatch - { - /// Initializes a new instance of HybridDataManagerPatch. - public HybridDataManagerPatch() - { - Tags = new ChangeTrackingDictionary(); - } - - /// The sku type. - public HybridDataSku Sku { get; set; } - /// - /// The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource - /// (across resource groups). - /// - public IDictionary Tags { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataPublicKeyData.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataPublicKeyData.Serialization.cs deleted file mode 100644 index dcdfca19b730..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataPublicKeyData.Serialization.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - public partial class HybridDataPublicKeyData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("dataServiceLevel1Key"u8); - writer.WriteObjectValue(DataServiceLevel1Key); - writer.WritePropertyName("dataServiceLevel2Key"u8); - writer.WriteObjectValue(DataServiceLevel2Key); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HybridDataPublicKeyData DeserializeHybridDataPublicKeyData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - HybridDataEncryptionKey dataServiceLevel1Key = default; - HybridDataEncryptionKey dataServiceLevel2Key = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("dataServiceLevel1Key"u8)) - { - dataServiceLevel1Key = HybridDataEncryptionKey.DeserializeHybridDataEncryptionKey(property0.Value); - continue; - } - if (property0.NameEquals("dataServiceLevel2Key"u8)) - { - dataServiceLevel2Key = HybridDataEncryptionKey.DeserializeHybridDataEncryptionKey(property0.Value); - continue; - } - } - continue; - } - } - return new HybridDataPublicKeyData(id, name, type, systemData.Value, dataServiceLevel1Key, dataServiceLevel2Key); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataServiceData.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataServiceData.Serialization.cs deleted file mode 100644 index 4726cb3ad233..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataServiceData.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - public partial class HybridDataServiceData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToSerialString()); - if (Optional.IsCollectionDefined(SupportedDataSinkTypes)) - { - writer.WritePropertyName("supportedDataSinkTypes"u8); - writer.WriteStartArray(); - foreach (var item in SupportedDataSinkTypes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(SupportedDataSourceTypes)) - { - writer.WritePropertyName("supportedDataSourceTypes"u8); - writer.WriteStartArray(); - foreach (var item in SupportedDataSourceTypes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HybridDataServiceData DeserializeHybridDataServiceData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - HybridDataState state = default; - Optional> supportedDataSinkTypes = default; - Optional> supportedDataSourceTypes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("state"u8)) - { - state = property0.Value.GetString().ToHybridDataState(); - continue; - } - if (property0.NameEquals("supportedDataSinkTypes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - supportedDataSinkTypes = array; - continue; - } - if (property0.NameEquals("supportedDataSourceTypes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - supportedDataSourceTypes = array; - continue; - } - } - continue; - } - } - return new HybridDataServiceData(id, name, type, systemData.Value, state, Optional.ToList(supportedDataSinkTypes), Optional.ToList(supportedDataSourceTypes)); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataSku.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataSku.Serialization.cs deleted file mode 100644 index 506e8ea0a23b..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataSku.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridData.Models -{ - public partial class HybridDataSku : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Tier)) - { - writer.WritePropertyName("tier"u8); - writer.WriteStringValue(Tier); - } - writer.WriteEndObject(); - } - - internal static HybridDataSku DeserializeHybridDataSku(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional name = default; - Optional tier = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("tier"u8)) - { - tier = property.Value.GetString(); - continue; - } - } - return new HybridDataSku(name.Value, tier.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataSku.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataSku.cs deleted file mode 100644 index 6300f739e682..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataSku.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridData.Models -{ - /// The sku type. - public partial class HybridDataSku - { - /// Initializes a new instance of HybridDataSku. - public HybridDataSku() - { - } - - /// Initializes a new instance of HybridDataSku. - /// The sku name. Required for data manager creation, optional for update. - /// The sku tier. This is based on the SKU name. - internal HybridDataSku(string name, string tier) - { - Name = name; - Tier = tier; - } - - /// The sku name. Required for data manager creation, optional for update. - public string Name { get; set; } - /// The sku tier. This is based on the SKU name. - public string Tier { get; set; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataState.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataState.Serialization.cs deleted file mode 100644 index 0b84e0bce5e9..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataState.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal static partial class HybridDataStateExtensions - { - public static string ToSerialString(this HybridDataState value) => value switch - { - HybridDataState.Disabled => "Disabled", - HybridDataState.Enabled => "Enabled", - HybridDataState.Supported => "Supported", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HybridDataState value.") - }; - - public static HybridDataState ToHybridDataState(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Disabled")) return HybridDataState.Disabled; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Enabled")) return HybridDataState.Enabled; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Supported")) return HybridDataState.Supported; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HybridDataState value."); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataState.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataState.cs deleted file mode 100644 index 2b644d302937..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataState.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridData.Models -{ - /// State of the data service. - public enum HybridDataState - { - /// Disabled. - Disabled, - /// Enabled. - Enabled, - /// Supported. - Supported - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataStoreData.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataStoreData.Serialization.cs deleted file mode 100644 index 0cd97687f9a5..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataStoreData.Serialization.cs +++ /dev/null @@ -1,155 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - public partial class HybridDataStoreData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(RepositoryId)) - { - writer.WritePropertyName("repositoryId"u8); - writer.WriteStringValue(RepositoryId); - } - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToSerialString()); - if (Optional.IsDefined(ExtendedProperties)) - { - writer.WritePropertyName("extendedProperties"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(ExtendedProperties); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(ExtendedProperties.ToString()).RootElement); -#endif - } - writer.WritePropertyName("dataStoreTypeId"u8); - writer.WriteStringValue(DataStoreTypeId); - if (Optional.IsCollectionDefined(CustomerSecrets)) - { - writer.WritePropertyName("customerSecrets"u8); - writer.WriteStartArray(); - foreach (var item in CustomerSecrets) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HybridDataStoreData DeserializeHybridDataStoreData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional repositoryId = default; - HybridDataState state = default; - Optional extendedProperties = default; - ResourceIdentifier dataStoreTypeId = default; - Optional> customerSecrets = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("repositoryId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - repositoryId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("state"u8)) - { - state = property0.Value.GetString().ToHybridDataState(); - continue; - } - if (property0.NameEquals("extendedProperties"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - extendedProperties = BinaryData.FromString(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("dataStoreTypeId"u8)) - { - dataStoreTypeId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("customerSecrets"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(HybridDataCustomerSecret.DeserializeHybridDataCustomerSecret(item)); - } - customerSecrets = array; - continue; - } - } - continue; - } - } - return new HybridDataStoreData(id, name, type, systemData.Value, repositoryId.Value, state, extendedProperties.Value, dataStoreTypeId, Optional.ToList(customerSecrets)); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataStoreTypeData.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataStoreTypeData.Serialization.cs deleted file mode 100644 index 7ce0edf1b129..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/HybridDataStoreTypeData.Serialization.cs +++ /dev/null @@ -1,152 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridData -{ - public partial class HybridDataStoreTypeData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(RepositoryType)) - { - writer.WritePropertyName("repositoryType"u8); - writer.WriteStringValue(RepositoryType.Value); - } - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToSerialString()); - if (Optional.IsCollectionDefined(SupportedDataServicesAsSink)) - { - writer.WritePropertyName("supportedDataServicesAsSink"u8); - writer.WriteStartArray(); - foreach (var item in SupportedDataServicesAsSink) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(SupportedDataServicesAsSource)) - { - writer.WritePropertyName("supportedDataServicesAsSource"u8); - writer.WriteStartArray(); - foreach (var item in SupportedDataServicesAsSource) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HybridDataStoreTypeData DeserializeHybridDataStoreTypeData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional repositoryType = default; - HybridDataState state = default; - Optional> supportedDataServicesAsSink = default; - Optional> supportedDataServicesAsSource = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("repositoryType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - repositoryType = new ResourceType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("state"u8)) - { - state = property0.Value.GetString().ToHybridDataState(); - continue; - } - if (property0.NameEquals("supportedDataServicesAsSink"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - supportedDataServicesAsSink = array; - continue; - } - if (property0.NameEquals("supportedDataServicesAsSource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - supportedDataServicesAsSource = array; - continue; - } - } - continue; - } - } - return new HybridDataStoreTypeData(id, name, type, systemData.Value, Optional.ToNullable(repositoryType), state, Optional.ToList(supportedDataServicesAsSink), Optional.ToList(supportedDataServicesAsSource)); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobCancellationSetting.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobCancellationSetting.Serialization.cs deleted file mode 100644 index f12c87b2625d..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobCancellationSetting.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal static partial class JobCancellationSettingExtensions - { - public static string ToSerialString(this JobCancellationSetting value) => value switch - { - JobCancellationSetting.NotCancellable => "NotCancellable", - JobCancellationSetting.Cancellable => "Cancellable", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobCancellationSetting value.") - }; - - public static JobCancellationSetting ToJobCancellationSetting(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "NotCancellable")) return JobCancellationSetting.NotCancellable; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Cancellable")) return JobCancellationSetting.Cancellable; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown JobCancellationSetting value."); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobCancellationSetting.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobCancellationSetting.cs deleted file mode 100644 index 03c2e58c899a..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobCancellationSetting.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Describes whether the job is cancellable. - public enum JobCancellationSetting - { - /// NotCancellable. - NotCancellable, - /// Cancellable. - Cancellable - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobDefinitionList.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobDefinitionList.Serialization.cs deleted file mode 100644 index 12c5c17b4887..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobDefinitionList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal partial class JobDefinitionList - { - internal static JobDefinitionList DeserializeJobDefinitionList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new JobDefinitionList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobDefinitionList.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobDefinitionList.cs deleted file mode 100644 index d8fb4119f4bd..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobDefinitionList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Job Definition Collection. - internal partial class JobDefinitionList - { - /// Initializes a new instance of JobDefinitionList. - internal JobDefinitionList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of JobDefinitionList. - /// List of job definitions. - /// Link for the next set of job definitions. - internal JobDefinitionList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of job definitions. - public IReadOnlyList Value { get; } - /// Link for the next set of job definitions. - public string NextLink { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobList.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobList.Serialization.cs deleted file mode 100644 index ef828b8dd40a..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal partial class JobList - { - internal static JobList DeserializeJobList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataJobData.DeserializeHybridDataJobData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new JobList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobList.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobList.cs deleted file mode 100644 index 2225499a845c..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/JobList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Job Collection. - internal partial class JobList - { - /// Initializes a new instance of JobList. - internal JobList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of JobList. - /// List of jobs. - /// Link for the next set of jobs. - internal JobList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of jobs. - public IReadOnlyList Value { get; } - /// Link for the next set of jobs. - public string NextLink { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/PublicKeyList.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/PublicKeyList.Serialization.cs deleted file mode 100644 index a67ab350f7e9..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/PublicKeyList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal partial class PublicKeyList - { - internal static PublicKeyList DeserializePublicKeyList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridDataPublicKeyData.DeserializeHybridDataPublicKeyData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new PublicKeyList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/PublicKeyList.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/PublicKeyList.cs deleted file mode 100644 index 615255c62b52..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/PublicKeyList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridData; - -namespace Azure.ResourceManager.HybridData.Models -{ - /// PublicKey Collection. - internal partial class PublicKeyList - { - /// Initializes a new instance of PublicKeyList. - internal PublicKeyList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of PublicKeyList. - /// List of public keys. - /// Link for the next set of public keys. - internal PublicKeyList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of public keys. - public IReadOnlyList Value { get; } - /// Link for the next set of public keys. - public string NextLink { get; } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/SupportedEncryptionAlgorithm.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/SupportedEncryptionAlgorithm.Serialization.cs deleted file mode 100644 index 6eb3750cb156..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/SupportedEncryptionAlgorithm.Serialization.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal static partial class SupportedEncryptionAlgorithmExtensions - { - public static string ToSerialString(this SupportedEncryptionAlgorithm value) => value switch - { - SupportedEncryptionAlgorithm.None => "None", - SupportedEncryptionAlgorithm.Rsa1_5 => "RSA1_5", - SupportedEncryptionAlgorithm.Rsa_Oaep => "RSA_OAEP", - SupportedEncryptionAlgorithm.PlainText => "PlainText", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SupportedEncryptionAlgorithm value.") - }; - - public static SupportedEncryptionAlgorithm ToSupportedEncryptionAlgorithm(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return SupportedEncryptionAlgorithm.None; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "RSA1_5")) return SupportedEncryptionAlgorithm.Rsa1_5; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "RSA_OAEP")) return SupportedEncryptionAlgorithm.Rsa_Oaep; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "PlainText")) return SupportedEncryptionAlgorithm.PlainText; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SupportedEncryptionAlgorithm value."); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/UserConfirmationSetting.Serialization.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/UserConfirmationSetting.Serialization.cs deleted file mode 100644 index d76a3048629b..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/UserConfirmationSetting.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.HybridData.Models -{ - internal static partial class UserConfirmationSettingExtensions - { - public static string ToSerialString(this UserConfirmationSetting value) => value switch - { - UserConfirmationSetting.NotRequired => "NotRequired", - UserConfirmationSetting.Required => "Required", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UserConfirmationSetting value.") - }; - - public static UserConfirmationSetting ToUserConfirmationSetting(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "NotRequired")) return UserConfirmationSetting.NotRequired; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Required")) return UserConfirmationSetting.Required; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UserConfirmationSetting value."); - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/UserConfirmationSetting.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/UserConfirmationSetting.cs deleted file mode 100644 index d98c1d709934..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/Models/UserConfirmationSetting.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridData.Models -{ - /// Enum to detect if user confirmation is required. If not passed will default to NotRequired. - public enum UserConfirmationSetting - { - /// NotRequired. - NotRequired, - /// Required. - Required - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/ProviderConstants.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/ProviderConstants.cs deleted file mode 100644 index 72e07d95db6c..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/ProviderConstants.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.HybridData -{ - internal static class ProviderConstants - { - public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataManagersRestOperations.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataManagersRestOperations.cs deleted file mode 100644 index 2b68ead9d9d8..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataManagersRestOperations.cs +++ /dev/null @@ -1,499 +0,0 @@ -// 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.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData -{ - internal partial class DataManagersRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DataManagersRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DataManagersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.HybridData/dataManagers", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the data manager resources available under the subscription. - /// The Subscription Id. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataManagerList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataManagerList.DeserializeDataManagerList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the data manager resources available under the subscription. - /// The Subscription Id. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataManagerList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataManagerList.DeserializeDataManagerList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridData/dataManagers", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the data manager resources available under the given resource group. - /// The Subscription Id. - /// The Resource Group Name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataManagerList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataManagerList.DeserializeDataManagerList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the data manager resources available under the given resource group. - /// The Subscription Id. - /// The Resource Group Name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataManagerList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataManagerList.DeserializeDataManagerList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dataManagerName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets information about the specified data manager resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridDataManagerData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridDataManagerData.DeserializeHybridDataManagerData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataManagerData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets information about the specified data manager resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridDataManagerData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridDataManagerData.DeserializeHybridDataManagerData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataManagerData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string dataManagerName, HybridDataManagerData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// - /// Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API - /// and should instead be updated with the Update data manager resource API. - /// - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Data manager resource details from request body. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string dataManagerName, HybridDataManagerData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, dataManagerName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// - /// Creates a new data manager resource with the specified parameters. Existing resources cannot be updated with this API - /// and should instead be updated with the Update data manager resource API. - /// - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Data manager resource details from request body. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string dataManagerName, HybridDataManagerData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, dataManagerName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string dataManagerName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Deletes a data manager resource in Microsoft Azure. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dataManagerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a data manager resource in Microsoft Azure. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dataManagerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string dataManagerName, HybridDataManagerPatch patch, string ifMatch) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - if (ifMatch != null) - { - request.Headers.Add("If-Match", ifMatch); - } - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates the properties of an existing data manager resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Data manager resource details from request body. - /// Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string dataManagerName, HybridDataManagerPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dataManagerName, patch, ifMatch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates the properties of an existing data manager resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Data manager resource details from request body. - /// Defines the If-Match condition. The patch will be performed only if the ETag of the data manager resource on the server matches this value. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string dataManagerName, HybridDataManagerPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dataManagerName, patch, ifMatch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataServicesRestOperations.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataServicesRestOperations.cs deleted file mode 100644 index 209669792578..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataServicesRestOperations.cs +++ /dev/null @@ -1,283 +0,0 @@ -// 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.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData -{ - internal partial class DataServicesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DataServicesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DataServicesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByDataManagerRequest(string subscriptionId, string resourceGroupName, string dataManagerName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the data services. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerAsync(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataServiceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataServiceList.DeserializeDataServiceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the data services. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManager(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataServiceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataServiceList.DeserializeDataServiceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the data service that matches the data service name given. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service that is being queried. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridDataServiceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridDataServiceData.DeserializeHybridDataServiceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataServiceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the data service that matches the data service name given. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service that is being queried. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridDataServiceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridDataServiceData.DeserializeHybridDataServiceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataServiceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataManagerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the data services. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataServiceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataServiceList.DeserializeDataServiceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the data services. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManagerNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataServiceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataServiceList.DeserializeDataServiceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataStoreTypesRestOperations.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataStoreTypesRestOperations.cs deleted file mode 100644 index c1c99e3ae6b1..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataStoreTypesRestOperations.cs +++ /dev/null @@ -1,283 +0,0 @@ -// 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.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData -{ - internal partial class DataStoreTypesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DataStoreTypesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DataStoreTypesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByDataManagerRequest(string subscriptionId, string resourceGroupName, string dataManagerName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataStoreTypes", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets all the data store/repository types that the resource supports. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerAsync(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataStoreTypeList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataStoreTypeList.DeserializeDataStoreTypeList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets all the data store/repository types that the resource supports. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManager(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataStoreTypeList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataStoreTypeList.DeserializeDataStoreTypeList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreTypeName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataStoreTypes/", false); - uri.AppendPath(dataStoreTypeName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the data store/repository type given its name. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data store/repository type name for which details are needed. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreTypeName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataStoreTypeName, nameof(dataStoreTypeName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataStoreTypeName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridDataStoreTypeData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridDataStoreTypeData.DeserializeHybridDataStoreTypeData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataStoreTypeData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the data store/repository type given its name. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data store/repository type name for which details are needed. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreTypeName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataStoreTypeName, nameof(dataStoreTypeName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataStoreTypeName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridDataStoreTypeData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridDataStoreTypeData.DeserializeHybridDataStoreTypeData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataStoreTypeData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataManagerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets all the data store/repository types that the resource supports. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataStoreTypeList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataStoreTypeList.DeserializeDataStoreTypeList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets all the data store/repository types that the resource supports. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManagerNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataStoreTypeList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataStoreTypeList.DeserializeDataStoreTypeList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataStoresRestOperations.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataStoresRestOperations.cs deleted file mode 100644 index b435ea546e87..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/DataStoresRestOperations.cs +++ /dev/null @@ -1,450 +0,0 @@ -// 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.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData -{ - internal partial class DataStoresRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DataStoresRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DataStoresRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByDataManagerRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string filter) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataStores", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets all the data stores/repositories in the given resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataStoreList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataStoreList.DeserializeDataStoreList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets all the data stores/repositories in the given resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManager(string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataStoreList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataStoreList.DeserializeDataStoreList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataStores/", false); - uri.AppendPath(dataStoreName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets the data store/repository by name. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data store/repository name queried. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridDataStoreData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridDataStoreData.DeserializeHybridDataStoreData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataStoreData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets the data store/repository by name. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data store/repository name queried. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridDataStoreData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridDataStoreData.DeserializeHybridDataStoreData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataStoreData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName, HybridDataStoreData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataStores/", false); - uri.AppendPath(dataStoreName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates the data store/repository in the data manager. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data store/repository name to be created or updated. - /// The data store/repository object to be created or updated. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName, HybridDataStoreData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dataManagerName, dataStoreName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates the data store/repository in the data manager. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data store/repository name to be created or updated. - /// The data store/repository object to be created or updated. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName, HybridDataStoreData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dataManagerName, dataStoreName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataStores/", false); - uri.AppendPath(dataStoreName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// This method deletes the given data store/repository. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data store/repository name to be deleted. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method deletes the given data store/repository. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data store/repository name to be deleted. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string dataManagerName, string dataStoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataStoreName, nameof(dataStoreName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dataManagerName, dataStoreName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataManagerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets all the data stores/repositories in the given resource. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataStoreList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataStoreList.DeserializeDataStoreList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets all the data stores/repositories in the given resource. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManagerNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataStoreList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataStoreList.DeserializeDataStoreList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/JobDefinitionsRestOperations.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/JobDefinitionsRestOperations.cs deleted file mode 100644 index 4b974884a7f0..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/JobDefinitionsRestOperations.cs +++ /dev/null @@ -1,731 +0,0 @@ -// 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.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData -{ - internal partial class JobDefinitionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of JobDefinitionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public JobDefinitionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByDataServiceRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobDefinitions", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the job definitions of the given data service name. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of interest. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataServiceAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateListByDataServiceRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobDefinitionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobDefinitionList.DeserializeJobDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the job definitions of the given data service name. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of interest. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListByDataService(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateListByDataServiceRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobDefinitionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobDefinitionList.DeserializeJobDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobDefinitions/", false); - uri.AppendPath(jobDefinitionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets job definition object by name. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service name of the job definition. - /// The job definition name that is being queried. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridDataJobDefinitionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataJobDefinitionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets job definition object by name. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service name of the job definition. - /// The job definition name that is being queried. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridDataJobDefinitionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridDataJobDefinitionData.DeserializeHybridDataJobDefinitionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataJobDefinitionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, HybridDataJobDefinitionData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobDefinitions/", false); - uri.AppendPath(jobDefinitionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates a job definition. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of the job definition. - /// The job definition name to be created or updated. - /// Job Definition object to be created or updated. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, HybridDataJobDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates a job definition. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of the job definition. - /// The job definition name to be created or updated. - /// Job Definition object to be created or updated. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, HybridDataJobDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobDefinitions/", false); - uri.AppendPath(jobDefinitionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// This method deletes the given job definition. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of the job definition. - /// The job definition name to be deleted. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method deletes the given job definition. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of the job definition. - /// The job definition name to be deleted. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRunRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, HybridDataJobRunContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobDefinitions/", false); - uri.AppendPath(jobDefinitionName, true); - uri.AppendPath("/run", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// This method runs a job instance of the given job definition. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of the job definition. - /// Name of the job definition. - /// Run time parameters for the job definition. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task RunAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, HybridDataJobRunContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRunRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method runs a job instance of the given job definition. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of the job definition. - /// Name of the job definition. - /// Run time parameters for the job definition. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Run(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, HybridDataJobRunContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRunRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataManagerRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string filter) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/jobDefinitions", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the job definitions of the given data manager resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobDefinitionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobDefinitionList.DeserializeJobDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the job definitions of the given data manager resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManager(string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobDefinitionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobDefinitionList.DeserializeJobDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataServiceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the job definitions of the given data service name. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of interest. - /// OData Filter options. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataServiceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateListByDataServiceNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, dataServiceName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobDefinitionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobDefinitionList.DeserializeJobDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the job definitions of the given data service name. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The data service type of interest. - /// OData Filter options. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListByDataServiceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateListByDataServiceNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, dataServiceName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobDefinitionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobDefinitionList.DeserializeJobDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataManagerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the job definitions of the given data manager resource. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobDefinitionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobDefinitionList.DeserializeJobDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the job definitions of the given data manager resource. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManagerNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobDefinitionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobDefinitionList.DeserializeJobDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/JobsRestOperations.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/JobsRestOperations.cs deleted file mode 100644 index a9d41ff62e41..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/JobsRestOperations.cs +++ /dev/null @@ -1,841 +0,0 @@ -// 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.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData -{ - internal partial class JobsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of JobsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public JobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByJobDefinitionRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string filter) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobDefinitions/", false); - uri.AppendPath(jobDefinitionName, true); - uri.AppendPath("/jobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the jobs of a given job definition. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition for which jobs are needed. - /// OData Filter options. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListByJobDefinitionAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var message = CreateListByJobDefinitionRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the jobs of a given job definition. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition for which jobs are needed. - /// OData Filter options. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListByJobDefinition(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var message = CreateListByJobDefinitionRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId, string expand) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobDefinitions/", false); - uri.AppendPath(jobDefinitionName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - if (expand != null) - { - uri.AppendQuery("$expand", expand, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets a data manager job given the jobId. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition of the job. - /// The job id of the job queried. - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, jobId, expand); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridDataJobData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridDataJobData.DeserializeHybridDataJobData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataJobData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets a data manager job given the jobId. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition of the job. - /// The job id of the job queried. - /// $expand is supported on details parameter for job, which provides details on the job stages. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, jobId, expand); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridDataJobData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridDataJobData.DeserializeHybridDataJobData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataJobData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobDefinitions/", false); - uri.AppendPath(jobDefinitionName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Cancels the given job. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition of the job. - /// The job id of the job queried. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public async Task CancelAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, jobId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Cancels the given job. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition of the job. - /// The job id of the job queried. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public Response Cancel(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, jobId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobDefinitions/", false); - uri.AppendPath(jobDefinitionName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendPath("/resume", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Resumes the given job. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition of the job. - /// The job id of the job queried. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public async Task ResumeAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, jobId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Resumes the given job. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition of the job. - /// The job id of the job queried. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public Response Resume(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, jobId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataServiceRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/dataServices/", false); - uri.AppendPath(dataServiceName, true); - uri.AppendPath("/jobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the jobs of a data service type in a given resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of interest. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataServiceAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateListByDataServiceRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the jobs of a data service type in a given resource. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of interest. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListByDataService(string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateListByDataServiceRequest(subscriptionId, resourceGroupName, dataManagerName, dataServiceName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataManagerRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string filter) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/jobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the jobs at the data manager resource level. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the jobs at the data manager resource level. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManager(string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByJobDefinitionNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the jobs of a given job definition. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition for which jobs are needed. - /// OData Filter options. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListByJobDefinitionNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var message = CreateListByJobDefinitionNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the jobs of a given job definition. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of the job definition. - /// The name of the job definition for which jobs are needed. - /// OData Filter options. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListByJobDefinitionNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string jobDefinitionName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - Argument.AssertNotNullOrEmpty(jobDefinitionName, nameof(jobDefinitionName)); - - using var message = CreateListByJobDefinitionNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, dataServiceName, jobDefinitionName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataServiceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the jobs of a data service type in a given resource. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of interest. - /// OData Filter options. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataServiceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateListByDataServiceNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, dataServiceName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the jobs of a data service type in a given resource. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The name of the data service of interest. - /// OData Filter options. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListByDataServiceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string dataServiceName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(dataServiceName, nameof(dataServiceName)); - - using var message = CreateListByDataServiceNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, dataServiceName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataManagerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets all the jobs at the data manager resource level. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets all the jobs at the data manager resource level. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// OData Filter options. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManagerNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobList.DeserializeJobList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/PublicKeysRestOperations.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/PublicKeysRestOperations.cs deleted file mode 100644 index ed05f403cf98..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Generated/RestOperations/PublicKeysRestOperations.cs +++ /dev/null @@ -1,283 +0,0 @@ -// 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.ResourceManager.HybridData.Models; - -namespace Azure.ResourceManager.HybridData -{ - internal partial class PublicKeysRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of PublicKeysRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public PublicKeysRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByDataManagerRequest(string subscriptionId, string resourceGroupName, string dataManagerName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/publicKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets the list view of public keys, however it will only have one element. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerAsync(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicKeyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicKeyList.DeserializePublicKeyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets the list view of public keys, however it will only have one element. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManager(string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerRequest(subscriptionId, resourceGroupName, dataManagerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicKeyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicKeyList.DeserializePublicKeyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dataManagerName, string publicKeyName) - { - 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.HybridData/dataManagers/", false); - uri.AppendPath(dataManagerName, true); - uri.AppendPath("/publicKeys/", false); - uri.AppendPath(publicKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets the public keys. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Name of the public key. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dataManagerName, string publicKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(publicKeyName, nameof(publicKeyName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, publicKeyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridDataPublicKeyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridDataPublicKeyData.DeserializeHybridDataPublicKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataPublicKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets the public keys. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Name of the public key. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string dataManagerName, string publicKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - Argument.AssertNotNullOrEmpty(publicKeyName, nameof(publicKeyName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, dataManagerName, publicKeyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridDataPublicKeyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridDataPublicKeyData.DeserializeHybridDataPublicKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridDataPublicKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByDataManagerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method gets the list view of public keys, however it will only have one element. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDataManagerNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicKeyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicKeyList.DeserializePublicKeyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method gets the list view of public keys, however it will only have one element. - /// The URL to the next page of results. - /// The Subscription Id. - /// The Resource Group Name. - /// The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDataManagerNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(dataManagerName, nameof(dataManagerName)); - - using var message = CreateListByDataManagerNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataManagerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicKeyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicKeyList.DeserializePublicKeyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Properties/AssemblyInfo.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Properties/AssemblyInfo.cs deleted file mode 100644 index 8ce9ac6ea127..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Runtime.CompilerServices; - -[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.HybridData")] - -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -[assembly: InternalsVisibleTo("Azure.ResourceManager.HybridData.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/autorest.md b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/autorest.md deleted file mode 100644 index 3730d6f16ae3..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/src/autorest.md +++ /dev/null @@ -1,101 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -``` yaml - -azure-arm: true -csharp: true -library-name: HybridData -namespace: Azure.ResourceManager.HybridData -require: https://github.com/Azure/azure-rest-api-specs/blob/8d9e22058eb70f4d20baf1f0594b22f76f957c96/specification/hybriddatamanager/resource-manager/readme.md -output-folder: $(this-folder)/Generated -clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -rename-rules: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - RSA: Rsa - -rename-mapping: - JobDefinition: HybridDataJobDefinition - Job: HybridDataJob - JobDetails: HybridDataJobDetails - JobStages: HybridDataJobStage - State: HybridDataState - DataStore.properties.repositoryId: -|arm-id - DataStore.properties.dataStoreTypeId: -|arm-id - CustomerSecret: HybridDataCustomerSecret - DataStoreType.properties.repositoryType: -|resource-type - Error: HybridDataJobTopLevelError - ErrorDetails: HybridDataJobErrorDetails - JobStatus: HybridDataJobStatus - IsJobCancellable: JobCancellationSetting - RunLocation: HybridDataJobRunLocation - RunLocation.australiaeast: AustraliaEast - RunLocation.australiasoutheast: AustraliaSoutheast - RunLocation.brazilsouth: BrazilSouth - RunLocation.canadacentral: CanadaCentral - RunLocation.canadaeast: CanadaEast - RunLocation.centralindia: CentralIndia - RunLocation.centralus: CentralUS - RunLocation.eastasia: EastAsia - RunLocation.eastus: EastUS - RunLocation.eastus2: EastUS2 - RunLocation.japaneast: JapanEast - RunLocation.japanwest: JapanWest - RunLocation.koreacentral: KoreaCentral - RunLocation.koreasouth: KoreaSouth - RunLocation.southeastasia: SoutheastAsia - RunLocation.southcentralus: SouthCentralUS - RunLocation.southindia: SouthIndia - RunLocation.northcentralus: NorthCentralUS - RunLocation.northeurope: NorthEurope - RunLocation.uksouth: UKSouth - RunLocation.ukwest: UKWest - RunLocation.westcentralus: WestCentralUS - RunLocation.westeurope: WestEurope - RunLocation.westindia: WestIndia - RunLocation.westus: WestUS - RunLocation.westus2: WestUS2 - Schedule: HybridDataJobRunSchedule - UserConfirmation: UserConfirmationSetting - RunParameters: HybridDataJobRunContent - PublicKey: HybridDataPublicKey - Key: HybridDataEncryptionKey - SupportedAlgorithm: SupportedEncryptionAlgorithm - DataManager: HybridDataManager - DataService: HybridDataService - DataStore: HybridDataStore - DataStoreType: HybridDataStoreType - -``` diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/tests/Azure.ResourceManager.HybridData.Tests.csproj b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/tests/Azure.ResourceManager.HybridData.Tests.csproj deleted file mode 100644 index 60aba4e55d7a..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/tests/Azure.ResourceManager.HybridData.Tests.csproj +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/tests/HybridDataManagementTestBase.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/tests/HybridDataManagementTestBase.cs deleted file mode 100644 index c0731dd89d06..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/tests/HybridDataManagementTestBase.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; -using Azure.Core.TestFramework; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.TestFramework; -using NUnit.Framework; -using System.Threading.Tasks; - -namespace Azure.ResourceManager.HybridData.Tests -{ - public class HybridDataManagementTestBase : ManagementRecordedTestBase - { - protected ArmClient Client { get; private set; } - - protected HybridDataManagementTestBase(bool isAsync, RecordedTestMode mode) - : base(isAsync, mode) - { - } - - protected HybridDataManagementTestBase(bool isAsync) - : base(isAsync) - { - } - - [SetUp] - public void CreateCommonClient() - { - Client = GetArmClient(); - } - - protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) - { - string rgName = Recording.GenerateAssetName(rgNamePrefix); - ResourceGroupData input = new ResourceGroupData(location); - var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); - return lro.Value; - } - } -} diff --git a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/tests/HybridDataManagementTestEnvironment.cs b/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/tests/HybridDataManagementTestEnvironment.cs deleted file mode 100644 index 44e54428f168..000000000000 --- a/sdk/hybriddatamanager/Azure.ResourceManager.HybridData/tests/HybridDataManagementTestEnvironment.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core.TestFramework; - -namespace Azure.ResourceManager.HybridData.Tests -{ - public class HybridDataManagementTestEnvironment : TestEnvironment - { - } -} \ No newline at end of file diff --git a/sdk/hybriddatamanager/ci.mgmt.yml b/sdk/hybriddatamanager/ci.mgmt.yml index 5dba556eb879..b687b6bd6753 100644 --- a/sdk/hybriddatamanager/ci.mgmt.yml +++ b/sdk/hybriddatamanager/ci.mgmt.yml @@ -1,17 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/hybriddatamanager/ci.mgmt.yml - - sdk/hybriddatamanager/Azure.ResourceManager.HybridData/ +pr: none extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -19,5 +9,3 @@ extends: ServiceDirectory: hybriddatamanager LimitForPullRequest: true Artifacts: - - name: Azure.ResourceManager.HybridData - safeName: AzureResourceManagerHybridData