diff --git a/eng/mgmt/mgmtmetadata/purview_resource-manager.txt b/eng/mgmt/mgmtmetadata/purview_resource-manager.txt new file mode 100644 index 000000000000..68f753fa05ba --- /dev/null +++ b/eng/mgmt/mgmtmetadata/purview_resource-manager.txt @@ -0,0 +1,14 @@ +Installing AutoRest version: v2 +AutoRest installed successfully. +Commencing code generation +Generating CSharp code +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/purview/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-12-01-preview --csharp-sdks-folder=D:\enlist\arm\azure-sdk-for-net\sdk +2021-02-09 01:22:48 UTC +Azure-rest-api-specs repository information +GitHub fork: Azure +Branch: master +Commit: 7d69475bd0007aa1156e6ec96882436b7b13709d +AutoRest information +Requested version: v2 +Bootstrapper version: autorest@2.0.4413 diff --git a/eng/pipelines/mgmt.yml b/eng/pipelines/mgmt.yml index 1a70feec23eb..94d588a82e92 100644 --- a/eng/pipelines/mgmt.yml +++ b/eng/pipelines/mgmt.yml @@ -114,6 +114,7 @@ pr: - sdk/postgresql/Microsoft.Azure.Management.PostgreSQL - sdk/powerbidedicated/Microsoft.Azure.Management.PowerBIDedicated - sdk/privatedns/Microsoft.Azure.Management.PrivateDns + - sdk/purview/Microsoft.Azure.Management.Purview - sdk/quantum/Microsoft.Azure.Management.Quantum - sdk/recoveryservices/Microsoft.Azure.Management.RecoveryServices - sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup diff --git a/sdk/purview/AzSdk.RP.props b/sdk/purview/AzSdk.RP.props new file mode 100644 index 000000000000..dd5840701bce --- /dev/null +++ b/sdk/purview/AzSdk.RP.props @@ -0,0 +1,7 @@ + + + + Purview_2020-12-01-preview; + $(PackageTags);$(CommonTags);$(AzureApiTag); + + \ No newline at end of file diff --git a/sdk/purview/Microsoft.Azure.Management.Purview.sln b/sdk/purview/Microsoft.Azure.Management.Purview.sln new file mode 100644 index 000000000000..2e68640d4453 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Management.Purview.Tests", "Microsoft.Azure.Management.Purview\tests\Microsoft.Azure.Management.Purview.Tests.csproj", "{F4C88094-3A50-433D-A4E8-991C1C1437D9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Management.Purview", "Microsoft.Azure.Management.Purview\src\Microsoft.Azure.Management.Purview.csproj", "{E3EEB27E-8A0A-49BD-ACAD-44717901E489}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F4C88094-3A50-433D-A4E8-991C1C1437D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4C88094-3A50-433D-A4E8-991C1C1437D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4C88094-3A50-433D-A4E8-991C1C1437D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4C88094-3A50-433D-A4E8-991C1C1437D9}.Release|Any CPU.Build.0 = Release|Any CPU + {E3EEB27E-8A0A-49BD-ACAD-44717901E489}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E3EEB27E-8A0A-49BD-ACAD-44717901E489}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E3EEB27E-8A0A-49BD-ACAD-44717901E489}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E3EEB27E-8A0A-49BD-ACAD-44717901E489}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {03003972-6953-4944-A994-8E239F201031} + EndGlobalSection +EndGlobal diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/generate.ps1 b/sdk/purview/Microsoft.Azure.Management.Purview/generate.ps1 new file mode 100644 index 000000000000..30832044f72d --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/generate.ps1 @@ -0,0 +1 @@ +Start-AutoRestCodeGeneration -ResourceProvider "purview/resource-manager" -AutoRestVersion "v2" \ No newline at end of file diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/AccountsOperations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/AccountsOperations.cs new file mode 100644 index 000000000000..1ce4290bbc45 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/AccountsOperations.cs @@ -0,0 +1,2057 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AccountsOperations operations. + /// + internal partial class AccountsOperations : IServiceOperations, IAccountsOperations + { + /// + /// Initializes a new instance of the AccountsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AccountsOperations(PurviewManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PurviewManagementClient + /// + public PurviewManagementClient Client { get; private set; } + + /// + /// Gets the accounts resources by resource group. + /// + /// + /// List accounts in ResourceGroup + /// + /// + /// The resource group name. + /// + /// + /// The skip token. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the accounts resources by subscription. + /// + /// + /// List accounts in Subscription + /// + /// + /// The skip token. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Purview/accounts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the account resource. + /// + /// + /// Get an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update an account resource + /// + /// + /// Creates or updates an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Account account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, account, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the account resource. + /// + /// + /// Deletes an account resource + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Patches the account resource. + /// + /// + /// Updates an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account update parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, accountUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists the keys asynchronous. + /// + /// + /// List the authorization keys associated with this account. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/listkeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Checks the account name availability. + /// + /// + /// Checks if account name is available. + /// + /// + /// The check name availability request. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityRequest checkNameAvailabilityRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (checkNameAvailabilityRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "checkNameAvailabilityRequest"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("checkNameAvailabilityRequest", checkNameAvailabilityRequest); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Purview/checkNameAvailability").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(checkNameAvailabilityRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(checkNameAvailabilityRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update an account resource + /// + /// + /// Creates or updates an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Account account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (account == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "account"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("account", account); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(account != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(account, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the account resource. + /// + /// + /// Deletes an account resource + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Patches the account resource. + /// + /// + /// Updates an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account update parameters. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountUpdateParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountUpdateParameters"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("accountUpdateParameters", accountUpdateParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(accountUpdateParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(accountUpdateParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the accounts resources by resource group. + /// + /// + /// List accounts in ResourceGroup + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the accounts resources by subscription. + /// + /// + /// List accounts in Subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/AccountsOperationsExtensions.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/AccountsOperationsExtensions.cs new file mode 100644 index 000000000000..cce039400aa0 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/AccountsOperationsExtensions.cs @@ -0,0 +1,617 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AccountsOperations. + /// + public static partial class AccountsOperationsExtensions + { + /// + /// Gets the accounts resources by resource group. + /// + /// + /// List accounts in ResourceGroup + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The skip token. + /// + public static IPage ListByResourceGroup(this IAccountsOperations operations, string resourceGroupName, string skipToken = default(string)) + { + return operations.ListByResourceGroupAsync(resourceGroupName, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Gets the accounts resources by resource group. + /// + /// + /// List accounts in ResourceGroup + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The skip token. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IAccountsOperations operations, string resourceGroupName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the accounts resources by subscription. + /// + /// + /// List accounts in Subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The skip token. + /// + public static IPage ListBySubscription(this IAccountsOperations operations, string skipToken = default(string)) + { + return operations.ListBySubscriptionAsync(skipToken).GetAwaiter().GetResult(); + } + + /// + /// Gets the accounts resources by subscription. + /// + /// + /// List accounts in Subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The skip token. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IAccountsOperations operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the account resource. + /// + /// + /// Get an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + public static Account Get(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + return operations.GetAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Gets the account resource. + /// + /// + /// Get an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update an account resource + /// + /// + /// Creates or updates an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account. + /// + public static Account CreateOrUpdate(this IAccountsOperations operations, string resourceGroupName, string accountName, Account account) + { + return operations.CreateOrUpdateAsync(resourceGroupName, accountName, account).GetAwaiter().GetResult(); + } + + /// + /// Create or update an account resource + /// + /// + /// Creates or updates an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, Account account, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, account, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the account resource. + /// + /// + /// Deletes an account resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + public static void Delete(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the account resource. + /// + /// + /// Deletes an account resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Patches the account resource. + /// + /// + /// Updates an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account update parameters. + /// + public static Account Update(this IAccountsOperations operations, string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters) + { + return operations.UpdateAsync(resourceGroupName, accountName, accountUpdateParameters).GetAwaiter().GetResult(); + } + + /// + /// Patches the account resource. + /// + /// + /// Updates an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account update parameters. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, accountUpdateParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the keys asynchronous. + /// + /// + /// List the authorization keys associated with this account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + public static AccessKeys ListKeys(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + return operations.ListKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Lists the keys asynchronous. + /// + /// + /// List the authorization keys associated with this account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The cancellation token. + /// + public static async Task ListKeysAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Checks the account name availability. + /// + /// + /// Checks if account name is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The check name availability request. + /// + public static CheckNameAvailabilityResult CheckNameAvailability(this IAccountsOperations operations, CheckNameAvailabilityRequest checkNameAvailabilityRequest) + { + return operations.CheckNameAvailabilityAsync(checkNameAvailabilityRequest).GetAwaiter().GetResult(); + } + + /// + /// Checks the account name availability. + /// + /// + /// Checks if account name is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The check name availability request. + /// + /// + /// The cancellation token. + /// + public static async Task CheckNameAvailabilityAsync(this IAccountsOperations operations, CheckNameAvailabilityRequest checkNameAvailabilityRequest, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(checkNameAvailabilityRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update an account resource + /// + /// + /// Creates or updates an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account. + /// + public static Account BeginCreateOrUpdate(this IAccountsOperations operations, string resourceGroupName, string accountName, Account account) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, accountName, account).GetAwaiter().GetResult(); + } + + /// + /// Create or update an account resource + /// + /// + /// Creates or updates an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, Account account, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, account, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the account resource. + /// + /// + /// Deletes an account resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + public static void BeginDelete(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + operations.BeginDeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the account resource. + /// + /// + /// Deletes an account resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Patches the account resource. + /// + /// + /// Updates an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account update parameters. + /// + public static Account BeginUpdate(this IAccountsOperations operations, string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters) + { + return operations.BeginUpdateAsync(resourceGroupName, accountName, accountUpdateParameters).GetAwaiter().GetResult(); + } + + /// + /// Patches the account resource. + /// + /// + /// Updates an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account update parameters. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, accountUpdateParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the accounts resources by resource group. + /// + /// + /// List accounts in ResourceGroup + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IAccountsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the accounts resources by resource group. + /// + /// + /// List accounts in ResourceGroup + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the accounts resources by subscription. + /// + /// + /// List accounts in Subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IAccountsOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the accounts resources by subscription. + /// + /// + /// List accounts in Subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this IAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/DefaultAccountsOperations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/DefaultAccountsOperations.cs new file mode 100644 index 000000000000..4da460e49c9f --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/DefaultAccountsOperations.cs @@ -0,0 +1,614 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DefaultAccountsOperations operations. + /// + internal partial class DefaultAccountsOperations : IServiceOperations, IDefaultAccountsOperations + { + /// + /// Initializes a new instance of the DefaultAccountsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DefaultAccountsOperations(PurviewManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PurviewManagementClient + /// + public PurviewManagementClient Client { get; private set; } + + /// + /// Gets the default account information set for the scope. + /// + /// + /// Get the default account for the scope. + /// + /// + /// The tenant ID. + /// + /// + /// The scope for the default account. Possible values include: 'Tenant', + /// 'Subscription' + /// + /// + /// The Id of the scope object, for example if the scope is "Subscription" then + /// it is the ID of that subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(System.Guid scopeTenantId, string scopeType, string scope = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scopeType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopeType"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("scopeTenantId", scopeTenantId); + tracingParameters.Add("scopeType", scopeType); + tracingParameters.Add("scope", scope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Purview/getDefaultAccount").ToString(); + List _queryParameters = new List(); + _queryParameters.Add(string.Format("scopeTenantId={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(scopeTenantId, Client.SerializationSettings).Trim('"')))); + if (scopeType != null) + { + _queryParameters.Add(string.Format("scopeType={0}", System.Uri.EscapeDataString(scopeType))); + } + if (scope != null) + { + _queryParameters.Add(string.Format("scope={0}", System.Uri.EscapeDataString(scope))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Sets the default account for the scope. + /// + /// + /// Set the default account for the scope. + /// + /// + /// The payload containing the default account information and the scope. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> SetWithHttpMessagesAsync(DefaultAccountPayload defaultAccountPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (defaultAccountPayload == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "defaultAccountPayload"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("defaultAccountPayload", defaultAccountPayload); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Set", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Purview/setDefaultAccount").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(defaultAccountPayload != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(defaultAccountPayload, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Removes the default account from the scope. + /// + /// + /// Remove the default account from the scope. + /// + /// + /// The tenant ID. + /// + /// + /// The scope for the default account. Possible values include: 'Tenant', + /// 'Subscription' + /// + /// + /// The Id of the scope object, for example if the scope is "Subscription" then + /// it is the ID of that subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task RemoveWithHttpMessagesAsync(System.Guid scopeTenantId, string scopeType, string scope = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scopeType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopeType"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("scopeTenantId", scopeTenantId); + tracingParameters.Add("scopeType", scopeType); + tracingParameters.Add("scope", scope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Remove", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Purview/removeDefaultAccount").ToString(); + List _queryParameters = new List(); + _queryParameters.Add(string.Format("scopeTenantId={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(scopeTenantId, Client.SerializationSettings).Trim('"')))); + if (scopeType != null) + { + _queryParameters.Add(string.Format("scopeType={0}", System.Uri.EscapeDataString(scopeType))); + } + if (scope != null) + { + _queryParameters.Add(string.Format("scope={0}", System.Uri.EscapeDataString(scope))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/DefaultAccountsOperationsExtensions.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/DefaultAccountsOperationsExtensions.cs new file mode 100644 index 000000000000..e2920cd1934b --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/DefaultAccountsOperationsExtensions.cs @@ -0,0 +1,174 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DefaultAccountsOperations. + /// + public static partial class DefaultAccountsOperationsExtensions + { + /// + /// Gets the default account information set for the scope. + /// + /// + /// Get the default account for the scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The tenant ID. + /// + /// + /// The scope for the default account. Possible values include: 'Tenant', + /// 'Subscription' + /// + /// + /// The Id of the scope object, for example if the scope is "Subscription" then + /// it is the ID of that subscription. + /// + public static DefaultAccountPayload Get(this IDefaultAccountsOperations operations, System.Guid scopeTenantId, string scopeType, string scope = default(string)) + { + return operations.GetAsync(scopeTenantId, scopeType, scope).GetAwaiter().GetResult(); + } + + /// + /// Gets the default account information set for the scope. + /// + /// + /// Get the default account for the scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The tenant ID. + /// + /// + /// The scope for the default account. Possible values include: 'Tenant', + /// 'Subscription' + /// + /// + /// The Id of the scope object, for example if the scope is "Subscription" then + /// it is the ID of that subscription. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDefaultAccountsOperations operations, System.Guid scopeTenantId, string scopeType, string scope = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(scopeTenantId, scopeType, scope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Sets the default account for the scope. + /// + /// + /// Set the default account for the scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The payload containing the default account information and the scope. + /// + public static DefaultAccountPayload Set(this IDefaultAccountsOperations operations, DefaultAccountPayload defaultAccountPayload) + { + return operations.SetAsync(defaultAccountPayload).GetAwaiter().GetResult(); + } + + /// + /// Sets the default account for the scope. + /// + /// + /// Set the default account for the scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The payload containing the default account information and the scope. + /// + /// + /// The cancellation token. + /// + public static async Task SetAsync(this IDefaultAccountsOperations operations, DefaultAccountPayload defaultAccountPayload, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.SetWithHttpMessagesAsync(defaultAccountPayload, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Removes the default account from the scope. + /// + /// + /// Remove the default account from the scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The tenant ID. + /// + /// + /// The scope for the default account. Possible values include: 'Tenant', + /// 'Subscription' + /// + /// + /// The Id of the scope object, for example if the scope is "Subscription" then + /// it is the ID of that subscription. + /// + public static void Remove(this IDefaultAccountsOperations operations, System.Guid scopeTenantId, string scopeType, string scope = default(string)) + { + operations.RemoveAsync(scopeTenantId, scopeType, scope).GetAwaiter().GetResult(); + } + + /// + /// Removes the default account from the scope. + /// + /// + /// Remove the default account from the scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The tenant ID. + /// + /// + /// The scope for the default account. Possible values include: 'Tenant', + /// 'Subscription' + /// + /// + /// The Id of the scope object, for example if the scope is "Subscription" then + /// it is the ID of that subscription. + /// + /// + /// The cancellation token. + /// + public static async Task RemoveAsync(this IDefaultAccountsOperations operations, System.Guid scopeTenantId, string scopeType, string scope = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RemoveWithHttpMessagesAsync(scopeTenantId, scopeType, scope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IAccountsOperations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IAccountsOperations.cs new file mode 100644 index 000000000000..32739c52e72c --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IAccountsOperations.cs @@ -0,0 +1,385 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AccountsOperations operations. + /// + public partial interface IAccountsOperations + { + /// + /// Gets the accounts resources by resource group. + /// + /// + /// List accounts in ResourceGroup + /// + /// + /// The resource group name. + /// + /// + /// The skip token. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the accounts resources by subscription. + /// + /// + /// List accounts in Subscription + /// + /// + /// The skip token. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySubscriptionWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the account resource. + /// + /// + /// Get an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update an account resource + /// + /// + /// Creates or updates an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Account account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the account resource. + /// + /// + /// Deletes an account resource + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Patches the account resource. + /// + /// + /// Updates an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account update parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the keys asynchronous. + /// + /// + /// List the authorization keys associated with this account. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Checks the account name availability. + /// + /// + /// Checks if account name is available. + /// + /// + /// The check name availability request. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityRequest checkNameAvailabilityRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update an account resource + /// + /// + /// Creates or updates an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Account account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the account resource. + /// + /// + /// Deletes an account resource + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Patches the account resource. + /// + /// + /// Updates an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The account update parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the accounts resources by resource group. + /// + /// + /// List accounts in ResourceGroup + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the accounts resources by subscription. + /// + /// + /// List accounts in Subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IDefaultAccountsOperations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IDefaultAccountsOperations.cs new file mode 100644 index 000000000000..387922ee8224 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IDefaultAccountsOperations.cs @@ -0,0 +1,116 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DefaultAccountsOperations operations. + /// + public partial interface IDefaultAccountsOperations + { + /// + /// Gets the default account information set for the scope. + /// + /// + /// Get the default account for the scope. + /// + /// + /// The tenant ID. + /// + /// + /// The scope for the default account. Possible values include: + /// 'Tenant', 'Subscription' + /// + /// + /// The Id of the scope object, for example if the scope is + /// "Subscription" then it is the ID of that subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(System.Guid scopeTenantId, string scopeType, string scope = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Sets the default account for the scope. + /// + /// + /// Set the default account for the scope. + /// + /// + /// The payload containing the default account information and the + /// scope. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> SetWithHttpMessagesAsync(DefaultAccountPayload defaultAccountPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Removes the default account from the scope. + /// + /// + /// Remove the default account from the scope. + /// + /// + /// The tenant ID. + /// + /// + /// The scope for the default account. Possible values include: + /// 'Tenant', 'Subscription' + /// + /// + /// The Id of the scope object, for example if the scope is + /// "Subscription" then it is the ID of that subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RemoveWithHttpMessagesAsync(System.Guid scopeTenantId, string scopeType, string scope = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IOperations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IOperations.cs new file mode 100644 index 000000000000..9004ed0b17cc --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IOperations.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists the available operations + /// + /// + /// List of available operations + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the available operations + /// + /// + /// List of available operations + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IPrivateEndpointConnectionsOperations.cs new file mode 100644 index 000000000000..d8842a20c699 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -0,0 +1,204 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + public partial interface IPrivateEndpointConnectionsOperations + { + /// + /// Gets private endpoint connections. + /// + /// + /// Get private endpoint connections for account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The skip token. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets private endpoint connection information. + /// + /// + /// Get a private endpoint connection + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approves/Rejects private endpoint connection request. + /// + /// + /// Create or update a private endpoint connection + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The request. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes private endpoint connection. + /// + /// + /// Delete a private endpoint connection + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes private endpoint connection. + /// + /// + /// Delete a private endpoint connection + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets private endpoint connections. + /// + /// + /// Get private endpoint connections for account + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IPrivateLinkResourcesOperations.cs new file mode 100644 index 000000000000..3fd4aca2eb52 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IPrivateLinkResourcesOperations.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + public partial interface IPrivateLinkResourcesOperations + { + /// + /// Gets a list of privately linkable resources for an account. + /// + /// + /// Gets a list of privately linkable resources for an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a privately linkable resources for an account with given group + /// identifier. + /// + /// + /// Gets a privately linkable resources for an account with given group + /// identifier + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The group identifier. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetByGroupIdWithHttpMessagesAsync(string resourceGroupName, string accountName, string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of privately linkable resources for an account. + /// + /// + /// Gets a list of privately linkable resources for an account + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IPurviewManagementClient.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IPurviewManagementClient.cs new file mode 100644 index 000000000000..5fc0dd92da0f --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/IPurviewManagementClient.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// Creates a Microsoft.Purview management client. + /// + public partial interface IPurviewManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// The api version to use. + /// + string ApiVersion { get; } + + /// + /// The subscription identifier + /// + string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IAccountsOperations. + /// + IAccountsOperations Accounts { get; } + + /// + /// Gets the IDefaultAccountsOperations. + /// + IDefaultAccountsOperations DefaultAccounts { get; } + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccessKeys.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccessKeys.cs new file mode 100644 index 000000000000..835973afee73 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccessKeys.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Account access keys. + /// + public partial class AccessKeys + { + /// + /// Initializes a new instance of the AccessKeys class. + /// + public AccessKeys() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccessKeys class. + /// + /// Gets or sets the primary + /// connection string. + /// Gets or sets the + /// secondary connection string. + public AccessKeys(string atlasKafkaPrimaryEndpoint = default(string), string atlasKafkaSecondaryEndpoint = default(string)) + { + AtlasKafkaPrimaryEndpoint = atlasKafkaPrimaryEndpoint; + AtlasKafkaSecondaryEndpoint = atlasKafkaSecondaryEndpoint; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the primary connection string. + /// + [JsonProperty(PropertyName = "atlasKafkaPrimaryEndpoint")] + public string AtlasKafkaPrimaryEndpoint { get; set; } + + /// + /// Gets or sets the secondary connection string. + /// + [JsonProperty(PropertyName = "atlasKafkaSecondaryEndpoint")] + public string AtlasKafkaSecondaryEndpoint { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Account.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Account.cs new file mode 100644 index 000000000000..93bdac4e5e5c --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Account.cs @@ -0,0 +1,160 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Account resource + /// + [Rest.Serialization.JsonTransformation] + public partial class Account : TrackedResource + { + /// + /// Initializes a new instance of the Account class. + /// + public Account() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Account class. + /// + /// Gets or sets the identifier. + /// Identity Info on the tracked + /// resource + /// Gets or sets the location. + /// Gets or sets the name. + /// Tags on the azure resource. + /// Gets or sets the type. + /// Cloud connectors. + /// External cloud identifier used as part of scanning + /// configuration. + /// Gets the time at which the entity was + /// created. + /// Gets the creator of the entity. + /// Gets the creators of the entity's + /// object id. + /// The URIs that are the public endpoints of + /// the account. + /// Gets or sets the friendly name. + /// Gets the resource identifiers of the + /// managed resources. + /// Gets the private endpoint + /// connections information. + /// Gets or sets the state of the + /// provisioning. Possible values include: 'Unknown', 'Creating', + /// 'Moving', 'Deleting', 'SoftDeleting', 'SoftDeleted', 'Failed', + /// 'Succeeded' + /// Gets or sets the public network + /// access. Possible values include: 'NotSpecified', 'Enabled', + /// 'Disabled' + /// Gets or sets the Sku. + public Account(string id = default(string), Identity identity = default(Identity), string location = default(string), string name = default(string), IDictionary tags = default(IDictionary), string type = default(string), CloudConnectors cloudConnectors = default(CloudConnectors), System.DateTime? createdAt = default(System.DateTime?), string createdBy = default(string), string createdByObjectId = default(string), AccountPropertiesEndpoints endpoints = default(AccountPropertiesEndpoints), string friendlyName = default(string), AccountPropertiesManagedResources managedResources = default(AccountPropertiesManagedResources), IList privateEndpointConnections = default(IList), string provisioningState = default(string), string publicNetworkAccess = default(string), AccountSku sku = default(AccountSku)) + : base(id, identity, location, name, tags, type) + { + CloudConnectors = cloudConnectors; + CreatedAt = createdAt; + CreatedBy = createdBy; + CreatedByObjectId = createdByObjectId; + Endpoints = endpoints; + FriendlyName = friendlyName; + ManagedResources = managedResources; + PrivateEndpointConnections = privateEndpointConnections; + ProvisioningState = provisioningState; + PublicNetworkAccess = publicNetworkAccess; + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets cloud connectors. + /// External cloud identifier used as part of scanning configuration. + /// + [JsonProperty(PropertyName = "properties.cloudConnectors")] + public CloudConnectors CloudConnectors { get; set; } + + /// + /// Gets the time at which the entity was created. + /// + [JsonProperty(PropertyName = "properties.createdAt")] + public System.DateTime? CreatedAt { get; private set; } + + /// + /// Gets the creator of the entity. + /// + [JsonProperty(PropertyName = "properties.createdBy")] + public string CreatedBy { get; private set; } + + /// + /// Gets the creators of the entity's object id. + /// + [JsonProperty(PropertyName = "properties.createdByObjectId")] + public string CreatedByObjectId { get; private set; } + + /// + /// Gets the URIs that are the public endpoints of the account. + /// + [JsonProperty(PropertyName = "properties.endpoints")] + public AccountPropertiesEndpoints Endpoints { get; private set; } + + /// + /// Gets or sets the friendly name. + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; private set; } + + /// + /// Gets the resource identifiers of the managed resources. + /// + [JsonProperty(PropertyName = "properties.managedResources")] + public AccountPropertiesManagedResources ManagedResources { get; private set; } + + /// + /// Gets the private endpoint connections information. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; private set; } + + /// + /// Gets or sets the state of the provisioning. Possible values + /// include: 'Unknown', 'Creating', 'Moving', 'Deleting', + /// 'SoftDeleting', 'SoftDeleted', 'Failed', 'Succeeded' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the public network access. Possible values include: + /// 'NotSpecified', 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + + /// + /// Gets or sets the Sku. + /// + [JsonProperty(PropertyName = "sku")] + public AccountSku Sku { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountEndpoints.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountEndpoints.cs new file mode 100644 index 000000000000..52a562e5bfbc --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountEndpoints.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The account endpoints + /// + public partial class AccountEndpoints + { + /// + /// Initializes a new instance of the AccountEndpoints class. + /// + public AccountEndpoints() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccountEndpoints class. + /// + /// Gets the catalog endpoint. + /// Gets the guardian endpoint. + /// Gets the scan endpoint. + public AccountEndpoints(string catalog = default(string), string guardian = default(string), string scan = default(string)) + { + Catalog = catalog; + Guardian = guardian; + Scan = scan; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the catalog endpoint. + /// + [JsonProperty(PropertyName = "catalog")] + public string Catalog { get; private set; } + + /// + /// Gets the guardian endpoint. + /// + [JsonProperty(PropertyName = "guardian")] + public string Guardian { get; private set; } + + /// + /// Gets the scan endpoint. + /// + [JsonProperty(PropertyName = "scan")] + public string Scan { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountPropertiesEndpoints.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountPropertiesEndpoints.cs new file mode 100644 index 000000000000..312179687ac2 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountPropertiesEndpoints.cs @@ -0,0 +1,46 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using System.Linq; + + /// + /// The URIs that are the public endpoints of the account. + /// + public partial class AccountPropertiesEndpoints : AccountEndpoints + { + /// + /// Initializes a new instance of the AccountPropertiesEndpoints class. + /// + public AccountPropertiesEndpoints() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccountPropertiesEndpoints class. + /// + /// Gets the catalog endpoint. + /// Gets the guardian endpoint. + /// Gets the scan endpoint. + public AccountPropertiesEndpoints(string catalog = default(string), string guardian = default(string), string scan = default(string)) + : base(catalog, guardian, scan) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountPropertiesManagedResources.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountPropertiesManagedResources.cs new file mode 100644 index 000000000000..1d4275a4a5d5 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountPropertiesManagedResources.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using System.Linq; + + /// + /// Gets the resource identifiers of the managed resources. + /// + public partial class AccountPropertiesManagedResources : ManagedResources + { + /// + /// Initializes a new instance of the AccountPropertiesManagedResources + /// class. + /// + public AccountPropertiesManagedResources() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccountPropertiesManagedResources + /// class. + /// + /// Gets the managed event hub + /// namespace resource identifier. + /// Gets the managed resource group + /// resource identifier. This resource group will host resource + /// dependencies for the account. + /// Gets the managed storage account + /// resource identifier. + public AccountPropertiesManagedResources(string eventHubNamespace = default(string), string resourceGroup = default(string), string storageAccount = default(string)) + : base(eventHubNamespace, resourceGroup, storageAccount) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountSku.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountSku.cs new file mode 100644 index 000000000000..efff94937b7a --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountSku.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Sku + /// + public partial class AccountSku + { + /// + /// Initializes a new instance of the AccountSku class. + /// + public AccountSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccountSku class. + /// + /// Gets or sets the sku capacity. Possible + /// values include: 4, 16 + /// Gets or sets the sku name. Possible values + /// include: 'Standard' + public AccountSku(int? capacity = default(int?), string name = default(string)) + { + Capacity = capacity; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the sku capacity. Possible values include: 4, 16 + /// + [JsonProperty(PropertyName = "capacity")] + public int? Capacity { get; set; } + + /// + /// Gets or sets the sku name. Possible values include: 'Standard' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountUpdateParameters.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountUpdateParameters.cs new file mode 100644 index 000000000000..82b90cb5ed61 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/AccountUpdateParameters.cs @@ -0,0 +1,152 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The account update properties. + /// + [Rest.Serialization.JsonTransformation] + public partial class AccountUpdateParameters + { + /// + /// Initializes a new instance of the AccountUpdateParameters class. + /// + public AccountUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccountUpdateParameters class. + /// + /// Cloud connectors. + /// External cloud identifier used as part of scanning + /// configuration. + /// Gets the time at which the entity was + /// created. + /// Gets the creator of the entity. + /// Gets the creators of the entity's + /// object id. + /// The URIs that are the public endpoints of + /// the account. + /// Gets or sets the friendly name. + /// Gets the resource identifiers of the + /// managed resources. + /// Gets the private endpoint + /// connections information. + /// Gets or sets the state of the + /// provisioning. Possible values include: 'Unknown', 'Creating', + /// 'Moving', 'Deleting', 'SoftDeleting', 'SoftDeleted', 'Failed', + /// 'Succeeded' + /// Gets or sets the public network + /// access. Possible values include: 'NotSpecified', 'Enabled', + /// 'Disabled' + /// Tags on the azure resource. + public AccountUpdateParameters(CloudConnectors cloudConnectors = default(CloudConnectors), System.DateTime? createdAt = default(System.DateTime?), string createdBy = default(string), string createdByObjectId = default(string), AccountPropertiesEndpoints endpoints = default(AccountPropertiesEndpoints), string friendlyName = default(string), AccountPropertiesManagedResources managedResources = default(AccountPropertiesManagedResources), IList privateEndpointConnections = default(IList), string provisioningState = default(string), string publicNetworkAccess = default(string), IDictionary tags = default(IDictionary)) + { + CloudConnectors = cloudConnectors; + CreatedAt = createdAt; + CreatedBy = createdBy; + CreatedByObjectId = createdByObjectId; + Endpoints = endpoints; + FriendlyName = friendlyName; + ManagedResources = managedResources; + PrivateEndpointConnections = privateEndpointConnections; + ProvisioningState = provisioningState; + PublicNetworkAccess = publicNetworkAccess; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets cloud connectors. + /// External cloud identifier used as part of scanning configuration. + /// + [JsonProperty(PropertyName = "properties.cloudConnectors")] + public CloudConnectors CloudConnectors { get; set; } + + /// + /// Gets the time at which the entity was created. + /// + [JsonProperty(PropertyName = "properties.createdAt")] + public System.DateTime? CreatedAt { get; private set; } + + /// + /// Gets the creator of the entity. + /// + [JsonProperty(PropertyName = "properties.createdBy")] + public string CreatedBy { get; private set; } + + /// + /// Gets the creators of the entity's object id. + /// + [JsonProperty(PropertyName = "properties.createdByObjectId")] + public string CreatedByObjectId { get; private set; } + + /// + /// Gets the URIs that are the public endpoints of the account. + /// + [JsonProperty(PropertyName = "properties.endpoints")] + public AccountPropertiesEndpoints Endpoints { get; private set; } + + /// + /// Gets or sets the friendly name. + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; private set; } + + /// + /// Gets the resource identifiers of the managed resources. + /// + [JsonProperty(PropertyName = "properties.managedResources")] + public AccountPropertiesManagedResources ManagedResources { get; private set; } + + /// + /// Gets the private endpoint connections information. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; private set; } + + /// + /// Gets or sets the state of the provisioning. Possible values + /// include: 'Unknown', 'Creating', 'Moving', 'Deleting', + /// 'SoftDeleting', 'SoftDeleted', 'Failed', 'Succeeded' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the public network access. Possible values include: + /// 'NotSpecified', 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + + /// + /// Gets or sets tags on the azure resource. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/CheckNameAvailabilityRequest.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/CheckNameAvailabilityRequest.cs new file mode 100644 index 000000000000..108362636527 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/CheckNameAvailabilityRequest.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The request payload for CheckNameAvailability API + /// + public partial class CheckNameAvailabilityRequest + { + /// + /// Initializes a new instance of the CheckNameAvailabilityRequest + /// class. + /// + public CheckNameAvailabilityRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckNameAvailabilityRequest + /// class. + /// + /// Resource name to verify for availability + /// Fully qualified resource type which includes + /// provider namespace + public CheckNameAvailabilityRequest(string name = default(string), string type = default(string)) + { + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource name to verify for availability + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets fully qualified resource type which includes provider + /// namespace + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/CheckNameAvailabilityResult.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/CheckNameAvailabilityResult.cs new file mode 100644 index 000000000000..70dbfe54bd0b --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/CheckNameAvailabilityResult.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The response payload for CheckNameAvailability API + /// + public partial class CheckNameAvailabilityResult + { + /// + /// Initializes a new instance of the CheckNameAvailabilityResult + /// class. + /// + public CheckNameAvailabilityResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckNameAvailabilityResult + /// class. + /// + /// Error message + /// Indicates if name is valid and + /// available. + /// The reason the name is not available. Possible + /// values include: 'Invalid', 'AlreadyExists' + public CheckNameAvailabilityResult(string message = default(string), bool? nameAvailable = default(bool?), string reason = default(string)) + { + Message = message; + NameAvailable = nameAvailable; + Reason = reason; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error message + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets indicates if name is valid and available. + /// + [JsonProperty(PropertyName = "nameAvailable")] + public bool? NameAvailable { get; set; } + + /// + /// Gets or sets the reason the name is not available. Possible values + /// include: 'Invalid', 'AlreadyExists' + /// + [JsonProperty(PropertyName = "reason")] + public string Reason { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/CloudConnectors.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/CloudConnectors.cs new file mode 100644 index 000000000000..535269879e89 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/CloudConnectors.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties for configuring third party cloud connections. + /// + public partial class CloudConnectors + { + /// + /// Initializes a new instance of the CloudConnectors class. + /// + public CloudConnectors() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudConnectors class. + /// + /// AWS external identifier. + /// Configured in AWS to allow use of the role arn used for + /// scanning + public CloudConnectors(string awsExternalId = default(string)) + { + AwsExternalId = awsExternalId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets AWS external identifier. + /// Configured in AWS to allow use of the role arn used for scanning + /// + [JsonProperty(PropertyName = "awsExternalId")] + public string AwsExternalId { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DefaultAccountPayload.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DefaultAccountPayload.cs new file mode 100644 index 000000000000..33774785b52e --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DefaultAccountPayload.cs @@ -0,0 +1,100 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Payload to get and set the default account in the given scope + /// + public partial class DefaultAccountPayload + { + /// + /// Initializes a new instance of the DefaultAccountPayload class. + /// + public DefaultAccountPayload() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DefaultAccountPayload class. + /// + /// The name of the account that is set as + /// the default. + /// The resource group name of the + /// account that is set as the default. + /// The scope object ID. For example, sub ID or + /// tenant ID. + /// The scope tenant in which the default + /// account is set. + /// The scope where the default account is set. + /// Possible values include: 'Tenant', 'Subscription' + /// The subscription ID of the account + /// that is set as the default. + public DefaultAccountPayload(string accountName = default(string), string resourceGroupName = default(string), string scope = default(string), string scopeTenantId = default(string), string scopeType = default(string), string subscriptionId = default(string)) + { + AccountName = accountName; + ResourceGroupName = resourceGroupName; + Scope = scope; + ScopeTenantId = scopeTenantId; + ScopeType = scopeType; + SubscriptionId = subscriptionId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the account that is set as the default. + /// + [JsonProperty(PropertyName = "accountName")] + public string AccountName { get; set; } + + /// + /// Gets or sets the resource group name of the account that is set as + /// the default. + /// + [JsonProperty(PropertyName = "resourceGroupName")] + public string ResourceGroupName { get; set; } + + /// + /// Gets or sets the scope object ID. For example, sub ID or tenant ID. + /// + [JsonProperty(PropertyName = "scope")] + public string Scope { get; set; } + + /// + /// Gets or sets the scope tenant in which the default account is set. + /// + [JsonProperty(PropertyName = "scopeTenantId")] + public string ScopeTenantId { get; set; } + + /// + /// Gets or sets the scope where the default account is set. Possible + /// values include: 'Tenant', 'Subscription' + /// + [JsonProperty(PropertyName = "scopeType")] + public string ScopeType { get; set; } + + /// + /// Gets or sets the subscription ID of the account that is set as the + /// default. + /// + [JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccount.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccount.cs new file mode 100644 index 000000000000..fde798bc68e1 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccount.cs @@ -0,0 +1,104 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Soft Deleted Account resource + /// + [Rest.Serialization.JsonTransformation] + public partial class DeletedAccount : ProxyResource + { + /// + /// Initializes a new instance of the DeletedAccount class. + /// + public DeletedAccount() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeletedAccount class. + /// + /// Gets or sets the identifier. + /// Gets or sets the name. + /// Gets or sets the type. + /// Gets the account identifier associated with + /// resource. + /// Gets the user identifier that deleted + /// resource. + /// Gets the time at which the resource was + /// soft deleted. + /// Gets the resource location. + /// Gets the scheduled purge + /// datetime. + /// Gets the account tags. + public DeletedAccount(string id = default(string), string name = default(string), string type = default(string), string accountId = default(string), string deletedBy = default(string), System.DateTime? deletionDate = default(System.DateTime?), string location = default(string), System.DateTime? scheduledPurgeDate = default(System.DateTime?), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + AccountId = accountId; + DeletedBy = deletedBy; + DeletionDate = deletionDate; + Location = location; + ScheduledPurgeDate = scheduledPurgeDate; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the account identifier associated with resource. + /// + [JsonProperty(PropertyName = "properties.accountId")] + public string AccountId { get; private set; } + + /// + /// Gets the user identifier that deleted resource. + /// + [JsonProperty(PropertyName = "properties.deletedBy")] + public string DeletedBy { get; private set; } + + /// + /// Gets the time at which the resource was soft deleted. + /// + [JsonProperty(PropertyName = "properties.deletionDate")] + public System.DateTime? DeletionDate { get; private set; } + + /// + /// Gets the resource location. + /// + [JsonProperty(PropertyName = "properties.location")] + public string Location { get; private set; } + + /// + /// Gets the scheduled purge datetime. + /// + [JsonProperty(PropertyName = "properties.scheduledPurgeDate")] + public System.DateTime? ScheduledPurgeDate { get; private set; } + + /// + /// Gets the account tags. + /// + [JsonProperty(PropertyName = "properties.tags")] + public IDictionary Tags { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccountList.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccountList.cs new file mode 100644 index 000000000000..6fe8451d258c --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccountList.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Paged list of soft deleted account resources + /// + public partial class DeletedAccountList + { + /// + /// Initializes a new instance of the DeletedAccountList class. + /// + public DeletedAccountList() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeletedAccountList class. + /// + /// Collection of items of type results. + /// Total item count. + /// The Url of next result page. + public DeletedAccountList(IList value, long? count = default(long?), string nextLink = default(string)) + { + Count = count; + NextLink = nextLink; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets total item count. + /// + [JsonProperty(PropertyName = "count")] + public long? Count { get; set; } + + /// + /// Gets or sets the Url of next result page. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + /// + /// Gets or sets collection of items of type results. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + } + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccountPropertiesModel.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccountPropertiesModel.cs new file mode 100644 index 000000000000..93ffef55515b --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccountPropertiesModel.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The soft deleted account properties + /// + public partial class DeletedAccountPropertiesModel + { + /// + /// Initializes a new instance of the DeletedAccountPropertiesModel + /// class. + /// + public DeletedAccountPropertiesModel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeletedAccountPropertiesModel + /// class. + /// + /// Gets the account identifier associated with + /// resource. + /// Gets the user identifier that deleted + /// resource. + /// Gets the time at which the resource was + /// soft deleted. + /// Gets the resource location. + /// Gets the scheduled purge + /// datetime. + /// Gets the account tags. + public DeletedAccountPropertiesModel(string accountId = default(string), string deletedBy = default(string), System.DateTime? deletionDate = default(System.DateTime?), string location = default(string), System.DateTime? scheduledPurgeDate = default(System.DateTime?), IDictionary tags = default(IDictionary)) + { + AccountId = accountId; + DeletedBy = deletedBy; + DeletionDate = deletionDate; + Location = location; + ScheduledPurgeDate = scheduledPurgeDate; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the account identifier associated with resource. + /// + [JsonProperty(PropertyName = "accountId")] + public string AccountId { get; private set; } + + /// + /// Gets the user identifier that deleted resource. + /// + [JsonProperty(PropertyName = "deletedBy")] + public string DeletedBy { get; private set; } + + /// + /// Gets the time at which the resource was soft deleted. + /// + [JsonProperty(PropertyName = "deletionDate")] + public System.DateTime? DeletionDate { get; private set; } + + /// + /// Gets the resource location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets the scheduled purge datetime. + /// + [JsonProperty(PropertyName = "scheduledPurgeDate")] + public System.DateTime? ScheduledPurgeDate { get; private set; } + + /// + /// Gets the account tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DimensionProperties.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DimensionProperties.cs new file mode 100644 index 000000000000..70be961f5170 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DimensionProperties.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// properties for dimension + /// + public partial class DimensionProperties + { + /// + /// Initializes a new instance of the DimensionProperties class. + /// + public DimensionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DimensionProperties class. + /// + /// localized display name of the dimension + /// to customer + /// dimension name + /// flag indicating whether this + /// dimension should be included to the customer in Azure Monitor logs + /// (aka Shoebox) + public DimensionProperties(string displayName = default(string), string name = default(string), bool? toBeExportedForCustomer = default(bool?)) + { + DisplayName = displayName; + Name = name; + ToBeExportedForCustomer = toBeExportedForCustomer; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets localized display name of the dimension to customer + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets dimension name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets flag indicating whether this dimension should be + /// included to the customer in Azure Monitor logs (aka Shoebox) + /// + [JsonProperty(PropertyName = "toBeExportedForCustomer")] + public bool? ToBeExportedForCustomer { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorModel.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorModel.cs new file mode 100644 index 000000000000..7047bdb5a685 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorModel.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Default error model + /// + public partial class ErrorModel + { + /// + /// Initializes a new instance of the ErrorModel class. + /// + public ErrorModel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorModel class. + /// + /// Gets or sets the code. + /// Gets or sets the details. + /// Gets or sets the messages. + /// Gets or sets the target. + public ErrorModel(string code = default(string), IList details = default(IList), string message = default(string), string target = default(string)) + { + Code = code; + Details = details; + Message = message; + Target = target; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets or sets the details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets or sets the messages. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets or sets the target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorResponseModel.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorResponseModel.cs new file mode 100644 index 000000000000..982d90d68d04 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorResponseModel.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Default error response model + /// + public partial class ErrorResponseModel + { + /// + /// Initializes a new instance of the ErrorResponseModel class. + /// + public ErrorResponseModel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseModel class. + /// + /// Gets or sets the error. + public ErrorResponseModel(ErrorResponseModelError error = default(ErrorResponseModelError)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error. + /// + [JsonProperty(PropertyName = "error")] + public ErrorResponseModelError Error { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorResponseModelError.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorResponseModelError.cs new file mode 100644 index 000000000000..18e1116de34f --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorResponseModelError.cs @@ -0,0 +1,49 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Gets or sets the error. + /// + public partial class ErrorResponseModelError : ErrorModel + { + /// + /// Initializes a new instance of the ErrorResponseModelError class. + /// + public ErrorResponseModelError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseModelError class. + /// + /// Gets or sets the code. + /// Gets or sets the details. + /// Gets or sets the messages. + /// Gets or sets the target. + public ErrorResponseModelError(string code = default(string), IList details = default(IList), string message = default(string), string target = default(string)) + : base(code, details, message, target) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorResponseModelException.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorResponseModelException.cs new file mode 100644 index 000000000000..e0b2e4de9267 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ErrorResponseModelException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponseModel + /// information. + /// + public partial class ErrorResponseModelException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponseModel Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseModelException class. + /// + public ErrorResponseModelException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseModelException class. + /// + /// The exception message. + public ErrorResponseModelException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseModelException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseModelException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Identity.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Identity.cs new file mode 100644 index 000000000000..8ede79c0f64d --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Identity.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Managed Identity of the resource + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + /// Service principal object Id + /// Tenant Id + /// Identity Type. Possible values include: + /// 'SystemAssigned' + public Identity(string principalId = default(string), string tenantId = default(string), string type = default(string)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets service principal object Id + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets tenant Id + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets identity Type. Possible values include: + /// 'SystemAssigned' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ManagedResources.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ManagedResources.cs new file mode 100644 index 000000000000..5398e1d9fc61 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ManagedResources.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The managed resources in customer subscription. + /// + public partial class ManagedResources + { + /// + /// Initializes a new instance of the ManagedResources class. + /// + public ManagedResources() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedResources class. + /// + /// Gets the managed event hub + /// namespace resource identifier. + /// Gets the managed resource group + /// resource identifier. This resource group will host resource + /// dependencies for the account. + /// Gets the managed storage account + /// resource identifier. + public ManagedResources(string eventHubNamespace = default(string), string resourceGroup = default(string), string storageAccount = default(string)) + { + EventHubNamespace = eventHubNamespace; + ResourceGroup = resourceGroup; + StorageAccount = storageAccount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the managed event hub namespace resource identifier. + /// + [JsonProperty(PropertyName = "eventHubNamespace")] + public string EventHubNamespace { get; private set; } + + /// + /// Gets the managed resource group resource identifier. This resource + /// group will host resource dependencies for the account. + /// + [JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets the managed storage account resource identifier. + /// + [JsonProperty(PropertyName = "storageAccount")] + public string StorageAccount { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Name.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Name.cs new file mode 100644 index 000000000000..0ba70f8be55f --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Name.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + + /// + /// Defines values for Name. + /// + public static class Name + { + public const string Standard = "Standard"; + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Operation.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Operation.cs new file mode 100644 index 000000000000..58d2f211296e --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Operation.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Operation resource + /// + [Rest.Serialization.JsonTransformation] + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Properties on the operation + /// Whether operation is a data + /// action + /// Operation name for display purposes + /// origin of the operation + /// meta service + /// specification + public Operation(OperationDisplay display = default(OperationDisplay), bool? isDataAction = default(bool?), string name = default(string), string origin = default(string), OperationMetaServiceSpecification serviceSpecification = default(OperationMetaServiceSpecification)) + { + Display = display; + IsDataAction = isDataAction; + Name = name; + Origin = origin; + ServiceSpecification = serviceSpecification; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets properties on the operation + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + /// + /// Gets or sets whether operation is a data action + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; set; } + + /// + /// Gets or sets operation name for display purposes + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets origin of the operation + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; set; } + + /// + /// Gets or sets meta service specification + /// + [JsonProperty(PropertyName = "properties.serviceSpecification")] + public OperationMetaServiceSpecification ServiceSpecification { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationDisplay.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..f844b1adb8ab --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The response model for get operation properties + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Description of the operation for display + /// purposes + /// Name of the operation for display + /// purposes + /// Name of the provider for display + /// purposes + /// Name of the resource type for display + /// purposes + public OperationDisplay(string description = default(string), string operation = default(string), string provider = default(string), string resource = default(string)) + { + Description = description; + Operation = operation; + Provider = provider; + Resource = resource; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description of the operation for display purposes + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets name of the operation for display purposes + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets name of the provider for display purposes + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets name of the resource type for display purposes + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationMetaLogSpecification.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationMetaLogSpecification.cs new file mode 100644 index 000000000000..a71d6ec0798a --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationMetaLogSpecification.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// log specifications for operation api + /// + public partial class OperationMetaLogSpecification + { + /// + /// Initializes a new instance of the OperationMetaLogSpecification + /// class. + /// + public OperationMetaLogSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationMetaLogSpecification + /// class. + /// + /// blob duration of the log + /// localized name of the log + /// category + /// name of the log category + public OperationMetaLogSpecification(string blobDuration = default(string), string displayName = default(string), string name = default(string)) + { + BlobDuration = blobDuration; + DisplayName = displayName; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets blob duration of the log + /// + [JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration { get; set; } + + /// + /// Gets or sets localized name of the log category + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets name of the log category + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationMetaMetricSpecification.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationMetaMetricSpecification.cs new file mode 100644 index 000000000000..70d3b215657e --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationMetaMetricSpecification.cs @@ -0,0 +1,152 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// metric specifications for the operation + /// + public partial class OperationMetaMetricSpecification + { + /// + /// Initializes a new instance of the OperationMetaMetricSpecification + /// class. + /// + public OperationMetaMetricSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationMetaMetricSpecification + /// class. + /// + /// aggregation type of metric + /// properties for dimension + /// description of the metric + /// localized name of the metric + /// enable regional mdm + /// account + /// internal metric name + /// name of the metric + /// dimension name use to + /// replace resource id if specified + /// Metric namespace. + /// Only set the namespace if different from the default value, + /// leaving it empty makes it use the value from the ARM + /// manifest. + /// supported aggregation + /// types + /// supported time grain + /// types + /// units for the metric + public OperationMetaMetricSpecification(string aggregationType = default(string), IList dimensions = default(IList), string displayDescription = default(string), string displayName = default(string), string enableRegionalMdmAccount = default(string), string internalMetricName = default(string), string name = default(string), string resourceIdDimensionNameOverride = default(string), string sourceMdmNamespace = default(string), IList supportedAggregationTypes = default(IList), IList supportedTimeGrainTypes = default(IList), string unit = default(string)) + { + AggregationType = aggregationType; + Dimensions = dimensions; + DisplayDescription = displayDescription; + DisplayName = displayName; + EnableRegionalMdmAccount = enableRegionalMdmAccount; + InternalMetricName = internalMetricName; + Name = name; + ResourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + SourceMdmNamespace = sourceMdmNamespace; + SupportedAggregationTypes = supportedAggregationTypes; + SupportedTimeGrainTypes = supportedTimeGrainTypes; + Unit = unit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets aggregation type of metric + /// + [JsonProperty(PropertyName = "aggregationType")] + public string AggregationType { get; set; } + + /// + /// Gets or sets properties for dimension + /// + [JsonProperty(PropertyName = "dimensions")] + public IList Dimensions { get; set; } + + /// + /// Gets or sets description of the metric + /// + [JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription { get; set; } + + /// + /// Gets or sets localized name of the metric + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets enable regional mdm account + /// + [JsonProperty(PropertyName = "enableRegionalMdmAccount")] + public string EnableRegionalMdmAccount { get; set; } + + /// + /// Gets or sets internal metric name + /// + [JsonProperty(PropertyName = "internalMetricName")] + public string InternalMetricName { get; set; } + + /// + /// Gets or sets name of the metric + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets dimension name use to replace resource id if specified + /// + [JsonProperty(PropertyName = "resourceIdDimensionNameOverride")] + public string ResourceIdDimensionNameOverride { get; set; } + + /// + /// Gets or sets metric namespace. + /// Only set the namespace if different from the default value, + /// leaving it empty makes it use the value from the ARM manifest. + /// + [JsonProperty(PropertyName = "sourceMdmNamespace")] + public string SourceMdmNamespace { get; set; } + + /// + /// Gets or sets supported aggregation types + /// + [JsonProperty(PropertyName = "supportedAggregationTypes")] + public IList SupportedAggregationTypes { get; set; } + + /// + /// Gets or sets supported time grain types + /// + [JsonProperty(PropertyName = "supportedTimeGrainTypes")] + public IList SupportedTimeGrainTypes { get; set; } + + /// + /// Gets or sets units for the metric + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationMetaServiceSpecification.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationMetaServiceSpecification.cs new file mode 100644 index 000000000000..35b3fd2d2dce --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/OperationMetaServiceSpecification.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The operation meta service specification + /// + public partial class OperationMetaServiceSpecification + { + /// + /// Initializes a new instance of the OperationMetaServiceSpecification + /// class. + /// + public OperationMetaServiceSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationMetaServiceSpecification + /// class. + /// + /// log specifications for the + /// operation + /// metric specifications for the + /// operation + public OperationMetaServiceSpecification(IList logSpecifications = default(IList), IList metricSpecifications = default(IList)) + { + LogSpecifications = logSpecifications; + MetricSpecifications = metricSpecifications; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets log specifications for the operation + /// + [JsonProperty(PropertyName = "logSpecifications")] + public IList LogSpecifications { get; set; } + + /// + /// Gets or sets metric specifications for the operation + /// + [JsonProperty(PropertyName = "metricSpecifications")] + public IList MetricSpecifications { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Page.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Page.cs new file mode 100644 index 000000000000..f1932c95636d --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateEndpoint.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 000000000000..2c835f7f0f76 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A private endpoint class. + /// + public partial class PrivateEndpoint + { + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + public PrivateEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + /// The private endpoint identifier. + public PrivateEndpoint(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the private endpoint identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..99b964ae9d7b --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A private endpoint connection class. + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateEndpointConnection : ProxyResource + { + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + public PrivateEndpointConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + /// Gets or sets the identifier. + /// Gets or sets the name. + /// Gets or sets the type. + /// The private endpoint + /// information. + /// The private link + /// service connection state. + /// The provisioning state. + public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string)) + : base(id, name, type) + { + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the private endpoint information. + /// + [JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint { get; set; } + + /// + /// Gets or sets the private link service connection state. + /// + [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + + /// + /// Gets the provisioning state. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateLinkResource.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 000000000000..d1ed7cc167c8 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A privately linkable resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateLinkResource : ProxyResource + { + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + public PrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + /// Gets or sets the identifier. + /// Gets or sets the name. + /// Gets or sets the type. + /// The private link resource group + /// identifier. + /// This translates to how many Private + /// IPs should be created for each privately linkable resource. + /// The required zone names for private + /// link resource. + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) + : base(id, name, type) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the private link resource group identifier. + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; private set; } + + /// + /// Gets this translates to how many Private IPs should be created for + /// each privately linkable resource. + /// + [JsonProperty(PropertyName = "properties.requiredMembers")] + public IList RequiredMembers { get; private set; } + + /// + /// Gets the required zone names for private link resource. + /// + [JsonProperty(PropertyName = "properties.requiredZoneNames")] + public IList RequiredZoneNames { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateLinkServiceConnectionState.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..c14bed5ce5d7 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The private link service connection state. + /// + public partial class PrivateLinkServiceConnectionState + { + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + public PrivateLinkServiceConnectionState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + /// The required actions. + /// The description. + /// The status. Possible values include: + /// 'Unknown', 'Pending', 'Approved', 'Rejected', + /// 'Disconnected' + public PrivateLinkServiceConnectionState(string actionsRequired = default(string), string description = default(string), string status = default(string)) + { + ActionsRequired = actionsRequired; + Description = description; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the required actions. + /// + [JsonProperty(PropertyName = "actionsRequired")] + public string ActionsRequired { get; set; } + + /// + /// Gets or sets the description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the status. Possible values include: 'Unknown', + /// 'Pending', 'Approved', 'Rejected', 'Disconnected' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ProvisioningState.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..e24650947b21 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + + /// + /// Defines values for ProvisioningState. + /// + public static class ProvisioningState + { + public const string Unknown = "Unknown"; + public const string Creating = "Creating"; + public const string Moving = "Moving"; + public const string Deleting = "Deleting"; + public const string SoftDeleting = "SoftDeleting"; + public const string SoftDeleted = "SoftDeleted"; + public const string Failed = "Failed"; + public const string Succeeded = "Succeeded"; + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ProxyResource.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..4ffcd6e46d8a --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ProxyResource.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Proxy Azure Resource + /// + public partial class ProxyResource : IResource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Gets or sets the identifier. + /// Gets or sets the name. + /// Gets or sets the type. + public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets or sets the name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PublicNetworkAccess.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 000000000000..c9dcb8d818c4 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/PublicNetworkAccess.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + + /// + /// Defines values for PublicNetworkAccess. + /// + public static class PublicNetworkAccess + { + public const string NotSpecified = "NotSpecified"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Reason.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Reason.cs new file mode 100644 index 000000000000..dd46c414689d --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Reason.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + + /// + /// Defines values for Reason. + /// + public static class Reason + { + public const string Invalid = "Invalid"; + public const string AlreadyExists = "AlreadyExists"; + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ScopeType.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ScopeType.cs new file mode 100644 index 000000000000..807f163ac819 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/ScopeType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + + /// + /// Defines values for ScopeType. + /// + public static class ScopeType + { + public const string Tenant = "Tenant"; + public const string Subscription = "Subscription"; + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Status.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Status.cs new file mode 100644 index 000000000000..99f49e7c4e6c --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Status.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + + /// + /// Defines values for Status. + /// + public static class Status + { + public const string Unknown = "Unknown"; + public const string Pending = "Pending"; + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + public const string Disconnected = "Disconnected"; + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/TrackedResource.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/TrackedResource.cs new file mode 100644 index 000000000000..5860366149a2 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/TrackedResource.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure ARM Tracked Resource + /// + public partial class TrackedResource : IResource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + /// Gets or sets the identifier. + /// Identity Info on the tracked + /// resource + /// Gets or sets the location. + /// Gets or sets the name. + /// Tags on the azure resource. + /// Gets or sets the type. + public TrackedResource(string id = default(string), Identity identity = default(Identity), string location = default(string), string name = default(string), IDictionary tags = default(IDictionary), string type = default(string)) + { + Id = id; + Identity = identity; + Location = location; + Name = name; + Tags = tags; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets or sets identity Info on the tracked resource + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + + /// + /// Gets or sets the location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets the name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets tags on the azure resource. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Type.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Type.cs new file mode 100644 index 000000000000..e14e5f56c056 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/Type.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview.Models +{ + + /// + /// Defines values for Type. + /// + public static class Type + { + public const string SystemAssigned = "SystemAssigned"; + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Operations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Operations.cs new file mode 100644 index 000000000000..69de47e05eb9 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Operations.cs @@ -0,0 +1,396 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(PurviewManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PurviewManagementClient + /// + public PurviewManagementClient Client { get; private set; } + + /// + /// Lists the available operations + /// + /// + /// List of available operations + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Purview/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the available operations + /// + /// + /// List of available operations + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/OperationsExtensions.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..0e590f5254c7 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/OperationsExtensions.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists the available operations + /// + /// + /// List of available operations + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists the available operations + /// + /// + /// List of available operations + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the available operations + /// + /// + /// List of available operations + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the available operations + /// + /// + /// List of available operations + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateEndpointConnectionsOperations.cs new file mode 100644 index 000000000000..a08fc1c6dc9b --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,1075 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + internal partial class PrivateEndpointConnectionsOperations : IServiceOperations, IPrivateEndpointConnectionsOperations + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateEndpointConnectionsOperations(PurviewManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PurviewManagementClient + /// + public PurviewManagementClient Client { get; private set; } + + /// + /// Gets private endpoint connections. + /// + /// + /// Get private endpoint connections for account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The skip token. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByAccount", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets private endpoint connection information. + /// + /// + /// Get a private endpoint connection + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Approves/Rejects private endpoint connection request. + /// + /// + /// Create or update a private endpoint connection + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The request. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes private endpoint connection. + /// + /// + /// Delete a private endpoint connection + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes private endpoint connection. + /// + /// + /// Delete a private endpoint connection + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets private endpoint connections. + /// + /// + /// Get private endpoint connections for account + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByAccountNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..215b0e6e9e36 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -0,0 +1,325 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateEndpointConnectionsOperations. + /// + public static partial class PrivateEndpointConnectionsOperationsExtensions + { + /// + /// Gets private endpoint connections. + /// + /// + /// Get private endpoint connections for account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The skip token. + /// + public static IPage ListByAccount(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string skipToken = default(string)) + { + return operations.ListByAccountAsync(resourceGroupName, accountName, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Gets private endpoint connections. + /// + /// + /// Get private endpoint connections for account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The skip token. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAccountAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAccountWithHttpMessagesAsync(resourceGroupName, accountName, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets private endpoint connection information. + /// + /// + /// Get a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName) + { + return operations.GetAsync(resourceGroupName, accountName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets private endpoint connection information. + /// + /// + /// Get a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Approves/Rejects private endpoint connection request. + /// + /// + /// Create or update a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The request. + /// + public static PrivateEndpointConnection CreateOrUpdate(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection request) + { + return operations.CreateOrUpdateAsync(resourceGroupName, accountName, privateEndpointConnectionName, request).GetAwaiter().GetResult(); + } + + /// + /// Approves/Rejects private endpoint connection request. + /// + /// + /// Create or update a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The request. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection request, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, request, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes private endpoint connection. + /// + /// + /// Delete a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + public static void Delete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName) + { + operations.DeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes private endpoint connection. + /// + /// + /// Delete a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes private endpoint connection. + /// + /// + /// Delete a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + public static void BeginDelete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName) + { + operations.BeginDeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes private endpoint connection. + /// + /// + /// Delete a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets private endpoint connections. + /// + /// + /// Get private endpoint connections for account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByAccountNext(this IPrivateEndpointConnectionsOperations operations, string nextPageLink) + { + return operations.ListByAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets private endpoint connections. + /// + /// + /// Get private endpoint connections for account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAccountNextAsync(this IPrivateEndpointConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateLinkResourcesOperations.cs new file mode 100644 index 000000000000..b52b6bb88870 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,624 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + internal partial class PrivateLinkResourcesOperations : IServiceOperations, IPrivateLinkResourcesOperations + { + /// + /// Initializes a new instance of the PrivateLinkResourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateLinkResourcesOperations(PurviewManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PurviewManagementClient + /// + public PurviewManagementClient Client { get; private set; } + + /// + /// Gets a list of privately linkable resources for an account. + /// + /// + /// Gets a list of privately linkable resources for an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByAccount", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a privately linkable resources for an account with given group + /// identifier. + /// + /// + /// Gets a privately linkable resources for an account with given group + /// identifier + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The group identifier. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetByGroupIdWithHttpMessagesAsync(string resourceGroupName, string accountName, string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (groupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("groupId", groupId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetByGroupId", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources/{groupId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of privately linkable resources for an account. + /// + /// + /// Gets a list of privately linkable resources for an account + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByAccountNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponseModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateLinkResourcesOperationsExtensions.cs new file mode 100644 index 000000000000..44e7d347141d --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -0,0 +1,167 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateLinkResourcesOperations. + /// + public static partial class PrivateLinkResourcesOperationsExtensions + { + /// + /// Gets a list of privately linkable resources for an account. + /// + /// + /// Gets a list of privately linkable resources for an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + public static IPage ListByAccount(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName) + { + return operations.ListByAccountAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of privately linkable resources for an account. + /// + /// + /// Gets a list of privately linkable resources for an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAccountAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAccountWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a privately linkable resources for an account with given group + /// identifier. + /// + /// + /// Gets a privately linkable resources for an account with given group + /// identifier + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The group identifier. + /// + public static PrivateLinkResource GetByGroupId(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName, string groupId) + { + return operations.GetByGroupIdAsync(resourceGroupName, accountName, groupId).GetAwaiter().GetResult(); + } + + /// + /// Gets a privately linkable resources for an account with given group + /// identifier. + /// + /// + /// Gets a privately linkable resources for an account with given group + /// identifier + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The name of the account. + /// + /// + /// The group identifier. + /// + /// + /// The cancellation token. + /// + public static async Task GetByGroupIdAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName, string groupId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetByGroupIdWithHttpMessagesAsync(resourceGroupName, accountName, groupId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of privately linkable resources for an account. + /// + /// + /// Gets a list of privately linkable resources for an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByAccountNext(this IPrivateLinkResourcesOperations operations, string nextPageLink) + { + return operations.ListByAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of privately linkable resources for an account. + /// + /// + /// Gets a list of privately linkable resources for an account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAccountNextAsync(this IPrivateLinkResourcesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PurviewManagementClient.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PurviewManagementClient.cs new file mode 100644 index 000000000000..69b1db664f0b --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/PurviewManagementClient.cs @@ -0,0 +1,384 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + /// + /// Creates a Microsoft.Purview management client. + /// + public partial class PurviewManagementClient : ServiceClient, IPurviewManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// The api version to use. + /// + public string ApiVersion { get; private set; } + + /// + /// The subscription identifier + /// + public string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IAccountsOperations. + /// + public virtual IAccountsOperations Accounts { get; private set; } + + /// + /// Gets the IDefaultAccountsOperations. + /// + public virtual IDefaultAccountsOperations DefaultAccounts { get; private set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling PurviewManagementClient.Dispose(). False: will not dispose provided httpClient + protected PurviewManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected PurviewManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected PurviewManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected PurviewManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected PurviewManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PurviewManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling PurviewManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public PurviewManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PurviewManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PurviewManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the PurviewManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public PurviewManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Accounts = new AccountsOperations(this); + DefaultAccounts = new DefaultAccountsOperations(this); + Operations = new Operations(this); + PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2020-12-01-preview"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/SdkInfo_PurviewManagementClient.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/SdkInfo_PurviewManagementClient.cs new file mode 100644 index 000000000000..768b95b1236e --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/SdkInfo_PurviewManagementClient.cs @@ -0,0 +1,31 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Purview +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_PurviewManagementClient + { + get + { + return new Tuple[] + { + new Tuple("Purview", "Accounts", "2020-12-01-preview"), + new Tuple("Purview", "DefaultAccounts", "2020-12-01-preview"), + new Tuple("Purview", "Operations", "2020-12-01-preview"), + new Tuple("Purview", "PrivateEndpointConnections", "2020-12-01-preview"), + new Tuple("Purview", "PrivateLinkResources", "2020-12-01-preview"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Microsoft.Azure.Management.Purview.csproj b/sdk/purview/Microsoft.Azure.Management.Purview/src/Microsoft.Azure.Management.Purview.csproj new file mode 100644 index 000000000000..5864cd681a88 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Microsoft.Azure.Management.Purview.csproj @@ -0,0 +1,26 @@ + + + + + + Microsoft.Azure.Management.Purview + Azure Purview is a unified data governance service that helps you manage and govern your on-premises, multicloud, and software-as-a-service (SaaS) data. + 1.0.0-beta.1 + Microsoft.Azure.Management.Purview + Microsoft Azure resource management;Purview;Goverance + + + + $(SdkTargetFx) + + + false + false + true + + + + + diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/src/Properties/AssemblyInfo.cs b/sdk/purview/Microsoft.Azure.Management.Purview/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..c4c867fd68d6 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/src/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Reflection; +using System.Resources; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft Azure Purview Management Library")] +[assembly: AssemblyDescription("Provides Microsft Azure Purview management functions for managing the Microsoft Azure Purview service.")] + +[assembly: AssemblyVersion("1.0.0.1")] +[assembly: AssemblyFileVersion("1.0.0.1")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] \ No newline at end of file diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/tests/Microsoft.Azure.Management.Purview.Tests.csproj b/sdk/purview/Microsoft.Azure.Management.Purview/tests/Microsoft.Azure.Management.Purview.Tests.csproj new file mode 100644 index 000000000000..5da28732ee4b --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/tests/Microsoft.Azure.Management.Purview.Tests.csproj @@ -0,0 +1,33 @@ + + + + + + Purview.Tests + Purview.Tests Class Library + Purview.Tests + 1.0.0 + + + false + false + + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/tests/ScenarioTests/AccountScenarioTests.cs b/sdk/purview/Microsoft.Azure.Management.Purview/tests/ScenarioTests/AccountScenarioTests.cs new file mode 100644 index 000000000000..f1ad09440358 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/tests/ScenarioTests/AccountScenarioTests.cs @@ -0,0 +1,62 @@ +namespace Purview.Tests.ScenarioTests +{ + using System; + using System.Net; + using System.Threading.Tasks; + using Microsoft.Azure.Management.Purview; + using Microsoft.Azure.Management.Purview.Models; + using Microsoft.Rest.Azure; + using Xunit; + + public class AccountScenarioTests : ScenarioTestBase + { + public Account ExpectedAccount = new Account( + identity: new Identity(type: "SystemAssigned"), + location: ScenarioTestBase.AccountLocation, + sku: new AccountSku(4, "Standard")); + + [Fact] + public async Task AccountCrud() + { + async Task Action(PurviewManagementClient client) + { + await AccountScenarioTests.CreateAsync(client, this.ResourceGroupName, this.AccountName, this.ExpectedAccount); + } + + async Task FinallyAction(PurviewManagementClient client) + { + await AccountScenarioTests.Delete(client, this.ResourceGroupName, this.AccountName); + } + + await this.RunTest(Action, FinallyAction); + } + + internal static async Task CreateAsync( + PurviewManagementClient client, + string resourceGroupName, + string accountName, + Account expectedAccount) + { + AzureOperationResponse createResponse = + await client.Accounts.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, expectedAccount); + AccountScenarioTests.ValidateAccount(createResponse.Body, accountName); + Assert.Equal(HttpStatusCode.OK, createResponse.Response.StatusCode); + } + + private static void ValidateAccount(Account actualAccount, string expectedAccountName) + { + Assert.Equal(expectedAccountName, actualAccount.Name); + Assert.Equal(ScenarioTestBase.AccountLocation, actualAccount.Location); + Assert.Equal("Succeeded", actualAccount.ProvisioningState); + } + + internal static async Task Delete(PurviewManagementClient client, string resourceGroupName, string accountName) + { + AzureOperationResponse deleteResponse = await client.Accounts.DeleteWithHttpMessagesAsync(resourceGroupName, accountName); + Assert.Equal(HttpStatusCode.OK, deleteResponse.Response.StatusCode); + + deleteResponse = await client.Accounts.DeleteWithHttpMessagesAsync(resourceGroupName, accountName); + Assert.Equal(HttpStatusCode.NoContent, deleteResponse.Response.StatusCode); + } + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/tests/ScenarioTests/ScenarioTestBase.cs b/sdk/purview/Microsoft.Azure.Management.Purview/tests/ScenarioTests/ScenarioTestBase.cs new file mode 100644 index 000000000000..1b46c40cdb75 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/tests/ScenarioTests/ScenarioTestBase.cs @@ -0,0 +1,66 @@ +namespace Purview.Tests.ScenarioTests +{ + using System; + using System.Runtime.CompilerServices; + using System.Threading.Tasks; + using Microsoft.Azure.Management.Purview; + using Microsoft.Azure.Management.ResourceManager; + using Microsoft.Azure.Management.ResourceManager.Models; + using Microsoft.Azure.Test.HttpRecorder; + using Microsoft.Rest.ClientRuntime.Azure.TestFramework; + + public abstract class ScenarioTestBase + { + private const string ResourceGroupNamePrefix = "dotnetsdkrg"; + protected const string AccountNamePrefix = "dotnetsdkaccount"; + protected const string AccountLocation = "westus"; + protected static Type Type = typeof(T); + + protected string ResourceGroupName { get; private set; } + protected string AccountName { get; private set; } + protected PurviewManagementClient Client { get; private set; } + + protected async Task RunTest( + Func initialAction, + Func finallyAction, + [CallerMemberName] string methodName = "") + { + const string modeEnvironmentVariableName = "AZURE_TEST_MODE"; + const string playback = "Playback"; + + using (MockContext mockContext = MockContext.Start(Type, methodName)) + { + string mode = Environment.GetEnvironmentVariable(modeEnvironmentVariableName); + + if (mode != null && mode.Equals(playback, StringComparison.OrdinalIgnoreCase)) + { + HttpMockServer.Mode = HttpRecorderMode.Playback; + } + + this.ResourceGroupName = + TestUtilities.GenerateName(ScenarioTestBase.ResourceGroupNamePrefix); + this.AccountName = TestUtilities.GenerateName(ScenarioTestBase.AccountNamePrefix); + + this.Client = + mockContext.GetServiceClient( + TestEnvironmentFactory.GetTestEnvironment()); + + ResourceManagementClient resourceManagementClient = + mockContext.GetServiceClient(TestEnvironmentFactory.GetTestEnvironment()); + + resourceManagementClient.ResourceGroups.CreateOrUpdate( + this.ResourceGroupName, + new ResourceGroup() { Location = ScenarioTestBase.AccountLocation }); + + await initialAction(this.Client); + + if (finallyAction != null) + { + await finallyAction(this.Client); + } + + resourceManagementClient.ResourceGroups.Delete(this.ResourceGroupName); + } + } + } +} diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/tests/SessionRecords/AccountScenarioTests/AccountCrud.json b/sdk/purview/Microsoft.Azure.Management.Purview/tests/SessionRecords/AccountScenarioTests/AccountCrud.json new file mode 100644 index 000000000000..5c73cd4b6133 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/tests/SessionRecords/AccountScenarioTests/AccountCrud.json @@ -0,0 +1,904 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourcegroups/dotnetsdkrg6208?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Jlc291cmNlZ3JvdXBzL2RvdG5ldHNka3JnNjIwOD9hcGktdmVyc2lvbj0yMDE3LTA1LTEw", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "02ccecf1-47fb-40c1-9abd-098d8b7e22f1" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "300d27b5-11a8-4451-a275-4f20a05dcfab" + ], + "x-ms-correlation-request-id": [ + "300d27b5-11a8-4451-a275-4f20a05dcfab" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T190850Z:300d27b5-11a8-4451-a275-4f20a05dcfab" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:08:50 GMT" + ], + "Content-Length": [ + "183" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208\",\r\n \"name\": \"dotnetsdkrg6208\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973?api-version=2020-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Jlc291cmNlR3JvdXBzL2RvdG5ldHNka3JnNjIwOC9wcm92aWRlcnMvTWljcm9zb2Z0LlB1cnZpZXcvYWNjb3VudHMvZG90bmV0c2RrYWNjb3VudDI5NzM/YXBpLXZlcnNpb249MjAyMC0xMi0wMS1wcmV2aWV3", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"sku\": {\r\n \"capacity\": 4,\r\n \"name\": \"Standard\"\r\n },\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4aaee2ae-1c86-4fc0-870a-536f938afd11" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Purview.PurviewManagementClient/1.0.1.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "143" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973?api-version=2020-12-01-preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-account-status": [ + "Creating" + ], + "Server": [ + "Kestrel" + ], + "x-ms-request-id": [ + "85c4c9a0-dd9f-4055-b600-0f2f94b73a80" + ], + "x-ms-correlation-request-id": [ + "85c4c9a0-dd9f-4055-b600-0f2f94b73a80" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T190912Z:85c4c9a0-dd9f-4055-b600-0f2f94b73a80" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:09:12 GMT" + ], + "Content-Length": [ + "1016" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"cloudConnectors\": {\r\n \"awsExternalId\": \"91c705f0-a18e-426b-82ac-1742c47bc3a8\"\r\n },\r\n \"friendlyName\": \"dotnetsdkaccount2973\",\r\n \"createdBy\": \"\",\r\n \"createdByObjectId\": \"a25c44f5-d824-45db-8bc1-77b39376f949\",\r\n \"createdAt\": \"2021-01-27T19:09:05.6630627Z\",\r\n \"endpoints\": {\r\n \"catalog\": \"https://dotnetsdkaccount2973.catalog.purview.azure-test.com\",\r\n \"scan\": \"https://dotnetsdkaccount2973.scan.purview.azure-test.com\",\r\n \"guardian\": \"https://dotnetsdkaccount2973.guardian.purview.azure-test.com\"\r\n },\r\n \"provisioningState\": \"Creating\",\r\n \"privateEndpointConnections\": [],\r\n \"managedResources\": null,\r\n \"publicNetworkAccess\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973\",\r\n \"name\": \"dotnetsdkaccount2973\",\r\n \"type\": \"Microsoft.Purview/accounts\",\r\n \"location\": \"westus\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"e3c0af9a-e038-4f1a-bab4-3a224fb85cff\",\r\n \"tenantId\": \"f686d426-8d16-42db-81b7-ab578e110ccd\"\r\n },\r\n \"tags\": null\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973?api-version=2020-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Jlc291cmNlR3JvdXBzL2RvdG5ldHNka3JnNjIwOC9wcm92aWRlcnMvTWljcm9zb2Z0LlB1cnZpZXcvYWNjb3VudHMvZG90bmV0c2RrYWNjb3VudDI5NzM/YXBpLXZlcnNpb249MjAyMC0xMi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Purview.PurviewManagementClient/1.0.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14999" + ], + "x-ms-account-status": [ + "Creating" + ], + "Server": [ + "Kestrel" + ], + "x-ms-request-id": [ + "02da65f9-cb6f-4cac-9bbc-588db5ea097b" + ], + "x-ms-correlation-request-id": [ + "02da65f9-cb6f-4cac-9bbc-588db5ea097b" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T190942Z:02da65f9-cb6f-4cac-9bbc-588db5ea097b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:09:42 GMT" + ], + "Content-Length": [ + "1164" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"cloudConnectors\": {\r\n \"awsExternalId\": \"91c705f0-a18e-426b-82ac-1742c47bc3a8\"\r\n },\r\n \"friendlyName\": \"dotnetsdkaccount2973\",\r\n \"createdBy\": \"\",\r\n \"createdByObjectId\": \"a25c44f5-d824-45db-8bc1-77b39376f949\",\r\n \"createdAt\": \"2021-01-27T19:09:05.6630627Z\",\r\n \"endpoints\": {\r\n \"catalog\": \"https://dotnetsdkaccount2973.catalog.purview.azure-test.com\",\r\n \"scan\": \"https://dotnetsdkaccount2973.scan.purview.azure-test.com\",\r\n \"guardian\": \"https://dotnetsdkaccount2973.guardian.purview.azure-test.com\"\r\n },\r\n \"provisioningState\": \"Creating\",\r\n \"privateEndpointConnections\": [],\r\n \"managedResources\": {\r\n \"resourceGroup\": \"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/managed-rg-cbcufcg\",\r\n \"storageAccount\": null,\r\n \"eventHubNamespace\": null\r\n },\r\n \"publicNetworkAccess\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973\",\r\n \"name\": \"dotnetsdkaccount2973\",\r\n \"type\": \"Microsoft.Purview/accounts\",\r\n \"location\": \"westus\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"e3c0af9a-e038-4f1a-bab4-3a224fb85cff\",\r\n \"tenantId\": \"f686d426-8d16-42db-81b7-ab578e110ccd\"\r\n },\r\n \"tags\": null\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973?api-version=2020-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Jlc291cmNlR3JvdXBzL2RvdG5ldHNka3JnNjIwOC9wcm92aWRlcnMvTWljcm9zb2Z0LlB1cnZpZXcvYWNjb3VudHMvZG90bmV0c2RrYWNjb3VudDI5NzM/YXBpLXZlcnNpb249MjAyMC0xMi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Purview.PurviewManagementClient/1.0.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14998" + ], + "x-ms-account-status": [ + "Creating" + ], + "Server": [ + "Kestrel" + ], + "x-ms-request-id": [ + "de843956-f2be-46f7-b2bb-96d18c5e6cb1" + ], + "x-ms-correlation-request-id": [ + "de843956-f2be-46f7-b2bb-96d18c5e6cb1" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191013Z:de843956-f2be-46f7-b2bb-96d18c5e6cb1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:10:13 GMT" + ], + "Content-Length": [ + "1164" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"cloudConnectors\": {\r\n \"awsExternalId\": \"91c705f0-a18e-426b-82ac-1742c47bc3a8\"\r\n },\r\n \"friendlyName\": \"dotnetsdkaccount2973\",\r\n \"createdBy\": \"\",\r\n \"createdByObjectId\": \"a25c44f5-d824-45db-8bc1-77b39376f949\",\r\n \"createdAt\": \"2021-01-27T19:09:05.6630627Z\",\r\n \"endpoints\": {\r\n \"catalog\": \"https://dotnetsdkaccount2973.catalog.purview.azure-test.com\",\r\n \"scan\": \"https://dotnetsdkaccount2973.scan.purview.azure-test.com\",\r\n \"guardian\": \"https://dotnetsdkaccount2973.guardian.purview.azure-test.com\"\r\n },\r\n \"provisioningState\": \"Creating\",\r\n \"privateEndpointConnections\": [],\r\n \"managedResources\": {\r\n \"resourceGroup\": \"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/managed-rg-cbcufcg\",\r\n \"storageAccount\": null,\r\n \"eventHubNamespace\": null\r\n },\r\n \"publicNetworkAccess\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973\",\r\n \"name\": \"dotnetsdkaccount2973\",\r\n \"type\": \"Microsoft.Purview/accounts\",\r\n \"location\": \"westus\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"e3c0af9a-e038-4f1a-bab4-3a224fb85cff\",\r\n \"tenantId\": \"f686d426-8d16-42db-81b7-ab578e110ccd\"\r\n },\r\n \"tags\": null\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973?api-version=2020-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Jlc291cmNlR3JvdXBzL2RvdG5ldHNka3JnNjIwOC9wcm92aWRlcnMvTWljcm9zb2Z0LlB1cnZpZXcvYWNjb3VudHMvZG90bmV0c2RrYWNjb3VudDI5NzM/YXBpLXZlcnNpb249MjAyMC0xMi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Purview.PurviewManagementClient/1.0.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14997" + ], + "x-ms-account-status": [ + "Succeeded" + ], + "Server": [ + "Kestrel" + ], + "x-ms-request-id": [ + "02289507-a6f8-4f43-8972-1be7eecfd072" + ], + "x-ms-correlation-request-id": [ + "02289507-a6f8-4f43-8972-1be7eecfd072" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191043Z:02289507-a6f8-4f43-8972-1be7eecfd072" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:10:43 GMT" + ], + "Content-Length": [ + "1165" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"capacity\": 4\r\n },\r\n \"properties\": {\r\n \"cloudConnectors\": {\r\n \"awsExternalId\": \"91c705f0-a18e-426b-82ac-1742c47bc3a8\"\r\n },\r\n \"friendlyName\": \"dotnetsdkaccount2973\",\r\n \"createdBy\": \"\",\r\n \"createdByObjectId\": \"a25c44f5-d824-45db-8bc1-77b39376f949\",\r\n \"createdAt\": \"2021-01-27T19:09:05.6630627Z\",\r\n \"endpoints\": {\r\n \"catalog\": \"https://dotnetsdkaccount2973.catalog.purview.azure-test.com\",\r\n \"scan\": \"https://dotnetsdkaccount2973.scan.purview.azure-test.com\",\r\n \"guardian\": \"https://dotnetsdkaccount2973.guardian.purview.azure-test.com\"\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"privateEndpointConnections\": [],\r\n \"managedResources\": {\r\n \"resourceGroup\": \"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/managed-rg-cbcufcg\",\r\n \"storageAccount\": null,\r\n \"eventHubNamespace\": null\r\n },\r\n \"publicNetworkAccess\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973\",\r\n \"name\": \"dotnetsdkaccount2973\",\r\n \"type\": \"Microsoft.Purview/accounts\",\r\n \"location\": \"westus\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"e3c0af9a-e038-4f1a-bab4-3a224fb85cff\",\r\n \"tenantId\": \"f686d426-8d16-42db-81b7-ab578e110ccd\"\r\n },\r\n \"tags\": null\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973?api-version=2020-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Jlc291cmNlR3JvdXBzL2RvdG5ldHNka3JnNjIwOC9wcm92aWRlcnMvTWljcm9zb2Z0LlB1cnZpZXcvYWNjb3VudHMvZG90bmV0c2RrYWNjb3VudDI5NzM/YXBpLXZlcnNpb249MjAyMC0xMi0wMS1wcmV2aWV3", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "62eb9312-d63b-42a9-8b8c-c131e906f251" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Purview.PurviewManagementClient/1.0.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/providers/Microsoft.Purview/locations/westus/operationResults/d6deaee0-a340-43da-99db-b2d2108047ca?api-version=2020-12-01-preview" + ], + "Server": [ + "Kestrel" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "01204b3f-3d8c-446b-a15d-c3552fcb5150" + ], + "x-ms-correlation-request-id": [ + "01204b3f-3d8c-446b-a15d-c3552fcb5150" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191106Z:01204b3f-3d8c-446b-a15d-c3552fcb5150" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:11:05 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourceGroups/dotnetsdkrg6208/providers/Microsoft.Purview/accounts/dotnetsdkaccount2973?api-version=2020-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Jlc291cmNlR3JvdXBzL2RvdG5ldHNka3JnNjIwOC9wcm92aWRlcnMvTWljcm9zb2Z0LlB1cnZpZXcvYWNjb3VudHMvZG90bmV0c2RrYWNjb3VudDI5NzM/YXBpLXZlcnNpb249MjAyMC0xMi0wMS1wcmV2aWV3", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "34ff6f65-1a93-45e4-9aaa-c89b01427d0e" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Purview.PurviewManagementClient/1.0.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Kestrel" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14998" + ], + "x-ms-request-id": [ + "f89d00aa-2980-4a10-b696-af47227dfaae" + ], + "x-ms-correlation-request-id": [ + "f89d00aa-2980-4a10-b696-af47227dfaae" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191209Z:f89d00aa-2980-4a10-b696-af47227dfaae" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:12:09 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/providers/Microsoft.Purview/locations/westus/operationResults/d6deaee0-a340-43da-99db-b2d2108047ca?api-version=2020-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Byb3ZpZGVycy9NaWNyb3NvZnQuUHVydmlldy9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZDZkZWFlZTAtYTM0MC00M2RhLTk5ZGItYjJkMjEwODA0N2NhP2FwaS12ZXJzaW9uPTIwMjAtMTItMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Purview.PurviewManagementClient/1.0.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/providers/Microsoft.Purview/locations/westus/operationResults/d6deaee0-a340-43da-99db-b2d2108047ca?api-version=2020-12-01-preview" + ], + "Server": [ + "Kestrel" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-request-id": [ + "7c3fe228-fc33-4ec6-b98b-28e7d19afc7c" + ], + "x-ms-correlation-request-id": [ + "7c3fe228-fc33-4ec6-b98b-28e7d19afc7c" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191136Z:7c3fe228-fc33-4ec6-b98b-28e7d19afc7c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:11:35 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/providers/Microsoft.Purview/locations/westus/operationResults/d6deaee0-a340-43da-99db-b2d2108047ca?api-version=2020-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Byb3ZpZGVycy9NaWNyb3NvZnQuUHVydmlldy9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZDZkZWFlZTAtYTM0MC00M2RhLTk5ZGItYjJkMjEwODA0N2NhP2FwaS12ZXJzaW9uPTIwMjAtMTItMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Purview.PurviewManagementClient/1.0.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "Server": [ + "Kestrel" + ], + "x-ms-request-id": [ + "716681d3-aecf-462a-bbb2-7c8778eedbe5" + ], + "x-ms-correlation-request-id": [ + "716681d3-aecf-462a-bbb2-7c8778eedbe5" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191207Z:716681d3-aecf-462a-bbb2-7c8778eedbe5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:12:06 GMT" + ], + "Content-Length": [ + "119" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"startTime\": \"2021-01-27T19:11:06.2232882Z\",\r\n \"endTime\": \"2021-01-27T19:11:07.4109989Z\",\r\n \"status\": \"Succeeded\",\r\n \"error\": null\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/providers/Microsoft.Purview/locations/westus/operationResults/d6deaee0-a340-43da-99db-b2d2108047ca?api-version=2020-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Byb3ZpZGVycy9NaWNyb3NvZnQuUHVydmlldy9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZDZkZWFlZTAtYTM0MC00M2RhLTk5ZGItYjJkMjEwODA0N2NhP2FwaS12ZXJzaW9uPTIwMjAtMTItMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Purview.PurviewManagementClient/1.0.1.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14994" + ], + "Server": [ + "Kestrel" + ], + "x-ms-request-id": [ + "d08394e5-a5de-42b6-bbb4-de38c80538d1" + ], + "x-ms-correlation-request-id": [ + "d08394e5-a5de-42b6-bbb4-de38c80538d1" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191207Z:d08394e5-a5de-42b6-bbb4-de38c80538d1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:12:07 GMT" + ], + "Content-Length": [ + "119" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"startTime\": \"2021-01-27T19:11:06.2232882Z\",\r\n \"endTime\": \"2021-01-27T19:11:07.4109989Z\",\r\n \"status\": \"Succeeded\",\r\n \"error\": null\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/resourcegroups/dotnetsdkrg6208?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL3Jlc291cmNlZ3JvdXBzL2RvdG5ldHNka3JnNjIwOD9hcGktdmVyc2lvbj0yMDE3LTA1LTEw", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "bb32eb7d-4d56-4e45-8766-52172175aee6" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1ET1RORVRTREtSRzYyMDgtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "e0fb2779-070f-450b-b178-125a2c165692" + ], + "x-ms-correlation-request-id": [ + "e0fb2779-070f-450b-b178-125a2c165692" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191212Z:e0fb2779-070f-450b-b178-125a2c165692" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:12:12 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1ET1RORVRTREtSRzYyMDgtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFFVDFST1JWUlRSRXRTUnpZeU1EZ3RWMFZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1ET1RORVRTREtSRzYyMDgtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14985" + ], + "x-ms-request-id": [ + "181376cb-7e84-4227-b3c3-ded24572d266" + ], + "x-ms-correlation-request-id": [ + "181376cb-7e84-4227-b3c3-ded24572d266" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191228Z:181376cb-7e84-4227-b3c3-ded24572d266" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:12:27 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1ET1RORVRTREtSRzYyMDgtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFFVDFST1JWUlRSRXRTUnpZeU1EZ3RWMFZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1ET1RORVRTREtSRzYyMDgtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14984" + ], + "x-ms-request-id": [ + "9542fc6e-f32b-41e9-bae3-763a230a1393" + ], + "x-ms-correlation-request-id": [ + "9542fc6e-f32b-41e9-bae3-763a230a1393" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191243Z:9542fc6e-f32b-41e9-bae3-763a230a1393" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:12:42 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1ET1RORVRTREtSRzYyMDgtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFFVDFST1JWUlRSRXRTUnpZeU1EZ3RWMFZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14983" + ], + "x-ms-request-id": [ + "de7dd1f5-4391-4013-a299-630e7190951d" + ], + "x-ms-correlation-request-id": [ + "de7dd1f5-4391-4013-a299-630e7190951d" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191259Z:de7dd1f5-4391-4013-a299-630e7190951d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:12:58 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/30d9d527-c409-4507-b861-d60e7fe9e292/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1ET1RORVRTREtSRzYyMDgtV0VTVFVTIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMifQ?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMzBkOWQ1MjctYzQwOS00NTA3LWI4NjEtZDYwZTdmZTllMjkyL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFFVDFST1JWUlRSRXRTUnpZeU1EZ3RWMFZUVkZWVElpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBkWE1pZlE/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14982" + ], + "x-ms-request-id": [ + "54d61126-4fea-4956-940d-7654f4d78777" + ], + "x-ms-correlation-request-id": [ + "54d61126-4fea-4956-940d-7654f4d78777" + ], + "x-ms-routing-request-id": [ + "NORTHEUROPE:20210127T191259Z:54d61126-4fea-4956-940d-7654f4d78777" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Wed, 27 Jan 2021 19:12:58 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + } + ], + "Names": { + "RunTest": [ + "dotnetsdkrg6208", + "dotnetsdkaccount2973" + ] + }, + "Variables": { + "SubscriptionId": "30d9d527-c409-4507-b861-d60e7fe9e292" + } +} \ No newline at end of file diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/tests/Utils/TestType.cs b/sdk/purview/Microsoft.Azure.Management.Purview/tests/Utils/TestType.cs new file mode 100644 index 000000000000..5b4542eff8b7 --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/tests/Utils/TestType.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +namespace Purview.Tests.Utils +{ + public static class TestType + { + // Tests must belong to exactly one of these categories + public const string Unit = "Unit"; + public const string Scenario = "Scenario"; + } +} \ No newline at end of file diff --git a/sdk/purview/Microsoft.Azure.Management.Purview/tests/Utils/TraitName.cs b/sdk/purview/Microsoft.Azure.Management.Purview/tests/Utils/TraitName.cs new file mode 100644 index 000000000000..aa570c0d7f6e --- /dev/null +++ b/sdk/purview/Microsoft.Azure.Management.Purview/tests/Utils/TraitName.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +namespace Purview.Tests.Utils +{ + public static class TraitName + { + public const string TestType = "Type"; + public const string Function = "Function"; + } +} \ No newline at end of file