diff --git a/sdk/purview/Azure.Analytics.Purview.Account/Azure.Analytics.Purview.Account.sln b/sdk/purview/Azure.Analytics.Purview.Account/Azure.Analytics.Purview.Account.sln new file mode 100644 index 000000000000..a40c174d9da3 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/Azure.Analytics.Purview.Account.sln @@ -0,0 +1,49 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{8052009B-2126-44A3-88CD-4F3B17894C64}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Test.Stress", "..\..\..\common\Stress\Azure.Test.Stress\Azure.Test.Stress.csproj", "{0B991CA1-E570-4292-BABF-E011D9613C7B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Test.Perf", "..\..\..\common\Perf\Azure.Test.Perf\Azure.Test.Perf.csproj", "{0ED9C8A0-9A19-4750-8DD3-61D086288283}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Analytics.Purview.Account", "src\Azure.Analytics.Purview.Account.csproj", "{CF37FB99-8D78-473D-8333-AD560F057B75}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Analytics.Purview.Account.Tests", "tests\Azure.Analytics.Purview.Account.Tests.csproj", "{002A0F15-402B-473D-8842-5507462920BF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8052009B-2126-44A3-88CD-4F3B17894C64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8052009B-2126-44A3-88CD-4F3B17894C64}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8052009B-2126-44A3-88CD-4F3B17894C64}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8052009B-2126-44A3-88CD-4F3B17894C64}.Release|Any CPU.Build.0 = Release|Any CPU + {0B991CA1-E570-4292-BABF-E011D9613C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B991CA1-E570-4292-BABF-E011D9613C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B991CA1-E570-4292-BABF-E011D9613C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B991CA1-E570-4292-BABF-E011D9613C7B}.Release|Any CPU.Build.0 = Release|Any CPU + {0ED9C8A0-9A19-4750-8DD3-61D086288283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0ED9C8A0-9A19-4750-8DD3-61D086288283}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0ED9C8A0-9A19-4750-8DD3-61D086288283}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0ED9C8A0-9A19-4750-8DD3-61D086288283}.Release|Any CPU.Build.0 = Release|Any CPU + {CF37FB99-8D78-473D-8333-AD560F057B75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CF37FB99-8D78-473D-8333-AD560F057B75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF37FB99-8D78-473D-8333-AD560F057B75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CF37FB99-8D78-473D-8333-AD560F057B75}.Release|Any CPU.Build.0 = Release|Any CPU + {002A0F15-402B-473D-8842-5507462920BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {002A0F15-402B-473D-8842-5507462920BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {002A0F15-402B-473D-8842-5507462920BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {002A0F15-402B-473D-8842-5507462920BF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/purview/Azure.Analytics.Purview.Account/CHANGELOG.md b/sdk/purview/Azure.Analytics.Purview.Account/CHANGELOG.md new file mode 100644 index 000000000000..776c9cb8a9ee --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### New Features + +- Initial preview release of the Azure Purview Account client library for .NET + diff --git a/sdk/purview/Azure.Analytics.Purview.Account/Directory.Build.props b/sdk/purview/Azure.Analytics.Purview.Account/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/purview/Azure.Analytics.Purview.Account/README.md b/sdk/purview/Azure.Analytics.Purview.Account/README.md new file mode 100644 index 000000000000..a33736309e9c --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/README.md @@ -0,0 +1,114 @@ +# Azure Purview Account client library for .NET + +Azure Purview Account is a fully managed cloud service. + +**Please rely heavily on the [service's documentation][account_product_documentation] and our [protocol client docs][protocol_client_quickstart] to use this library** + +[Source code][source_code] | [Package (NuGet)][client_nuget_package] | [Product documentation][account_product_documentation] + +## Getting started + +### Install the package + +Install the Azure Purview Account client library for .NET with [NuGet][client_nuget_package]: + +``` +dotnet add package Azure.Analysis.Purview.Account +``` + +### Prerequisites + +- You must have an [Azure subscription][azure_subscription] and a [Purview resource][purview_resource] to use this package. + +### Authenticate the client + +#### Using Azure Active Directory + +This document demonstrates using [DefaultAzureCredential][default_cred_ref] to authenticate via Azure Active Directory. However, any of the credentials offered by the [Azure.Identity][azure_identity] will be accepted. See the [Azure.Identity][azure_identity] documentation for more information about other credentials. + +Once you have chosen and configured your credential, you can create instances of the `AccountClient`. + +```C# +var credential = new DefaultAzureCredential(); +var client = new PurviewAccountClient(new Url("https://.purview.azure.com"), credential); +``` + +## Key concepts + +### Protocol Methods + +Operations exposed by the Purview Account SDK for .NET use *protocol methods* to expose the underlying REST operations. You can learn more about how to use SDK Clients which use protocol methods in our [documentation][protocol_client_quickstart]. + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +The following section shows you how to initialize and authenticate your client, then get all of the type definitions in the catalog. + +### Get All Type Definitions + +```C# +var credential = new DefaultAzureCredential(); +var client = new PurviewAccountClient(new Uri("https://.purview.azure.com"), credential); + +var Response response = await client.GetAccountPropertiesAsync(); +var responseDocument = JsonDocument.Parse(response.Content); +Console.WriteLine(responseDocument.RootElement.GetProperty("name")); +``` + +## Troubleshooting + +### Setting up console logging +The simplest way to see the logs is to enable the console logging. +To create an Azure SDK log listener that outputs messages to console use AzureEventSourceListener.CreateConsoleLogger method. + +```C# +// Setup a listener to monitor logged events. +using AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger(); +``` + +To learn more about other logging mechanisms see [here][azure_core_diagnostics]. + +## Next steps + +This client SDK exposes operations using *protocol methods*, you can learn more about how to use SDK Clients which use protocol methods in our [documentation][protocol_client_quickstart]. + +## Contributing + +See the [CONTRIBUTING.md][contributing] for details on building, testing, and contributing to this library. + +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 [cla.microsoft.com][cla]. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. + + +[source_code]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/purview/Azure.Analytics.Purview.Account/src +[client_nuget_package]: https://www.nuget.org/packages?q=Azure.Analytics.Purview.Account +[account_product_documentation]: https://azure.microsoft.com/services/purview/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity +[protocol_client_quickstart]: https://aka.ms/azsdk/net/protocol/quickstart +[default_cred_ref]: https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet +[azure_subscription]: https://azure.microsoft.com/free/dotnet/ +[purview_resource]: https://docs.microsoft.com/azure/purview +[azure_core_diagnostics]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md +[cla]: https://cla.microsoft.com +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ +[coc_contact]: mailto:opencode@microsoft.com + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fpurview%2FAzure.Analytics.Purview.Catalog%2FREADME.png) diff --git a/sdk/purview/Azure.Analytics.Purview.Account/api/Azure.Analytics.Purview.Account.netstandard2.0.cs b/sdk/purview/Azure.Analytics.Purview.Account/api/Azure.Analytics.Purview.Account.netstandard2.0.cs new file mode 100644 index 000000000000..82db3b11bd1e --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/api/Azure.Analytics.Purview.Account.netstandard2.0.cs @@ -0,0 +1,57 @@ +namespace Azure.Analytics.Purview.Account +{ + public partial class PurviewAccountClient + { + protected PurviewAccountClient() { } + public PurviewAccountClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Analytics.Purview.Account.PurviewAccountClientOptions options = null) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response GetAccessKeys(Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task GetAccessKeysAsync(Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Response GetAccountProperties(Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task GetAccountPropertiesAsync(Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Analytics.Purview.Account.PurviewCollection GetCollectionClient(string collectionName) { throw null; } + public virtual Azure.Response GetCollections(string skipToken = null, Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task GetCollectionsAsync(string skipToken = null, Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Analytics.Purview.Account.PurviewResourceSetRule GetResourceSetRuleClient() { throw null; } + public virtual Azure.Response GetResourceSetRules(string skipToken = null, Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task GetResourceSetRulesAsync(string skipToken = null, Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Response RegenerateAccessKey(Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task RegenerateAccessKeyAsync(Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Response UpdateAccountProperties(Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateAccountPropertiesAsync(Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; } + } + public partial class PurviewAccountClientOptions : Azure.Core.ClientOptions + { + public PurviewAccountClientOptions(Azure.Analytics.Purview.Account.PurviewAccountClientOptions.ServiceVersion version = Azure.Analytics.Purview.Account.PurviewAccountClientOptions.ServiceVersion.V2019_11_01_preview) { } + public enum ServiceVersion + { + V2019_11_01_preview = 1, + } + } + public partial class PurviewCollection + { + protected PurviewCollection() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response CreateOrUpdateCollection(Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateCollectionAsync(Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Response DeleteCollection(Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteCollectionAsync(Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Response GetCollection(Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task GetCollectionAsync(Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Response GetCollectionPath(Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task GetCollectionPathAsync(Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Response ListChildCollectionNames(string skipToken = null, Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task ListChildCollectionNamesAsync(string skipToken = null, Azure.RequestOptions options = null) { throw null; } + } + public partial class PurviewResourceSetRule + { + protected PurviewResourceSetRule() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response CreateOrUpdateResourceSetRule(Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateResourceSetRuleAsync(Azure.Core.RequestContent content, Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Response DeleteResourceSetRule(Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteResourceSetRuleAsync(Azure.RequestOptions options = null) { throw null; } + public virtual Azure.Response GetResourceSetRule(Azure.RequestOptions options = null) { throw null; } + public virtual System.Threading.Tasks.Task GetResourceSetRuleAsync(Azure.RequestOptions options = null) { throw null; } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/Azure.Analytics.Purview.Account.csproj b/sdk/purview/Azure.Analytics.Purview.Account/src/Azure.Analytics.Purview.Account.csproj new file mode 100644 index 000000000000..3bf2cb50255d --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/Azure.Analytics.Purview.Account.csproj @@ -0,0 +1,29 @@ + + + An SDK for interacting with the Azure Purview Account service + Azure Purview Account SDK + 1.0.0-beta.1 + Azure Purview + $(RequiredTargetFrameworks) + $(NoWarn);CS0169 + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/Customizations/PurviewAccountClient.cs b/sdk/purview/Azure.Analytics.Purview.Account/src/Customizations/PurviewAccountClient.cs new file mode 100644 index 000000000000..2bf6346f38a8 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/Customizations/PurviewAccountClient.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; + +namespace Azure.Analytics.Purview.Account +{ + [CodeGenClient("AccountsClient")] + public partial class PurviewAccountClient + { + /// + /// Gets a service client for interacting with a collection. + /// + /// The name of the collection to use. + /// A service client for interacting with a collection. + public virtual PurviewCollection GetCollectionClient(string collectionName) + { + if (string.IsNullOrEmpty(collectionName)) + { + throw new ArgumentNullException(nameof(collectionName)); + } + + return new PurviewCollection(Pipeline, _tokenCredential, endpoint, collectionName, apiVersion, _clientDiagnostics); + } + + /// + /// Gets a service client for interacting with a resource set rule. + /// + /// A service client for interacting with a resource set rule. + public virtual PurviewResourceSetRule GetResourceSetRuleClient() + { + return new PurviewResourceSetRule(Pipeline, _tokenCredential, endpoint, apiVersion, _clientDiagnostics); + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/Customizations/PurviewCollection.cs b/sdk/purview/Azure.Analytics.Purview.Account/src/Customizations/PurviewCollection.cs new file mode 100644 index 000000000000..fca1d1fc6bd8 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/Customizations/PurviewCollection.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Analytics.Purview.Account +{ + [CodeGenClient("CollectionsClient")] + [CodeGenSuppress("PurviewCollection", new Type[] { typeof(Uri), typeof(string), typeof(TokenCredential), typeof(PurviewAccountClientOptions)})] + public partial class PurviewCollection + { + internal PurviewCollection(HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string collectionName, string apiVersion, ClientDiagnostics clientDiagnostics) + { + Pipeline = pipeline; + _tokenCredential = tokenCredential; + this.endpoint = endpoint; + this.collectionName = collectionName; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/Customizations/PurviewResourceSetRule.cs b/sdk/purview/Azure.Analytics.Purview.Account/src/Customizations/PurviewResourceSetRule.cs new file mode 100644 index 000000000000..05b8b6e36216 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/Customizations/PurviewResourceSetRule.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Analytics.Purview.Account +{ + [CodeGenClient("ResourceSetRulesClient")] + [CodeGenSuppress("PurviewResourceSetRule", typeof(Uri), typeof(TokenCredential), typeof(PurviewAccountClientOptions))] + public partial class PurviewResourceSetRule + { + internal PurviewResourceSetRule(HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion, ClientDiagnostics clientDiagnostics) + { + Pipeline = pipeline; + _tokenCredential = tokenCredential; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewAccountClient.cs b/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewAccountClient.cs new file mode 100644 index 000000000000..721838f960d2 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewAccountClient.cs @@ -0,0 +1,712 @@ +// 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.Core.Pipeline; + +namespace Azure.Analytics.Purview.Account +{ + /// The PurviewAccount service client. + public partial class PurviewAccountClient + { + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + private readonly string[] AuthorizationScopes = { "https://purview.azure.net/.default" }; + private readonly TokenCredential _tokenCredential; + private Uri endpoint; + private readonly string apiVersion; + private readonly ClientDiagnostics _clientDiagnostics; + + /// Initializes a new instance of PurviewAccountClient for mocking. + protected PurviewAccountClient() + { + } + + /// Initializes a new instance of PurviewAccountClient. + /// The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/account/. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + public PurviewAccountClient(Uri endpoint, TokenCredential credential, PurviewAccountClientOptions options = null) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (credential == null) + { + throw new ArgumentNullException(nameof(credential)); + } + + options ??= new PurviewAccountClientOptions(); + _clientDiagnostics = new ClientDiagnostics(options); + _tokenCredential = credential; + var authPolicy = new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes); + Pipeline = HttpPipelineBuilder.Build(options, new HttpPipelinePolicy[] { new LowLevelCallbackPolicy() }, new HttpPipelinePolicy[] { authPolicy }, new ResponseClassifier()); + this.endpoint = endpoint; + apiVersion = options.Version; + } + + /// Get an account. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task GetAccountPropertiesAsync(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetAccountPropertiesRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.GetAccountProperties"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get an account. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response GetAccountProperties(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetAccountPropertiesRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.GetAccountProperties"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The request options. + private HttpMessage CreateGetAccountPropertiesRequest(RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Updates an account. + /// + /// Schema for Request Body: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// friendlyName + /// string + /// + /// The friendly name for the azure resource. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task UpdateAccountPropertiesAsync(RequestContent content, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateUpdateAccountPropertiesRequest(content, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.UpdateAccountProperties"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Updates an account. + /// + /// Schema for Request Body: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// friendlyName + /// string + /// + /// The friendly name for the azure resource. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response UpdateAccountProperties(RequestContent content, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateUpdateAccountPropertiesRequest(content, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.UpdateAccountProperties"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The content to send as the body of the request. + /// The request options. + private HttpMessage CreateUpdateAccountPropertiesRequest(RequestContent content, RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + /// List the authorization keys associated with this account. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task GetAccessKeysAsync(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetAccessKeysRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.GetAccessKeys"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// List the authorization keys associated with this account. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response GetAccessKeys(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetAccessKeysRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.GetAccessKeys"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The request options. + private HttpMessage CreateGetAccessKeysRequest(RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/listkeys", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Regenerate the authorization keys associated with this data catalog. + /// + /// Schema for Request Body: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// keyType + /// "PrimaryAtlasKafkaKey" | "SecondaryAtlasKafkaKey" + /// + /// The access key type. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task RegenerateAccessKeyAsync(RequestContent content, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateRegenerateAccessKeyRequest(content, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.RegenerateAccessKey"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Regenerate the authorization keys associated with this data catalog. + /// + /// Schema for Request Body: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// keyType + /// "PrimaryAtlasKafkaKey" | "SecondaryAtlasKafkaKey" + /// + /// The access key type. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response RegenerateAccessKey(RequestContent content, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateRegenerateAccessKeyRequest(content, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.RegenerateAccessKey"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The content to send as the body of the request. + /// The request options. + private HttpMessage CreateRegenerateAccessKeyRequest(RequestContent content, RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/regeneratekeys", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + /// List the collections in the account. + /// The String to use. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task GetCollectionsAsync(string skipToken = null, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetCollectionsRequest(skipToken, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.GetCollections"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// List the collections in the account. + /// The String to use. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response GetCollections(string skipToken = null, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetCollectionsRequest(skipToken, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.GetCollections"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The String to use. + /// The request options. + private HttpMessage CreateGetCollectionsRequest(string skipToken = null, RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/collections", false); + uri.AppendQuery("api-version", apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Get a resource set config service model. + /// The String to use. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task GetResourceSetRulesAsync(string skipToken = null, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetResourceSetRulesRequest(skipToken, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.GetResourceSetRules"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get a resource set config service model. + /// The String to use. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response GetResourceSetRules(string skipToken = null, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetResourceSetRulesRequest(skipToken, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewAccountClient.GetResourceSetRules"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The String to use. + /// The request options. + private HttpMessage CreateGetResourceSetRulesRequest(string skipToken = null, RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/resourceSetRuleConfigs", false); + uri.AppendQuery("api-version", apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewAccountClientOptions.cs b/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewAccountClientOptions.cs new file mode 100644 index 000000000000..e98230ded1b9 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewAccountClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Analytics.Purview.Account +{ + /// Client options for PurviewAccountClient. + public partial class PurviewAccountClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2019_11_01_preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2019-11-01-preview". + V2019_11_01_preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of PurviewAccountClientOptions. + public PurviewAccountClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2019_11_01_preview => "2019-11-01-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewCollection.cs b/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewCollection.cs new file mode 100644 index 000000000000..82eb05526b93 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewCollection.cs @@ -0,0 +1,748 @@ +// 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.Core.Pipeline; + +namespace Azure.Analytics.Purview.Account +{ + /// The PurviewCollection service client. + public partial class PurviewCollection + { + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + private readonly string[] AuthorizationScopes = { "https://purview.azure.net/.default" }; + private readonly TokenCredential _tokenCredential; + private Uri endpoint; + private string collectionName; + private readonly string apiVersion; + private readonly ClientDiagnostics _clientDiagnostics; + + /// Initializes a new instance of PurviewCollection for mocking. + protected PurviewCollection() + { + } + + /// Get a collection. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task GetCollectionAsync(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetCollectionRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.GetCollection"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get a collection. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response GetCollection(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetCollectionRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.GetCollection"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The request options. + private HttpMessage CreateGetCollectionRequest(RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/collections/", false); + uri.AppendPath(collectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Creates or updates a collection entity. + /// + /// Schema for Request Body: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// collectionProvisioningState + /// "Unknown" | "Creating" | "Moving" | "Deleting" | "Failed" | "Succeeded" + /// + /// Gets the state of the provisioning. + /// + /// + /// description + /// string + /// + /// Gets or sets the description. + /// + /// + /// friendlyName + /// string + /// + /// Gets or sets the friendly name of the collection. + /// + /// + /// name + /// string + /// + /// Gets the name. + /// + /// + /// parentCollection + /// CollectionReference + /// + /// Gets or sets the parent collection reference. + /// + /// + /// systemData + /// CollectionSystemData + /// + /// Gets the system data that contains information about who and when created and updated the resource. + /// + /// + /// Schema for CollectionReference: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// referenceName + /// string + /// + /// Gets or sets the reference name. + /// + /// + /// type + /// string + /// + /// Gets the reference type property. + /// + /// + /// Schema for CollectionSystemData: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// createdAt + /// string (ISO 8601 Format) + /// + /// The timestamp of resource creation (UTC). + /// + /// + /// createdBy + /// string + /// + /// The identity that created the resource. + /// + /// + /// createdByType + /// "User" | "Application" | "ManagedIdentity" | "Key" + /// + /// The type of identity that created the resource. + /// + /// + /// lastModifiedAt + /// string (ISO 8601 Format) + /// + /// The timestamp of the last modification the resource (UTC). + /// + /// + /// lastModifiedBy + /// string + /// + /// The identity that last modified the resource. + /// + /// + /// lastModifiedByType + /// "User" | "Application" | "ManagedIdentity" | "Key" + /// + /// The type of identity that last modified the resource. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task CreateOrUpdateCollectionAsync(RequestContent content, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateCreateOrUpdateCollectionRequest(content, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.CreateOrUpdateCollection"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates or updates a collection entity. + /// + /// Schema for Request Body: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// collectionProvisioningState + /// "Unknown" | "Creating" | "Moving" | "Deleting" | "Failed" | "Succeeded" + /// + /// Gets the state of the provisioning. + /// + /// + /// description + /// string + /// + /// Gets or sets the description. + /// + /// + /// friendlyName + /// string + /// + /// Gets or sets the friendly name of the collection. + /// + /// + /// name + /// string + /// + /// Gets the name. + /// + /// + /// parentCollection + /// CollectionReference + /// + /// Gets or sets the parent collection reference. + /// + /// + /// systemData + /// CollectionSystemData + /// + /// Gets the system data that contains information about who and when created and updated the resource. + /// + /// + /// Schema for CollectionReference: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// referenceName + /// string + /// + /// Gets or sets the reference name. + /// + /// + /// type + /// string + /// + /// Gets the reference type property. + /// + /// + /// Schema for CollectionSystemData: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// createdAt + /// string (ISO 8601 Format) + /// + /// The timestamp of resource creation (UTC). + /// + /// + /// createdBy + /// string + /// + /// The identity that created the resource. + /// + /// + /// createdByType + /// "User" | "Application" | "ManagedIdentity" | "Key" + /// + /// The type of identity that created the resource. + /// + /// + /// lastModifiedAt + /// string (ISO 8601 Format) + /// + /// The timestamp of the last modification the resource (UTC). + /// + /// + /// lastModifiedBy + /// string + /// + /// The identity that last modified the resource. + /// + /// + /// lastModifiedByType + /// "User" | "Application" | "ManagedIdentity" | "Key" + /// + /// The type of identity that last modified the resource. + /// + /// + /// + /// The content to send as the body of the request. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response CreateOrUpdateCollection(RequestContent content, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateCreateOrUpdateCollectionRequest(content, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.CreateOrUpdateCollection"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The content to send as the body of the request. + /// The request options. + private HttpMessage CreateCreateOrUpdateCollectionRequest(RequestContent content, RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/collections/", false); + uri.AppendPath(collectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + /// Deletes a Collection entity. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task DeleteCollectionAsync(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateDeleteCollectionRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.DeleteCollection"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a Collection entity. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response DeleteCollection(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateDeleteCollectionRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.DeleteCollection"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The request options. + private HttpMessage CreateDeleteCollectionRequest(RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/collections/", false); + uri.AppendPath(collectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Lists the child collections names in the collection. + /// The String to use. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task ListChildCollectionNamesAsync(string skipToken = null, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateListChildCollectionNamesRequest(skipToken, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.ListChildCollectionNames"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the child collections names in the collection. + /// The String to use. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response ListChildCollectionNames(string skipToken = null, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateListChildCollectionNamesRequest(skipToken, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.ListChildCollectionNames"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The String to use. + /// The request options. + private HttpMessage CreateListChildCollectionNamesRequest(string skipToken = null, RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/collections/", false); + uri.AppendPath(collectionName, true); + uri.AppendPath("/getChildCollectionNames", false); + uri.AppendQuery("api-version", apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets the parent name and parent friendly name chains that represent the collection path. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task GetCollectionPathAsync(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetCollectionPathRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.GetCollectionPath"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the parent name and parent friendly name chains that represent the collection path. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response GetCollectionPath(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetCollectionPathRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewCollection.GetCollectionPath"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The request options. + private HttpMessage CreateGetCollectionPathRequest(RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/collections/", false); + uri.AppendPath(collectionName, true); + uri.AppendPath("/getCollectionPath", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewResourceSetRule.cs b/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewResourceSetRule.cs new file mode 100644 index 000000000000..ee64fdf69fba --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/Generated/PurviewResourceSetRule.cs @@ -0,0 +1,1333 @@ +// 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.Core.Pipeline; + +namespace Azure.Analytics.Purview.Account +{ + /// The PurviewResourceSetRule service client. + public partial class PurviewResourceSetRule + { + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + private readonly string[] AuthorizationScopes = { "https://purview.azure.net/.default" }; + private readonly TokenCredential _tokenCredential; + private Uri endpoint; + private readonly string apiVersion; + private readonly ClientDiagnostics _clientDiagnostics; + + /// Initializes a new instance of PurviewResourceSetRule for mocking. + protected PurviewResourceSetRule() + { + } + + /// Get a resource set config service model. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task GetResourceSetRuleAsync(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetResourceSetRuleRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewResourceSetRule.GetResourceSetRule"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get a resource set config service model. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response GetResourceSetRule(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateGetResourceSetRuleRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewResourceSetRule.GetResourceSetRule"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The request options. + private HttpMessage CreateGetResourceSetRuleRequest(RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/resourceSetRuleConfigs/defaultResourceSetRuleConfig", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Creates or updates an resource set config. + /// + /// Schema for Request Body: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// advancedResourceSet + /// AdvancedResourceSet + /// + /// Gets or sets the advanced resource set property of the account. + /// + /// + /// name + /// string + /// + /// The name of the rule + /// + /// + /// pathPatternConfig + /// PathPatternExtractorConfig + /// + /// The configuration rules for path pattern extraction. + /// + /// + /// Schema for AdvancedResourceSet: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// modifiedAt + /// string (ISO 8601 Format) + /// + /// Date at which ResourceSetProcessing property of the account is updated. + /// + /// + /// resourceSetProcessing + /// "Default" | "Advanced" + /// + /// The advanced resource property of the account. + /// + /// + /// Schema for PathPatternExtractorConfig: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// acceptedPatterns + /// Filter[] + /// + /// + /// + /// + /// complexReplacers + /// ComplexReplacerConfig[] + /// + /// + /// + /// + /// createdBy + /// string + /// Yes + /// + /// + /// + /// enableDefaultPatterns + /// boolean + /// Yes + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// modifiedBy + /// string + /// + /// + /// + /// + /// normalizationRules + /// NormalizationRule[] + /// + /// + /// + /// + /// regexReplacers + /// RegexReplacer[] + /// + /// + /// + /// + /// rejectedPatterns + /// Filter[] + /// + /// + /// + /// + /// scopedRules + /// ScopedRule[] + /// + /// + /// + /// + /// version + /// number + /// + /// + /// + /// + /// Schema for Filter: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// createdBy + /// string + /// + /// + /// + /// + /// filterType + /// "Pattern" | "Regex" + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// modifiedBy + /// string + /// + /// + /// + /// + /// name + /// string + /// Yes + /// + /// + /// + /// path + /// string + /// Yes + /// + /// + /// + /// Schema for ComplexReplacerConfig: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// createdBy + /// string + /// + /// + /// + /// + /// description + /// string + /// + /// + /// + /// + /// disabled + /// boolean + /// + /// + /// + /// + /// disableRecursiveReplacerApplication + /// boolean + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// modifiedBy + /// string + /// + /// + /// + /// + /// name + /// string + /// + /// + /// + /// + /// typeName + /// string + /// + /// + /// + /// + /// Schema for NormalizationRule: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// description + /// string + /// + /// + /// + /// + /// disabled + /// boolean + /// + /// + /// + /// + /// dynamicReplacement + /// boolean + /// + /// + /// + /// + /// entityTypes + /// string[] + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// name + /// string + /// + /// + /// + /// + /// regex + /// FastRegex + /// + /// + /// + /// + /// replaceWith + /// string + /// + /// + /// + /// + /// version + /// number + /// + /// + /// + /// + /// Schema for RegexReplacer: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// condition + /// string + /// + /// + /// + /// + /// createdBy + /// string + /// + /// + /// + /// + /// description + /// string + /// + /// + /// + /// + /// disabled + /// boolean + /// Yes + /// + /// + /// + /// disableRecursiveReplacerApplication + /// boolean + /// + /// + /// + /// + /// doNotReplaceRegex + /// FastRegex + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// modifiedBy + /// string + /// + /// + /// + /// + /// name + /// string + /// Yes + /// + /// + /// + /// regex + /// FastRegex + /// + /// + /// + /// + /// replaceWith + /// string + /// + /// + /// + /// + /// Schema for ScopedRule: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// bindingUrl + /// string + /// Yes + /// + /// + /// + /// rules + /// Rule[] + /// + /// + /// + /// + /// storeType + /// string + /// Yes + /// + /// + /// + /// Schema for FastRegex: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// maxDigits + /// number + /// + /// + /// + /// + /// maxLetters + /// number + /// + /// + /// + /// + /// minDashes + /// number + /// + /// + /// + /// + /// minDigits + /// number + /// + /// + /// + /// + /// minDigitsOrLetters + /// number + /// + /// + /// + /// + /// minDots + /// number + /// + /// + /// + /// + /// minHex + /// number + /// + /// + /// + /// + /// minLetters + /// number + /// + /// + /// + /// + /// minUnderscores + /// number + /// + /// + /// + /// + /// options + /// number + /// + /// + /// + /// + /// regexStr + /// string + /// + /// + /// + /// + /// Schema for Rule: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// displayName + /// string + /// + /// + /// + /// + /// isResourceSet + /// boolean + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// name + /// string + /// + /// + /// + /// + /// qualifiedName + /// string + /// Yes + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task CreateOrUpdateResourceSetRuleAsync(RequestContent content, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateCreateOrUpdateResourceSetRuleRequest(content, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewResourceSetRule.CreateOrUpdateResourceSetRule"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates or updates an resource set config. + /// + /// Schema for Request Body: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// advancedResourceSet + /// AdvancedResourceSet + /// + /// Gets or sets the advanced resource set property of the account. + /// + /// + /// name + /// string + /// + /// The name of the rule + /// + /// + /// pathPatternConfig + /// PathPatternExtractorConfig + /// + /// The configuration rules for path pattern extraction. + /// + /// + /// Schema for AdvancedResourceSet: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// modifiedAt + /// string (ISO 8601 Format) + /// + /// Date at which ResourceSetProcessing property of the account is updated. + /// + /// + /// resourceSetProcessing + /// "Default" | "Advanced" + /// + /// The advanced resource property of the account. + /// + /// + /// Schema for PathPatternExtractorConfig: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// acceptedPatterns + /// Filter[] + /// + /// + /// + /// + /// complexReplacers + /// ComplexReplacerConfig[] + /// + /// + /// + /// + /// createdBy + /// string + /// Yes + /// + /// + /// + /// enableDefaultPatterns + /// boolean + /// Yes + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// modifiedBy + /// string + /// + /// + /// + /// + /// normalizationRules + /// NormalizationRule[] + /// + /// + /// + /// + /// regexReplacers + /// RegexReplacer[] + /// + /// + /// + /// + /// rejectedPatterns + /// Filter[] + /// + /// + /// + /// + /// scopedRules + /// ScopedRule[] + /// + /// + /// + /// + /// version + /// number + /// + /// + /// + /// + /// Schema for Filter: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// createdBy + /// string + /// + /// + /// + /// + /// filterType + /// "Pattern" | "Regex" + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// modifiedBy + /// string + /// + /// + /// + /// + /// name + /// string + /// Yes + /// + /// + /// + /// path + /// string + /// Yes + /// + /// + /// + /// Schema for ComplexReplacerConfig: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// createdBy + /// string + /// + /// + /// + /// + /// description + /// string + /// + /// + /// + /// + /// disabled + /// boolean + /// + /// + /// + /// + /// disableRecursiveReplacerApplication + /// boolean + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// modifiedBy + /// string + /// + /// + /// + /// + /// name + /// string + /// + /// + /// + /// + /// typeName + /// string + /// + /// + /// + /// + /// Schema for NormalizationRule: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// description + /// string + /// + /// + /// + /// + /// disabled + /// boolean + /// + /// + /// + /// + /// dynamicReplacement + /// boolean + /// + /// + /// + /// + /// entityTypes + /// string[] + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// name + /// string + /// + /// + /// + /// + /// regex + /// FastRegex + /// + /// + /// + /// + /// replaceWith + /// string + /// + /// + /// + /// + /// version + /// number + /// + /// + /// + /// + /// Schema for RegexReplacer: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// condition + /// string + /// + /// + /// + /// + /// createdBy + /// string + /// + /// + /// + /// + /// description + /// string + /// + /// + /// + /// + /// disabled + /// boolean + /// Yes + /// + /// + /// + /// disableRecursiveReplacerApplication + /// boolean + /// + /// + /// + /// + /// doNotReplaceRegex + /// FastRegex + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// modifiedBy + /// string + /// + /// + /// + /// + /// name + /// string + /// Yes + /// + /// + /// + /// regex + /// FastRegex + /// + /// + /// + /// + /// replaceWith + /// string + /// + /// + /// + /// + /// Schema for ScopedRule: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// bindingUrl + /// string + /// Yes + /// + /// + /// + /// rules + /// Rule[] + /// + /// + /// + /// + /// storeType + /// string + /// Yes + /// + /// + /// + /// Schema for FastRegex: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// maxDigits + /// number + /// + /// + /// + /// + /// maxLetters + /// number + /// + /// + /// + /// + /// minDashes + /// number + /// + /// + /// + /// + /// minDigits + /// number + /// + /// + /// + /// + /// minDigitsOrLetters + /// number + /// + /// + /// + /// + /// minDots + /// number + /// + /// + /// + /// + /// minHex + /// number + /// + /// + /// + /// + /// minLetters + /// number + /// + /// + /// + /// + /// minUnderscores + /// number + /// + /// + /// + /// + /// options + /// number + /// + /// + /// + /// + /// regexStr + /// string + /// + /// + /// + /// + /// Schema for Rule: + /// + /// + /// Name + /// Type + /// Required + /// Description + /// + /// + /// displayName + /// string + /// + /// + /// + /// + /// isResourceSet + /// boolean + /// + /// + /// + /// + /// lastUpdatedTimestamp + /// number + /// + /// + /// + /// + /// name + /// string + /// + /// + /// + /// + /// qualifiedName + /// string + /// Yes + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response CreateOrUpdateResourceSetRule(RequestContent content, RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateCreateOrUpdateResourceSetRuleRequest(content, options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewResourceSetRule.CreateOrUpdateResourceSetRule"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The content to send as the body of the request. + /// The request options. + private HttpMessage CreateCreateOrUpdateResourceSetRuleRequest(RequestContent content, RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/resourceSetRuleConfigs/defaultResourceSetRuleConfig", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + /// Deletes a ResourceSetRuleConfig resource. + /// The request options. +#pragma warning disable AZC0002 + public virtual async Task DeleteResourceSetRuleAsync(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateDeleteResourceSetRuleRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewResourceSetRule.DeleteResourceSetRule"); + scope.Start(); + try + { + await Pipeline.SendAsync(message, options.CancellationToken).ConfigureAwait(false); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a ResourceSetRuleConfig resource. + /// The request options. +#pragma warning disable AZC0002 + public virtual Response DeleteResourceSetRule(RequestOptions options = null) +#pragma warning restore AZC0002 + { + options ??= new RequestOptions(); + HttpMessage message = CreateDeleteResourceSetRuleRequest(options); + if (options.PerCallPolicy != null) + { + message.SetProperty("RequestOptionsPerCallPolicyCallback", options.PerCallPolicy); + } + using var scope = _clientDiagnostics.CreateScope("PurviewResourceSetRule.DeleteResourceSetRule"); + scope.Start(); + try + { + Pipeline.Send(message, options.CancellationToken); + if (options.StatusOption == ResponseStatusOption.Default) + { + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + else + { + return message.Response; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Request for and operations. + /// The request options. + private HttpMessage CreateDeleteResourceSetRuleRequest(RequestOptions options = null) + { + var message = Pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/resourceSetRuleConfigs/defaultResourceSetRuleConfig", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/autorest.md b/sdk/purview/Azure.Analytics.Purview.Account/src/autorest.md new file mode 100644 index 000000000000..ac4852da1f30 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/autorest.md @@ -0,0 +1,60 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +```yaml +title: PurviewAccount +input-file: https://github.com/Azure/azure-rest-api-specs/blob/b2bddfe2e59b5b14e559e0433b6e6d057bcff95d/specification/purview/data-plane/Azure.Analytics.Purview.Account/preview/2019-11-01-preview/account.json +namespace: Azure.Analytics.Purview.Account +low-level-client: true +security: AADToken +security-scopes: https://purview.azure.net/.default +``` + +# Model endpoint parameter as a url, not a string. + +```yaml +directive: + - from: swagger-document + where: $.parameters.endpoint + transform: > + if ($.format === undefined) { + $.format = "url"; + } +``` + +# Promote collectionName to be a client parameter. + +```yaml +directive: + - from: swagger-document + where: $.parameters + transform: > + $["collectionName"] = { + "in": "path", + "name": "collectionName", + "required": true, + "type": "string", + "x-ms-parameter-location": "client" + }; + + - from: swagger-document + where: $.paths..parameters[?(@.name=='collectionName')] + transform: > + $ = { "$ref": "#/parameters/collectionName" }; +``` + +# Promote List Methods to Account Client + +```yaml +directive: + - from: swagger-document + where: $..[?(@.operationId !== undefined)] + transform: > + const mappingTable = { + "Collections_ListCollections": "Accounts_GetCollections", + "ResourceSetRules_ListResourceSetRules": "Accounts_GetResourceSetRules" + }; + + $.operationId = (mappingTable[$.operationId] ?? $.operationId); +``` \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/src/properties/AssemblyInfo.cs b/sdk/purview/Azure.Analytics.Purview.Account/src/properties/AssemblyInfo.cs new file mode 100644 index 000000000000..d824f6bb9834 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/src/properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Purview")] diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/AccountsClientTest.cs b/sdk/purview/Azure.Analytics.Purview.Account/tests/AccountsClientTest.cs new file mode 100644 index 000000000000..6380813846d8 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/AccountsClientTest.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.Analytics.Purview.Account.Tests +{ + public class AccountsClientTest : AccountsClientTestBase + { + public AccountsClientTest(bool isAsync) : base(isAsync) + { + } + + [RecordedTest] + public async Task GetTask() + { + PurviewAccountClient client = GetAccountClient(); + Response fetchResponse = await client.GetAccountPropertiesAsync(); + JsonElement fetchBodyJson = JsonDocument.Parse(GetContentFromResponse(fetchResponse)).RootElement; + Assert.AreEqual("dotnetLLCPurviewAccount", fetchBodyJson.GetProperty("name").GetString()); + } + + [RecordedTest] + public async Task UpdateTask() + { + var options = new PurviewAccountClientOptions(); + PurviewAccountClient client = GetAccountClient(); + var data = new JsonData(new Dictionary + { + ["friendlyName"] = "udpatedFriendlyName" + }); + Response updateRespons = await client.UpdateAccountPropertiesAsync(RequestContent.Create(data)); + JsonElement upateBodyJson = JsonDocument.Parse(GetContentFromResponse(updateRespons)).RootElement; + Assert.AreEqual("dotnetLLCPurviewAccount", upateBodyJson.GetProperty("name").GetString()); + Assert.AreEqual("udpatedFriendlyName", upateBodyJson.GetProperty("properties").GetProperty("friendlyName").GetString()); + } + + [RecordedTest] + public async Task RegenerateKeysTask() + { + var options = new PurviewAccountClientOptions(); + PurviewAccountClient client = GetAccountClient(); + var data = new + { + keyType = "PrimaryAtlasKafkaKey", + }; + Response genResponse = await client.RegenerateAccessKeyAsync(RequestContent.Create(data)); + JsonElement genKeyBodyJson = JsonDocument.Parse(GetContentFromResponse(genResponse)).RootElement; + Assert.AreEqual(genResponse.Status, 200); + } + + [RecordedTest] + public async Task ListKeysTask() + { + var options = new PurviewAccountClientOptions(); + PurviewAccountClient client = GetAccountClient(); + var data = new JsonData(new Dictionary + { + ["keyType"] = "PrimaryAtlasKafkaKey" + }); + Response genResponse = await client.RegenerateAccessKeyAsync(RequestContent.Create(data)); + JsonElement genKeyBodyJson = JsonDocument.Parse(GetContentFromResponse(genResponse)).RootElement; + Assert.AreEqual(genResponse.Status, 200); + Response listKeysResponse = await client.GetAccessKeysAsync(); + JsonElement listKeyBodyJson = JsonDocument.Parse(GetContentFromResponse(listKeysResponse)).RootElement; + Assert.AreEqual(listKeysResponse.Status, 200); + } + + private static BinaryData GetContentFromResponse(Response r) + { + // Workaround azure/azure-sdk-for-net#21048, which prevents .Content from working when dealing with responses + // from the playback system. + + MemoryStream ms = new MemoryStream(); + r.ContentStream.CopyTo(ms); + return new BinaryData(ms.ToArray()); + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/AccountsClientTestBase.cs b/sdk/purview/Azure.Analytics.Purview.Account/tests/AccountsClientTestBase.cs new file mode 100644 index 000000000000..03964c938b77 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/AccountsClientTestBase.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Net.Http; +using Azure.Core.Pipeline; +using Azure.Core.TestFramework; + +namespace Azure.Analytics.Purview.Account.Tests +{ + public class AccountsClientTestBase : RecordedTestBase + { + public AccountsClientTestBase(bool isAsync) : base(isAsync) + { + } + + public AccountsClientTestBase(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) + { + } + + public PurviewAccountClient GetAccountClient() + { + var httpHandler = new HttpClientHandler(); + httpHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => + { + return true; + }; + var options = new PurviewAccountClientOptions { Transport = new HttpClientTransport(httpHandler) }; + var client = InstrumentClient( + new PurviewAccountClient(TestEnvironment.Endpoint, TestEnvironment.Credential, InstrumentClientOptions(options))); + return client; + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/Azure.Analytics.Purview.Account.Tests.csproj b/sdk/purview/Azure.Analytics.Purview.Account/tests/Azure.Analytics.Purview.Account.Tests.csproj new file mode 100644 index 000000000000..b9c31567f155 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/Azure.Analytics.Purview.Account.Tests.csproj @@ -0,0 +1,17 @@ + + + $(RequiredTargetFrameworks) + + + + + + + + + + + + + + diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/CollectionsClientTest.cs b/sdk/purview/Azure.Analytics.Purview.Account/tests/CollectionsClientTest.cs new file mode 100644 index 000000000000..46903bab7e46 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/CollectionsClientTest.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; +using System.Text.Json; +using Azure.Core; +using System.IO; + +namespace Azure.Analytics.Purview.Account.Tests +{ + public class CollectionsClientTest: CollectionsClientTestBase + { + public CollectionsClientTest(bool isAsync) : base(isAsync) + { + } + + [RecordedTest] + public async Task CreateOrUpdateTask() + { + var options = new PurviewAccountClientOptions(); + var collectionName = "mysubCollection"; + PurviewCollection client = GetCollectionsClient(collectionName); + + var data = new + { + parentCollection = new + { + referenceName = "dotnetLLCPurviewAccount" + }, + }; + Response createResponse = await client.CreateOrUpdateCollectionAsync(RequestContent.Create(data), default); + + JsonElement createBodyJson = JsonDocument.Parse(GetContentFromResponse(createResponse)).RootElement; + Assert.AreEqual("mysubCollection", createBodyJson.GetProperty("name").GetString()); + while (true) + { + System.Threading.Thread.Sleep(1000); + Response getResponse = await client.GetCollectionAsync(); + JsonElement getBodyJson = JsonDocument.Parse(GetContentFromResponse(getResponse)).RootElement; + if (getBodyJson.GetProperty("collectionProvisioningState").GetString() == "Succeeded") + break; + } + Response delRespons = await client.DeleteCollectionAsync(default); + } + + [RecordedTest] + public async Task GetTask() + { + var options = new PurviewAccountClientOptions(); + var collectionName = "myCollection1"; + PurviewCollection client = GetCollectionsClient(collectionName); + + var data = new + { + parentCollection = new + { + referenceName = "dotnetLLCPurviewAccount" + }, + }; + Response createResponse = await client.CreateOrUpdateCollectionAsync(RequestContent.Create(data), default); + Response getResponse = await client.GetCollectionAsync(); + JsonElement getBodyJson = JsonDocument.Parse(GetContentFromResponse(getResponse)).RootElement; + Assert.AreEqual("myCollection1", getBodyJson.GetProperty("name").GetString()); + while (true) + { + System.Threading.Thread.Sleep(1000); + Response getRes = await client.GetCollectionAsync(); + JsonElement getJson = JsonDocument.Parse(GetContentFromResponse(getRes)).RootElement; + if (getJson.GetProperty("collectionProvisioningState").GetString() == "Succeeded") + break; + } + Response delRespons = await client.DeleteCollectionAsync(default); + } + private static BinaryData GetContentFromResponse(Response r) + { + // Workaround azure/azure-sdk-for-net#21048, which prevents .Content from working when dealing with responses + // from the playback system. + + MemoryStream ms = new MemoryStream(); + r.ContentStream.CopyTo(ms); + return new BinaryData(ms.ToArray()); + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/CollectionsClientTestBase.cs b/sdk/purview/Azure.Analytics.Purview.Account/tests/CollectionsClientTestBase.cs new file mode 100644 index 000000000000..913d89072a2f --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/CollectionsClientTestBase.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.Pipeline; +using Azure.Core.TestFramework; +using Azure.Identity; + +namespace Azure.Analytics.Purview.Account.Tests +{ + public class CollectionsClientTestBase: RecordedTestBase + { + public CollectionsClientTestBase(bool isAsync) : base(isAsync) + { + } + + public CollectionsClientTestBase(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) + { + } + + public PurviewCollection GetCollectionsClient(string collectionName) + { + var httpHandler = new HttpClientHandler(); + httpHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => + { + return true; + }; + var options = new PurviewAccountClientOptions { Transport = new HttpClientTransport(httpHandler) }; + var client = InstrumentClient( + new PurviewAccountClient(TestEnvironment.Endpoint, TestEnvironment.Credential, InstrumentClientOptions(options)).GetCollectionClient(collectionName)); + return client; + } + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/PurviewAccountTestEnvironment.cs b/sdk/purview/Azure.Analytics.Purview.Account/tests/PurviewAccountTestEnvironment.cs new file mode 100644 index 000000000000..51931436abbb --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/PurviewAccountTestEnvironment.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; + +namespace Azure.Analytics.Purview.Account.Tests +{ + public class PurviewAccountTestEnvironment: TestEnvironment + { + public PurviewAccountTestEnvironment() + { + } + public Uri Endpoint => new(GetRecordedVariable("PURVIEW_ACCOUNT_URL")); + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/PurviewCollectionTestEnvironment.cs b/sdk/purview/Azure.Analytics.Purview.Account/tests/PurviewCollectionTestEnvironment.cs new file mode 100644 index 000000000000..893a056e94f5 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/PurviewCollectionTestEnvironment.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; + +namespace Azure.Analytics.Purview.Account.Tests +{ + public class PurviewCollectionTestEnvironment: TestEnvironment + { + public PurviewCollectionTestEnvironment() + { + } + public Uri Endpoint => new(GetRecordedVariable("PURVIEW_ACCOUNT_URL")); + } +} diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/GetTask.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/GetTask.json new file mode 100644 index 000000000000..ffd60cec98fd --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/GetTask.json @@ -0,0 +1,81 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-c05675d938ab7748a6b1432170b84ffc-37326752cecb244f-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "c8757ea39b6e31f5ad60da2ced4b3d6e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:44:11 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-account-status": "Succeeded", + "x-ms-correlation-request-id": "0c323717-ac91-432a-8ed9-b618cbeaef00" + }, + "ResponseBody": { + "sku": { + "name": "Standard", + "capacity": 1 + }, + "properties": { + "cloudConnectors": { + "awsExternalId": "62c6f480-34d4-48be-b22e-e686d0766e7e" + }, + "friendlyName": "udpatedFriendlyName", + "createdBy": "chunyu@microsoft.com", + "createdByObjectId": "3bbd551e-499a-4607-a978-be16a8e17789", + "createdAt": "2021-08-18T04:55:19.116601Z", + "endpoints": { + "catalog": "https://dotnetllcpurviewaccount.catalog.purview.azure.com", + "scan": "https://dotnetllcpurviewaccount.scan.purview.azure.com", + "guardian": "https://dotnetllcpurviewaccount.guardian.purview.azure.com" + }, + "provisioningState": "Succeeded", + "privateEndpointConnections": [], + "managedResources": { + "resourceGroup": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount", + "storageAccount": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount/providers/Microsoft.Storage/storageAccounts/scaneastus2abhgmpa", + "eventHubNamespace": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount/providers/Microsoft.EventHub/namespaces/Atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f" + }, + "publicNetworkAccess": "Enabled", + "managedResourceGroupName": "managed-rg-dotnetLLCPurviewAccount" + }, + "id": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/dotnetTest/providers/Microsoft.Purview/accounts/dotnetLLCPurviewAccount", + "name": "dotnetLLCPurviewAccount", + "type": "Microsoft.Purview/accounts", + "location": "eastus2", + "identity": { + "type": "SystemAssigned", + "principalId": "f977cbc9-abaa-4aba-9c27-17d3dd704ca4", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {}, + "systemData": { + "createdBy": "chunyu@microsoft.com", + "createdByType": "User", + "createdAt": "2021-08-18T04:55:19.116601Z", + "lastModifiedBy": "chunyu@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-08-18T04:55:19.116601Z" + } + } + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "575287349" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/GetTaskAsync.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/GetTaskAsync.json new file mode 100644 index 000000000000..e35d4dfed1a1 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/GetTaskAsync.json @@ -0,0 +1,81 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-55b643d326068f4a9555ddf1140f5184-51e26e2828c73245-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "89f528707a7c9ecec7fdbebcbe3385db", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:44:12 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-account-status": "Succeeded", + "x-ms-correlation-request-id": "48449a3d-5658-4753-b509-7a1708e0230d" + }, + "ResponseBody": { + "sku": { + "name": "Standard", + "capacity": 1 + }, + "properties": { + "cloudConnectors": { + "awsExternalId": "62c6f480-34d4-48be-b22e-e686d0766e7e" + }, + "friendlyName": "udpatedFriendlyName", + "createdBy": "chunyu@microsoft.com", + "createdByObjectId": "3bbd551e-499a-4607-a978-be16a8e17789", + "createdAt": "2021-08-18T04:55:19.116601Z", + "endpoints": { + "catalog": "https://dotnetllcpurviewaccount.catalog.purview.azure.com", + "scan": "https://dotnetllcpurviewaccount.scan.purview.azure.com", + "guardian": "https://dotnetllcpurviewaccount.guardian.purview.azure.com" + }, + "provisioningState": "Succeeded", + "privateEndpointConnections": [], + "managedResources": { + "resourceGroup": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount", + "storageAccount": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount/providers/Microsoft.Storage/storageAccounts/scaneastus2abhgmpa", + "eventHubNamespace": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount/providers/Microsoft.EventHub/namespaces/Atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f" + }, + "publicNetworkAccess": "Enabled", + "managedResourceGroupName": "managed-rg-dotnetLLCPurviewAccount" + }, + "id": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/dotnetTest/providers/Microsoft.Purview/accounts/dotnetLLCPurviewAccount", + "name": "dotnetLLCPurviewAccount", + "type": "Microsoft.Purview/accounts", + "location": "eastus2", + "identity": { + "type": "SystemAssigned", + "principalId": "f977cbc9-abaa-4aba-9c27-17d3dd704ca4", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {}, + "systemData": { + "createdBy": "chunyu@microsoft.com", + "createdByType": "User", + "createdAt": "2021-08-18T04:55:19.116601Z", + "lastModifiedBy": "chunyu@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-08-18T04:55:19.116601Z" + } + } + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "1856431416" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/ListKeysTask.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/ListKeysTask.json new file mode 100644 index 000000000000..7626460c4b97 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/ListKeysTask.json @@ -0,0 +1,70 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/regeneratekeys?api-version=2019-11-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "34", + "Content-Type": "application/json", + "traceparent": "00-a1f98e7fecbac34fbb62c6427d2b6994-9e333a81e9510541-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "2a379a4c7df55797b8a6d19eb8f16ef9", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "keyType": "PrimaryAtlasKafkaKey" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:48:54 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "3ac84d65-0cfd-4623-a994-cb83c86b22db" + }, + "ResponseBody": { + "atlasKafkaPrimaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=Lp58m4PXPdjA\u002BOKwBT717op3fc/PXtVaPuONkWVVnh0=", + "atlasKafkaSecondaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=GcMVTNPGShESagjYw\u002B\u002BLGPPYfZ1h3Bj1IjL4tdejn9k=" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/listkeys?api-version=2019-11-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-0888dfc11c3193468b7ddef7aab3184f-2aaaed5239d6af4c-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "8e4d4297872ade2f14f1c3a029763aff", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:48:54 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "974f914a-c4db-40aa-b27a-6396b74ee5b5" + }, + "ResponseBody": { + "atlasKafkaPrimaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=Lp58m4PXPdjA\u002BOKwBT717op3fc/PXtVaPuONkWVVnh0=", + "atlasKafkaSecondaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=GcMVTNPGShESagjYw\u002B\u002BLGPPYfZ1h3Bj1IjL4tdejn9k=" + } + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "216070101" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/ListKeysTaskAsync.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/ListKeysTaskAsync.json new file mode 100644 index 000000000000..520cd96f94c1 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/ListKeysTaskAsync.json @@ -0,0 +1,70 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/regeneratekeys?api-version=2019-11-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "34", + "Content-Type": "application/json", + "traceparent": "00-12cbafaae379d44fb5220253dbafda01-3a9cd50adb1fe341-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "e418cff927889314631fd791c9d88a3b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "keyType": "PrimaryAtlasKafkaKey" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:49:02 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "7934f311-5518-4920-810d-8bb9c87723c7" + }, + "ResponseBody": { + "atlasKafkaPrimaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=xre3vpyXezr4nqC4kFt78PXtH2eq7VGZi\u002BJiXfcdU5U=", + "atlasKafkaSecondaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=GcMVTNPGShESagjYw\u002B\u002BLGPPYfZ1h3Bj1IjL4tdejn9k=" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/listkeys?api-version=2019-11-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-8875fd2bd09f8e48aa50779edca524fb-4f0807fd79172247-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "0964116075190ed298f2d904c4ddb07a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:49:03 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "40594ffd-874b-4ec4-a3a1-d0bae7b808c9" + }, + "ResponseBody": { + "atlasKafkaPrimaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=xre3vpyXezr4nqC4kFt78PXtH2eq7VGZi\u002BJiXfcdU5U=", + "atlasKafkaSecondaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=GcMVTNPGShESagjYw\u002B\u002BLGPPYfZ1h3Bj1IjL4tdejn9k=" + } + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "483359474" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/RegenerateKeysTask.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/RegenerateKeysTask.json new file mode 100644 index 000000000000..e64921b4e40b --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/RegenerateKeysTask.json @@ -0,0 +1,41 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/regeneratekeys?api-version=2019-11-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "34", + "Content-Type": "application/json", + "traceparent": "00-ed533dfe68370e479751d1f2e0e4650e-679dc872f169e14f-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "bd3893be470abba7360db0141e299c1f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "keyType": "PrimaryAtlasKafkaKey" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:47:59 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "7fafecf4-f119-40e0-bb2a-6b3d90347d47" + }, + "ResponseBody": { + "atlasKafkaPrimaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=DghPW/ZISiqsExfGFaEwwr2WiB2rjERWMzlhUAOCuPE=", + "atlasKafkaSecondaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=GcMVTNPGShESagjYw\u002B\u002BLGPPYfZ1h3Bj1IjL4tdejn9k=" + } + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "832744196" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/RegenerateKeysTaskAsync.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/RegenerateKeysTaskAsync.json new file mode 100644 index 000000000000..994c0614941d --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/RegenerateKeysTaskAsync.json @@ -0,0 +1,41 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/regeneratekeys?api-version=2019-11-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "34", + "Content-Type": "application/json", + "traceparent": "00-c72dd4792b21ad4aa245706419cbbab6-d079e10ac057964c-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "c8eed6530673feb53528373d966ed705", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "keyType": "PrimaryAtlasKafkaKey" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:48:07 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "70160618-6264-48ea-a6c1-4c2649abc6c7" + }, + "ResponseBody": { + "atlasKafkaPrimaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=TmfpFZBHQcZuAbzxwF2c8XAGWw02mXS/GWMkZmlufLM=", + "atlasKafkaSecondaryEndpoint": "Endpoint=sb://atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f.servicebus.windows.net/;SharedAccessKeyName=AlternateSharedAccessKey;SharedAccessKey=GcMVTNPGShESagjYw\u002B\u002BLGPPYfZ1h3Bj1IjL4tdejn9k=" + } + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "1601155618" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/UpdateTask.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/UpdateTask.json new file mode 100644 index 000000000000..c796cee53ec6 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/UpdateTask.json @@ -0,0 +1,84 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/?api-version=2019-11-01-preview", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "38", + "Content-Type": "application/json", + "traceparent": "00-bd34de1d60498947b2cac08efb36c881-aeb5b27ad611974c-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "8d605e757290c739af404ddc3deadce1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "friendlyName": "udpatedFriendlyName" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:46:49 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "96577d55-bab4-4fe9-a395-d8806347ef52" + }, + "ResponseBody": { + "sku": { + "name": "Standard", + "capacity": 1 + }, + "properties": { + "cloudConnectors": { + "awsExternalId": "62c6f480-34d4-48be-b22e-e686d0766e7e" + }, + "friendlyName": "udpatedFriendlyName", + "createdBy": "chunyu@microsoft.com", + "createdByObjectId": "3bbd551e-499a-4607-a978-be16a8e17789", + "createdAt": "2021-08-18T04:55:19.116601Z", + "endpoints": { + "catalog": "https://dotnetllcpurviewaccount.catalog.purview.azure.com", + "scan": "https://dotnetllcpurviewaccount.scan.purview.azure.com", + "guardian": "https://dotnetllcpurviewaccount.guardian.purview.azure.com" + }, + "provisioningState": "Succeeded", + "privateEndpointConnections": [], + "managedResources": { + "resourceGroup": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount", + "storageAccount": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount/providers/Microsoft.Storage/storageAccounts/scaneastus2abhgmpa", + "eventHubNamespace": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount/providers/Microsoft.EventHub/namespaces/Atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f" + }, + "publicNetworkAccess": "Enabled", + "managedResourceGroupName": "managed-rg-dotnetLLCPurviewAccount" + }, + "id": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/dotnetTest/providers/Microsoft.Purview/accounts/dotnetLLCPurviewAccount", + "name": "dotnetLLCPurviewAccount", + "type": "Microsoft.Purview/accounts", + "location": "eastus2", + "identity": { + "type": "SystemAssigned", + "principalId": "f977cbc9-abaa-4aba-9c27-17d3dd704ca4", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {}, + "systemData": { + "createdBy": "chunyu@microsoft.com", + "createdByType": "User", + "createdAt": "2021-08-18T04:55:19.116601Z", + "lastModifiedBy": "chunyu@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-08-18T04:55:19.116601Z" + } + } + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "584858991" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/UpdateTaskAsync.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/UpdateTaskAsync.json new file mode 100644 index 000000000000..83ba9cf2b649 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/AccountsClientTest/UpdateTaskAsync.json @@ -0,0 +1,84 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/?api-version=2019-11-01-preview", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "38", + "Content-Type": "application/json", + "traceparent": "00-decdd8926c1736488e1f5bc9a7fef8be-5eece6306e1da14f-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "e837ec19be013504068f897cb02a8f42", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "friendlyName": "udpatedFriendlyName" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:46:51 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "ccb39200-f292-44a4-90d9-33450064de89" + }, + "ResponseBody": { + "sku": { + "name": "Standard", + "capacity": 1 + }, + "properties": { + "cloudConnectors": { + "awsExternalId": "62c6f480-34d4-48be-b22e-e686d0766e7e" + }, + "friendlyName": "udpatedFriendlyName", + "createdBy": "chunyu@microsoft.com", + "createdByObjectId": "3bbd551e-499a-4607-a978-be16a8e17789", + "createdAt": "2021-08-18T04:55:19.116601Z", + "endpoints": { + "catalog": "https://dotnetllcpurviewaccount.catalog.purview.azure.com", + "scan": "https://dotnetllcpurviewaccount.scan.purview.azure.com", + "guardian": "https://dotnetllcpurviewaccount.guardian.purview.azure.com" + }, + "provisioningState": "Succeeded", + "privateEndpointConnections": [], + "managedResources": { + "resourceGroup": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount", + "storageAccount": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount/providers/Microsoft.Storage/storageAccounts/scaneastus2abhgmpa", + "eventHubNamespace": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/managed-rg-dotnetLLCPurviewAccount/providers/Microsoft.EventHub/namespaces/Atlas-7fd51f91-de1e-4e8b-a5b6-da64dd299b9f" + }, + "publicNetworkAccess": "Enabled", + "managedResourceGroupName": "managed-rg-dotnetLLCPurviewAccount" + }, + "id": "/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/resourceGroups/dotnetTest/providers/Microsoft.Purview/accounts/dotnetLLCPurviewAccount", + "name": "dotnetLLCPurviewAccount", + "type": "Microsoft.Purview/accounts", + "location": "eastus2", + "identity": { + "type": "SystemAssigned", + "principalId": "f977cbc9-abaa-4aba-9c27-17d3dd704ca4", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "tags": {}, + "systemData": { + "createdBy": "chunyu@microsoft.com", + "createdByType": "User", + "createdAt": "2021-08-18T04:55:19.116601Z", + "lastModifiedBy": "chunyu@microsoft.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-08-18T04:55:19.116601Z" + } + } + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "1739424517" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/CreateOrUpdateTask.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/CreateOrUpdateTask.json new file mode 100644 index 000000000000..3d1961c69fcb --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/CreateOrUpdateTask.json @@ -0,0 +1,122 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/mysubCollection?api-version=2019-11-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "64", + "Content-Type": "application/json", + "traceparent": "00-97eb591a51b8844cae8cb94771a13755-4f84ead2d9199143-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "0f1449582f019d2f3b3e0f0a5e2776f5", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "parentCollection": { + "referenceName": "dotnetLLCPurviewAccount" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:52:44 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "24d3cac0-0f95-4df7-bba1-e4f4defa41c1" + }, + "ResponseBody": { + "name": "mysubCollection", + "friendlyName": "mysubCollection", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:52:44.6070545Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:52:44.6070546Z" + }, + "collectionProvisioningState": "Creating" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/mysubCollection?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-f17a935ab0274d4da6b75a5391aeb717-f0210132b07e434d-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "5563d20befd8259bd8b6dd9f99b204ce", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:52:46 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "c8fac965-e99a-41d0-96db-39ebfcda36e8" + }, + "ResponseBody": { + "name": "mysubCollection", + "friendlyName": "mysubCollection", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:52:44.6070545Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:52:44.6070546Z" + }, + "collectionProvisioningState": "Succeeded" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/mysubCollection?api-version=2019-11-01-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-2b26793566020743ab0928dd75f027a3-4cdaa5ae191c7244-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "a43b4e193246f70518e01733999be75a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Date": "Fri, 20 Aug 2021 06:52:47 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id": "04d75497-6a28-4522-ab17-27bee0c0fb43" + }, + "ResponseBody": [] + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "1677679430" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/CreateOrUpdateTaskAsync.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/CreateOrUpdateTaskAsync.json new file mode 100644 index 000000000000..261228900eeb --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/CreateOrUpdateTaskAsync.json @@ -0,0 +1,164 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/mysubCollection?api-version=2019-11-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "64", + "Content-Type": "application/json", + "traceparent": "00-7a4a9c849f878a4d91a858420fafcfe4-0e03f345b9b6784d-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "3e2d17f8dacaf083b0bb9b4152b8046f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "parentCollection": { + "referenceName": "dotnetLLCPurviewAccount" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:52:49 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "d2647011-24bd-4a41-97b7-5f7072ebbf0d" + }, + "ResponseBody": { + "name": "mysubCollection", + "friendlyName": "mysubCollection", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:52:50.1553477Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:52:50.1553478Z" + }, + "collectionProvisioningState": "Creating" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/mysubCollection?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-9de4cfed016ff44e916d705a7307e1a6-e06945b9c4885340-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "c7704b8a22ad784c7533901ba51876dd", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:52:51 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "9911e41b-b81c-4264-967e-e90a98f41d3e" + }, + "ResponseBody": { + "name": "mysubCollection", + "friendlyName": "mysubCollection", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:52:50.1553477Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:52:50.1553478Z" + }, + "collectionProvisioningState": "Creating" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/mysubCollection?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-f4d892d857526240b43f138c91b4d20f-2e128b84b869cc4e-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "d29e33a6a3ae50f75245339903b2c520", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:52:53 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "532dc21b-ab5a-4762-a422-5d692e9ca796" + }, + "ResponseBody": { + "name": "mysubCollection", + "friendlyName": "mysubCollection", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:52:50.1553477Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:52:50.1553478Z" + }, + "collectionProvisioningState": "Succeeded" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/mysubCollection?api-version=2019-11-01-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-7264da64c59aa742947a35692c238755-300736fe9d1d1945-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "df651eb5d750d6b9cbb5c99749684a97", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Date": "Fri, 20 Aug 2021 06:52:53 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id": "1a681f71-5b28-4f34-b8d0-fafbd7a1100f" + }, + "ResponseBody": [] + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "1001014761" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/GetTask.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/GetTask.json new file mode 100644 index 000000000000..78e848f47132 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/GetTask.json @@ -0,0 +1,164 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/myCollection1?api-version=2019-11-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "64", + "Content-Type": "application/json", + "traceparent": "00-ced80a7cfe4a844284812604e0556928-e1b17f2111993946-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "63a979a1c271186cddcbb125a6acc6ec", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "parentCollection": { + "referenceName": "dotnetLLCPurviewAccount" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:53:39 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "5fff8fab-ae83-4ba1-8aaf-a2555c163082" + }, + "ResponseBody": { + "name": "myCollection1", + "friendlyName": "myCollection1", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:53:40.0137865Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:53:40.0137866Z" + }, + "collectionProvisioningState": "Creating" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/myCollection1?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-54a0191e72ba194cb38a5676a14aa96d-070ecb23e1dd2b4b-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "38b42ec54fbd0314bb61fb83eb2153d6", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:53:40 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "d8f51d22-bc59-46d8-bf2c-df9f475dec08" + }, + "ResponseBody": { + "name": "myCollection1", + "friendlyName": "myCollection1", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:53:40.0137865Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:53:40.0137866Z" + }, + "collectionProvisioningState": "Creating" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/myCollection1?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-81a3c007a300e346ba78ce77e10e9a6a-61e4df48eb3af742-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "25880ebebc805d23f214acbb981384e3", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:53:41 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "ee2acb10-4e2d-454c-ac40-228354aed7d2" + }, + "ResponseBody": { + "name": "myCollection1", + "friendlyName": "myCollection1", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:53:40.0137865Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:53:40.0137866Z" + }, + "collectionProvisioningState": "Succeeded" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/myCollection1?api-version=2019-11-01-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-410a0382a474a74382fef1e7d4182b9d-fc6705ccb83db048-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "caff32f5dfb0511a65a6a80fc7e82cbc", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Date": "Fri, 20 Aug 2021 06:53:42 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id": "3ccb1118-590b-46ef-9e16-2b9d0c02fdb1" + }, + "ResponseBody": [] + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "403042195" + } +} \ No newline at end of file diff --git a/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/GetTaskAsync.json b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/GetTaskAsync.json new file mode 100644 index 000000000000..22d242d69c06 --- /dev/null +++ b/sdk/purview/Azure.Analytics.Purview.Account/tests/SessionRecords/CollectionsClientTest/GetTaskAsync.json @@ -0,0 +1,206 @@ +{ + "Entries": [ + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/myCollection1?api-version=2019-11-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "64", + "Content-Type": "application/json", + "traceparent": "00-6beca710d3092f41adaef7a24e6ed17d-c433f7aef66a5e4f-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "4d4ea21d6612c4be0eee6b159a9fe963", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "parentCollection": { + "referenceName": "dotnetLLCPurviewAccount" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:53:44 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "0a0d2389-26c2-4ad1-912e-266be9dab06e" + }, + "ResponseBody": { + "name": "myCollection1", + "friendlyName": "myCollection1", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:53:45.4716995Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:53:45.4716996Z" + }, + "collectionProvisioningState": "Creating" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/myCollection1?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-68d2baddd6b72647bdd85c71ec7cc26a-6996f1d18d5b8447-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "a3e80296ecf8c12f0d88253b15cafc01", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:53:45 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "70dc53f6-c46d-4080-ad59-e77b6bea272b" + }, + "ResponseBody": { + "name": "myCollection1", + "friendlyName": "myCollection1", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:53:45.4716995Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:53:45.4716996Z" + }, + "collectionProvisioningState": "Creating" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/myCollection1?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-8d940852cde57f4a88081666b52a3ccf-5b49c9b061465547-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "c8f23197895472e25b95641bcf2edb13", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:53:46 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "64e201d9-b465-4536-8da4-11ec58c44300" + }, + "ResponseBody": { + "name": "myCollection1", + "friendlyName": "myCollection1", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:53:45.4716995Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:53:45.4716996Z" + }, + "collectionProvisioningState": "Creating" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/myCollection1?api-version=2019-11-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-0e649de0d6deab408e9910a180e680e0-cef3031e9fd5ba4d-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "a0bc67917ddd30a0738c3f8a4183ae43", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 20 Aug 2021 06:53:48 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "14ff695a-8483-4d0f-927d-ab05b76f7a55" + }, + "ResponseBody": { + "name": "myCollection1", + "friendlyName": "myCollection1", + "parentCollection": { + "type": "CollectionReference", + "referenceName": "dotnetllcpurviewaccount" + }, + "systemData": { + "createdBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "createdByType": "Application", + "createdAt": "2021-08-20T06:53:45.4716995Z", + "lastModifiedBy": "4faa32fd-963a-464d-b6bf-c12cf48c0317", + "lastModifiedByType": "Application", + "lastModifiedAt": "2021-08-20T06:53:45.4716996Z" + }, + "collectionProvisioningState": "Succeeded" + } + }, + { + "RequestUri": "https://dotnetllcpurviewaccount.purview.azure.com/collections/myCollection1?api-version=2019-11-01-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-975151e6a942244cb6eb72c5283f6539-0da9e056da563049-00", + "User-Agent": [ + "azsdk-net-Analytics.Purview.Account/1.0.0-alpha.20210820.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "687d6af220ad0d0e207648628814f1df", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Date": "Fri, 20 Aug 2021 06:53:48 GMT", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id": "dd5ab0e9-60f4-4113-869b-48c3c1a14fbb" + }, + "ResponseBody": [] + } + ], + "Variables": { + "PURVIEW_ACCOUNT_URL": "https://dotnetLLCPurviewAccount.purview.azure.com", + "RandomSeed": "391599712" + } +} \ No newline at end of file diff --git a/sdk/purview/ci.yml b/sdk/purview/ci.yml index 8421be6f7903..daa8964e04c1 100644 --- a/sdk/purview/ci.yml +++ b/sdk/purview/ci.yml @@ -26,6 +26,8 @@ extends: ServiceDirectory: purview ArtifactName: packages Artifacts: + - name: Azure.Analytics.Purview.Account + safeName: AzureAnalyticsPurviewAccount - name: Azure.Analytics.Purview.Catalog safeName: AzureAnalyticsPurviewCatalog - name: Azure.Analytics.Purview.Scanning