diff --git a/src/SDKs/SDKs/_metadata/sql_resource-manager.txt b/src/SDKs/SDKs/_metadata/sql_resource-manager.txt deleted file mode 100644 index 6af1b1ad15db..000000000000 --- a/src/SDKs/SDKs/_metadata/sql_resource-manager.txt +++ /dev/null @@ -1,14 +0,0 @@ -Installing AutoRest version: latest -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/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\git\azure-sdk-for-net\src\SDKs -2019-01-29 06:40:43 UTC -Azure-rest-api-specs repository information -GitHub fork: Azure -Branch: master -Commit: 31fa6a10ba86e3f777e63a4c5cd0d2cbd135227b -AutoRest information -Requested version: latest -Bootstrapper version: autorest@2.0.4283 diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedDatabaseSensitivityLabelsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedDatabaseSensitivityLabelsOperations.cs new file mode 100644 index 000000000000..85dacc28eb6c --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedDatabaseSensitivityLabelsOperations.cs @@ -0,0 +1,261 @@ +// +// 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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ManagedDatabaseSensitivityLabelsOperations operations. + /// + public partial interface IManagedDatabaseSensitivityLabelsOperations + { + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: + /// 'current', 'recommended' + /// + /// + /// 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 managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates the sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. + /// + /// + /// 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 managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// 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 managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the 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>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the 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>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// 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>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// 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>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ISensitivityLabelsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ISensitivityLabelsOperations.cs new file mode 100644 index 000000000000..cddf9fa19d5e --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISensitivityLabelsOperations.cs @@ -0,0 +1,261 @@ +// +// 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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SensitivityLabelsOperations operations. + /// + public partial interface ISensitivityLabelsOperations + { + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the 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>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the 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>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: + /// 'current', 'recommended' + /// + /// + /// 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 serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates the sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. + /// + /// + /// 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 serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// 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 serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// 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>> ListCurrentByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// 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>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs index 5cf2657e2525..b1eca48f0f90 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs @@ -372,6 +372,11 @@ public partial interface ISqlManagementClient : System.IDisposable /// IManagedServerSecurityAlertPoliciesOperations ManagedServerSecurityAlertPolicies { get; } + /// + /// Gets the ISensitivityLabelsOperations. + /// + ISensitivityLabelsOperations SensitivityLabels { get; } + /// /// Gets the IDatabaseOperations. /// @@ -452,5 +457,10 @@ public partial interface ISqlManagementClient : System.IDisposable /// IServerVulnerabilityAssessmentsOperations ServerVulnerabilityAssessments { get; } + /// + /// Gets the IManagedDatabaseSensitivityLabelsOperations. + /// + IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; } + } } diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperations.cs new file mode 100644 index 000000000000..3a77c5221ca4 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperations.cs @@ -0,0 +1,1556 @@ +// +// 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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + 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; + + /// + /// ManagedDatabaseSensitivityLabelsOperations operations. + /// + internal partial class ManagedDatabaseSensitivityLabelsOperations : IServiceOperations, IManagedDatabaseSensitivityLabelsOperations + { + /// + /// Initializes a new instance of the ManagedDatabaseSensitivityLabelsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ManagedDatabaseSensitivityLabelsOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + /// + /// 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 managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("apiVersion", apiVersion); + 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Creates or updates the sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. + /// + /// + /// 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 managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string sensitivityLabelSource = "current"; + string apiVersion = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string sensitivityLabelSource = "current"; + string apiVersion = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 the sensitivity labels of a given database + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the 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>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabase", 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 sensitivity labels of a given database + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the 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>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabase", 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.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 sensitivity labels of a given database + /// + /// + /// 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>> ListCurrentByDatabaseNextWithHttpMessagesAsync(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, "ListCurrentByDatabaseNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 sensitivity labels of a given database + /// + /// + /// 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>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(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, "ListRecommendedByDatabaseNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs new file mode 100644 index 000000000000..701df89b3ef1 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs @@ -0,0 +1,415 @@ +// +// 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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ManagedDatabaseSensitivityLabelsOperations. + /// + public static partial class ManagedDatabaseSensitivityLabelsOperationsExtensions + { + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + public static SensitivityLabel Get(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) + { + return operations.GetAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. + /// + public static SensitivityLabel CreateOrUpdate(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + public static void Delete(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) + { + operations.DeleteAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage ListCurrentByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListCurrentByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListCurrentByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListCurrentByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// + public static IPage ListRecommendedByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.ListRecommendedByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> ListRecommendedByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListCurrentByDatabaseNext(this IManagedDatabaseSensitivityLabelsOperations operations, string nextPageLink) + { + return operations.ListCurrentByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListCurrentByDatabaseNextAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListCurrentByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListRecommendedByDatabaseNext(this IManagedDatabaseSensitivityLabelsOperations operations, string nextPageLink) + { + return operations.ListRecommendedByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListRecommendedByDatabaseNextAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListRecommendedByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstance.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstance.cs index e7402eac96a5..1fb91fe0e1b5 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstance.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstance.cs @@ -63,7 +63,12 @@ public ManagedInstance() /// The resource id of another managed /// instance whose DNS zone this managed instance will share after /// creation. - public ManagedInstance(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), ResourceIdentity identity = default(ResourceIdentity), Sku sku = default(Sku), string fullyQualifiedDomainName = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string subnetId = default(string), string state = default(string), string licenseType = default(string), int? vCores = default(int?), int? storageSizeInGB = default(int?), string collation = default(string), string dnsZone = default(string), string dnsZonePartner = default(string)) + /// Whether or not the public + /// data endpoint is enabled. + /// Connection type used for connecting to + /// the instance. Possible values include: 'Proxy', 'Redirect', + /// 'Default' + public ManagedInstance(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), ResourceIdentity identity = default(ResourceIdentity), Sku sku = default(Sku), string fullyQualifiedDomainName = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string subnetId = default(string), string state = default(string), string licenseType = default(string), int? vCores = default(int?), int? storageSizeInGB = default(int?), string collation = default(string), string dnsZone = default(string), string dnsZonePartner = default(string), bool? publicDataEndpointEnabled = default(bool?), string proxyOverride = default(string)) : base(location, id, name, type, tags) { Identity = identity; @@ -79,6 +84,8 @@ public ManagedInstance() Collation = collation; DnsZone = dnsZone; DnsZonePartner = dnsZonePartner; + PublicDataEndpointEnabled = publicDataEndpointEnabled; + ProxyOverride = proxyOverride; CustomInit(); } @@ -171,6 +178,19 @@ public ManagedInstance() [JsonProperty(PropertyName = "properties.dnsZonePartner")] public string DnsZonePartner { get; set; } + /// + /// Gets or sets whether or not the public data endpoint is enabled. + /// + [JsonProperty(PropertyName = "properties.publicDataEndpointEnabled")] + public bool? PublicDataEndpointEnabled { get; set; } + + /// + /// Gets or sets connection type used for connecting to the instance. + /// Possible values include: 'Proxy', 'Redirect', 'Default' + /// + [JsonProperty(PropertyName = "properties.proxyOverride")] + public string ProxyOverride { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceProxyOverride.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceProxyOverride.cs new file mode 100644 index 000000000000..dd6d2f660269 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceProxyOverride.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.Sql.Models +{ + + /// + /// Defines values for ManagedInstanceProxyOverride. + /// + public static class ManagedInstanceProxyOverride + { + public const string Proxy = "Proxy"; + public const string Redirect = "Redirect"; + public const string Default = "Default"; + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceUpdate.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceUpdate.cs index 596e60b293f6..f3a383baf1a5 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceUpdate.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceUpdate.cs @@ -56,8 +56,13 @@ public ManagedInstanceUpdate() /// The resource id of another managed /// instance whose DNS zone this managed instance will share after /// creation. + /// Whether or not the public + /// data endpoint is enabled. + /// Connection type used for connecting to + /// the instance. Possible values include: 'Proxy', 'Redirect', + /// 'Default' /// Resource tags. - public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomainName = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string subnetId = default(string), string state = default(string), string licenseType = default(string), int? vCores = default(int?), int? storageSizeInGB = default(int?), string collation = default(string), string dnsZone = default(string), string dnsZonePartner = default(string), IDictionary tags = default(IDictionary)) + public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomainName = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string subnetId = default(string), string state = default(string), string licenseType = default(string), int? vCores = default(int?), int? storageSizeInGB = default(int?), string collation = default(string), string dnsZone = default(string), string dnsZonePartner = default(string), bool? publicDataEndpointEnabled = default(bool?), string proxyOverride = default(string), IDictionary tags = default(IDictionary)) { Sku = sku; FullyQualifiedDomainName = fullyQualifiedDomainName; @@ -71,6 +76,8 @@ public ManagedInstanceUpdate() Collation = collation; DnsZone = dnsZone; DnsZonePartner = dnsZonePartner; + PublicDataEndpointEnabled = publicDataEndpointEnabled; + ProxyOverride = proxyOverride; Tags = tags; CustomInit(); } @@ -157,6 +164,19 @@ public ManagedInstanceUpdate() [JsonProperty(PropertyName = "properties.dnsZonePartner")] public string DnsZonePartner { get; set; } + /// + /// Gets or sets whether or not the public data endpoint is enabled. + /// + [JsonProperty(PropertyName = "properties.publicDataEndpointEnabled")] + public bool? PublicDataEndpointEnabled { get; set; } + + /// + /// Gets or sets connection type used for connecting to the instance. + /// Possible values include: 'Proxy', 'Redirect', 'Default' + /// + [JsonProperty(PropertyName = "properties.proxyOverride")] + public string ProxyOverride { get; set; } + /// /// Gets or sets resource tags. /// diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabel.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabel.cs new file mode 100644 index 000000000000..b02c7ca60980 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabel.cs @@ -0,0 +1,82 @@ +// +// 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.Sql.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A sensitivity label. + /// + [Rest.Serialization.JsonTransformation] + public partial class SensitivityLabel : ProxyResource + { + /// + /// Initializes a new instance of the SensitivityLabel class. + /// + public SensitivityLabel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SensitivityLabel class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// The label name. + /// The label ID. + /// The information type. + /// The information type ID. + public SensitivityLabel(string id = default(string), string name = default(string), string type = default(string), string labelName = default(string), string labelId = default(string), string informationType = default(string), string informationTypeId = default(string)) + : base(id, name, type) + { + LabelName = labelName; + LabelId = labelId; + InformationType = informationType; + InformationTypeId = informationTypeId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the label name. + /// + [JsonProperty(PropertyName = "properties.labelName")] + public string LabelName { get; set; } + + /// + /// Gets or sets the label ID. + /// + [JsonProperty(PropertyName = "properties.labelId")] + public string LabelId { get; set; } + + /// + /// Gets or sets the information type. + /// + [JsonProperty(PropertyName = "properties.informationType")] + public string InformationType { get; set; } + + /// + /// Gets or sets the information type ID. + /// + [JsonProperty(PropertyName = "properties.informationTypeId")] + public string InformationTypeId { get; set; } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabelSource.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabelSource.cs new file mode 100644 index 000000000000..3b811f395d14 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabelSource.cs @@ -0,0 +1,60 @@ +// +// 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.Sql.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SensitivityLabelSource. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SensitivityLabelSource + { + [EnumMember(Value = "current")] + Current, + [EnumMember(Value = "recommended")] + Recommended + } + internal static class SensitivityLabelSourceEnumExtension + { + internal static string ToSerializedValue(this SensitivityLabelSource? value) + { + return value == null ? null : ((SensitivityLabelSource)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SensitivityLabelSource value) + { + switch( value ) + { + case SensitivityLabelSource.Current: + return "current"; + case SensitivityLabelSource.Recommended: + return "recommended"; + } + return null; + } + + internal static SensitivityLabelSource? ParseSensitivityLabelSource(this string value) + { + switch( value ) + { + case "current": + return SensitivityLabelSource.Current; + case "recommended": + return SensitivityLabelSource.Recommended; + } + return null; + } + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs index f5341a7e8632..4b090dd13b00 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs @@ -58,6 +58,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "LongTermRetentionBackups", "2017-03-01-preview"), new Tuple("Sql", "ManagedBackupShortTermRetentionPolicies", "2017-03-01-preview"), new Tuple("Sql", "ManagedDatabaseSecurityAlertPolicies", "2017-03-01-preview"), + new Tuple("Sql", "ManagedDatabaseSensitivityLabels", "2018-06-01-preview"), new Tuple("Sql", "ManagedDatabaseVulnerabilityAssessmentRuleBaselines", "2017-10-01-preview"), new Tuple("Sql", "ManagedDatabaseVulnerabilityAssessmentScans", "2017-10-01-preview"), new Tuple("Sql", "ManagedDatabaseVulnerabilityAssessments", "2017-10-01-preview"), @@ -77,6 +78,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "RestorableDroppedDatabases", "2014-04-01"), new Tuple("Sql", "RestorableDroppedManagedDatabases", "2017-03-01-preview"), new Tuple("Sql", "RestorePoints", "2017-03-01-preview"), + new Tuple("Sql", "SensitivityLabels", "2017-03-01-preview"), new Tuple("Sql", "ServerAutomaticTuning", "2017-03-01-preview"), new Tuple("Sql", "ServerAzureADAdministrators", "2014-04-01"), new Tuple("Sql", "ServerBlobAuditingPolicies", "2017-03-01-preview"), @@ -105,13 +107,13 @@ public static IEnumerable> ApiInfo_SqlManagementCl // BEGIN: Code Generation Metadata Section public static readonly String AutoRestVersion = "latest"; public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\azure-sdk-for-net\\src\\SDKs"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\azure-sdk-for-net\\src\\SDKs"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "2c26ca134086846b742141e3dfffcc8b92afeccf"; + public static readonly String GithubCommidId = "be751b27058624ecde8be51d7327443ce3c86264"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section - } + } } diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperations.cs new file mode 100644 index 000000000000..a628476643ad --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperations.cs @@ -0,0 +1,1556 @@ +// +// 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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + 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; + + /// + /// SensitivityLabelsOperations operations. + /// + internal partial class SensitivityLabelsOperations : IServiceOperations, ISensitivityLabelsOperations + { + /// + /// Initializes a new instance of the SensitivityLabelsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SensitivityLabelsOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the 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>> ListCurrentByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-03-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListCurrentByDatabase", 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.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 sensitivity labels of a given database + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the 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>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-03-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListRecommendedByDatabase", 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.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + /// + /// 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 serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-03-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("apiVersion", apiVersion); + 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.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Creates or updates the sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. + /// + /// + /// 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 serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string sensitivityLabelSource = "current"; + string apiVersion = "2017-03-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + 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.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 sensitivity label of a given column + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string sensitivityLabelSource = "current"; + string apiVersion = "2017-03-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(sensitivityLabelSource)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 the sensitivity labels of a given database + /// + /// + /// 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>> ListCurrentByDatabaseNextWithHttpMessagesAsync(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, "ListCurrentByDatabaseNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 sensitivity labels of a given database + /// + /// + /// 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>> ListRecommendedByDatabaseNextWithHttpMessagesAsync(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, "ListRecommendedByDatabaseNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperationsExtensions.cs new file mode 100644 index 000000000000..3488d98927f8 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperationsExtensions.cs @@ -0,0 +1,415 @@ +// +// 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.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SensitivityLabelsOperations. + /// + public static partial class SensitivityLabelsOperationsExtensions + { + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage ListCurrentByDatabase(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListCurrentByDatabaseAsync(resourceGroupName, serverName, databaseName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListCurrentByDatabaseAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListCurrentByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// + public static IPage ListRecommendedByDatabase(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + { + return operations.ListRecommendedByDatabaseAsync(resourceGroupName, serverName, databaseName, odataQuery, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> ListRecommendedByDatabaseAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + public static SensitivityLabel Get(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) + { + return operations.GetAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. + /// + public static SensitivityLabel CreateOrUpdate(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The column sensitivity label resource. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + public static void Delete(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) + { + operations.DeleteAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The name of the database. + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListCurrentByDatabaseNext(this ISensitivityLabelsOperations operations, string nextPageLink) + { + return operations.ListCurrentByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListCurrentByDatabaseNextAsync(this ISensitivityLabelsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListCurrentByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListRecommendedByDatabaseNext(this ISensitivityLabelsOperations operations, string nextPageLink) + { + return operations.ListRecommendedByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity labels of a given database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListRecommendedByDatabaseNextAsync(this ISensitivityLabelsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListRecommendedByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs index 8bd1fd8e330b..3b8719fff923 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs @@ -377,6 +377,11 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IManagedServerSecurityAlertPoliciesOperations ManagedServerSecurityAlertPolicies { get; private set; } + /// + /// Gets the ISensitivityLabelsOperations. + /// + public virtual ISensitivityLabelsOperations SensitivityLabels { get; private set; } + /// /// Gets the IDatabaseOperations. /// @@ -457,6 +462,11 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IServerVulnerabilityAssessmentsOperations ServerVulnerabilityAssessments { get; private set; } + /// + /// Gets the IManagedDatabaseSensitivityLabelsOperations. + /// + public virtual IManagedDatabaseSensitivityLabelsOperations ManagedDatabaseSensitivityLabels { get; private set; } + /// /// Initializes a new instance of the SqlManagementClient class. /// @@ -759,6 +769,7 @@ private void Initialize() RestorePoints = new RestorePointsOperations(this); ManagedDatabaseSecurityAlertPolicies = new ManagedDatabaseSecurityAlertPoliciesOperations(this); ManagedServerSecurityAlertPolicies = new ManagedServerSecurityAlertPoliciesOperations(this); + SensitivityLabels = new SensitivityLabelsOperations(this); DatabaseOperations = new DatabaseOperations(this); ElasticPoolOperations = new ElasticPoolOperations(this); Capabilities = new CapabilitiesOperations(this); @@ -775,6 +786,7 @@ private void Initialize() RecoverableManagedDatabases = new RecoverableManagedDatabasesOperations(this); ManagedInstanceVulnerabilityAssessments = new ManagedInstanceVulnerabilityAssessmentsOperations(this); ServerVulnerabilityAssessments = new ServerVulnerabilityAssessmentsOperations(this); + ManagedDatabaseSensitivityLabels = new ManagedDatabaseSensitivityLabelsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/src/SDKs/SqlManagement/Management.Sql/Microsoft.Azure.Management.Sql.csproj b/src/SDKs/SqlManagement/Management.Sql/Microsoft.Azure.Management.Sql.csproj index 54fc8ad76d21..d1624753abb6 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Microsoft.Azure.Management.Sql.csproj +++ b/src/SDKs/SqlManagement/Management.Sql/Microsoft.Azure.Management.Sql.csproj @@ -7,12 +7,12 @@ Microsoft.Azure.Management.Sql Azure SQL Management SDK library Microsoft.Azure.Management.Sql - 1.27.0-preview + 1.28.0-preview Microsoft Azure SQL Management;SQL;SQL Management; diff --git a/src/SDKs/SqlManagement/Sql.Tests/ManagedInstanceCrudScenarioTests.cs b/src/SDKs/SqlManagement/Sql.Tests/ManagedInstanceCrudScenarioTests.cs index 6a5931fadcd8..0609fbf96e07 100644 --- a/src/SDKs/SqlManagement/Sql.Tests/ManagedInstanceCrudScenarioTests.cs +++ b/src/SDKs/SqlManagement/Sql.Tests/ManagedInstanceCrudScenarioTests.cs @@ -32,10 +32,14 @@ public void TestCreateUpdateGetDropManagedInstance() Microsoft.Azure.Management.Sql.Models.Sku sku = new Microsoft.Azure.Management.Sql.Models.Sku(); sku.Name = "MIGP8G4"; sku.Tier = "GeneralPurpose"; + sku.Family = "Gen4"; string subnetId = "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default"; string location = "westcentralus"; + bool publicDataEndpointEnabled = true; + string proxyOverride = "Proxy"; + //Create server var managedInstance1 = sqlClient.ManagedInstances.CreateOrUpdate(resourceGroup.Name, managedInstanceName, new ManagedInstance() { @@ -58,7 +62,9 @@ public void TestCreateUpdateGetDropManagedInstance() SubnetId = subnetId, Tags = tags, Location = location, - DnsZonePartner = string.Format("/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/{0}/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk1", resourceGroup.Name) + DnsZonePartner = string.Format("/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/{0}/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk1", resourceGroup.Name), + PublicDataEndpointEnabled = publicDataEndpointEnabled, + ProxyOverride = proxyOverride }); SqlManagementTestUtilities.ValidateManagedInstance(managedInstance2, managedInstanceName2, login, tags, TestEnvironmentUtilities.DefaultLocationId); @@ -73,6 +79,12 @@ public void TestCreateUpdateGetDropManagedInstance() // Verify that dns zone value is correctly inherited from dns zone partner Assert.Equal(getMI1.DnsZone, getMI2.DnsZone); + // Verify PublicDataEndpointEnabled value for second server + Assert.Equal(publicDataEndpointEnabled, getMI2.PublicDataEndpointEnabled); + + // Verify ProxyOverride value for second server + Assert.Equal(proxyOverride, getMI2.ProxyOverride); + var listMI = sqlClient.ManagedInstances.ListByResourceGroup(resourceGroup.Name); Assert.Equal(2, listMI.Count()); diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.ManagedInstanceCrudScenarioTests/TestCreateUpdateGetDropManagedInstance.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.ManagedInstanceCrudScenarioTests/TestCreateUpdateGetDropManagedInstance.json index 4cc1b6535612..010dcd7df476 100644 --- a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.ManagedInstanceCrudScenarioTests/TestCreateUpdateGetDropManagedInstance.json +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.ManagedInstanceCrudScenarioTests/TestCreateUpdateGetDropManagedInstance.json @@ -4,7 +4,7 @@ "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourcegroups/sqlcrudtest-6843?api-version=2017-05-10", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTY4NDM/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-6843\": \"2018-09-26 23:34:05Z\"\r\n }\r\n}", + "RequestBody": "{\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-6843\": \"2019-02-06 23:34:05Z\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ "6e37eab0-2567-4ec3-b316-f72fa8eac193" @@ -28,7 +28,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:34:05 GMT" + "Wed, 06 Feb 2019 23:34:05 GMT" ], "Pragma": [ "no-cache" @@ -43,7 +43,7 @@ "b3941662-927c-4638-b255-d4411ab1ecbe" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T233406Z:b3941662-927c-4638-b255-d4411ab1ecbe" + "WESTUS2:20190206T233406Z:b3941662-927c-4638-b255-d4411ab1ecbe" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -61,14 +61,14 @@ "-1" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843\",\r\n \"name\": \"sqlcrudtest-6843\",\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-6843\": \"2018-09-26 23:34:05Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843\",\r\n \"name\": \"sqlcrudtest-6843\",\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"sqlcrudtest-6843\": \"2019-02-06 23:34:05Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "StatusCode": 201 }, { "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk1?api-version=2015-05-01-preview", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4NDMvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9zcWxjbC1jcnVkdGVzdHN3aXRoZG5zem9uZS1kb3RuZXRzZGsxP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"MIGP8G4\",\r\n \"tier\": \"GeneralPurpose\"\r\n },\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n }\r\n}", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"MIGP8G4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\"\r\n },\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ "6fe9599c-4a58-4891-ac41-00e46378de10" @@ -92,7 +92,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:34:06 GMT" + "Wed, 06 Feb 2019 23:34:06 GMT" ], "Pragma": [ "no-cache" @@ -119,7 +119,7 @@ "f54df1f0-a2da-4faa-b42d-9e4fd9754582" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T233407Z:f54df1f0-a2da-4faa-b42d-9e4fd9754582" + "WESTUS2:20190206T233407Z:f54df1f0-a2da-4faa-b42d-9e4fd9754582" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -137,7 +137,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"UpsertManagedServer\",\r\n \"startTime\": \"2018-09-26T23:34:07.21Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"UpsertManagedServer\",\r\n \"startTime\": \"2019-02-06T23:34:07.21Z\"\r\n}", "StatusCode": 202 }, { @@ -156,7 +156,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:35:07 GMT" + "Wed, 06 Feb 2019 23:35:07 GMT" ], "Pragma": [ "no-cache" @@ -177,7 +177,7 @@ "04e19d8f-e44a-4616-8300-fec9440ebfd8" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T233507Z:04e19d8f-e44a-4616-8300-fec9440ebfd8" + "WESTUS2:20190206T233507Z:04e19d8f-e44a-4616-8300-fec9440ebfd8" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -195,7 +195,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-09-26T23:34:07.21Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-02-06T23:34:07.21Z\"\r\n}", "StatusCode": 200 }, { @@ -214,7 +214,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:36:07 GMT" + "Wed, 06 Feb 2019 23:36:07 GMT" ], "Pragma": [ "no-cache" @@ -235,7 +235,7 @@ "7d552065-7e5f-4466-93e9-ecd458a8f589" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T233607Z:7d552065-7e5f-4466-93e9-ecd458a8f589" + "WESTUS2:20190206T233607Z:7d552065-7e5f-4466-93e9-ecd458a8f589" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -253,7 +253,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-09-26T23:34:07.21Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-02-06T23:34:07.21Z\"\r\n}", "StatusCode": 200 }, { @@ -272,7 +272,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:37:08 GMT" + "Wed, 06 Feb 2019 23:37:08 GMT" ], "Pragma": [ "no-cache" @@ -293,7 +293,7 @@ "501966f5-852e-4176-bcf3-743d7f4a7a0b" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T233708Z:501966f5-852e-4176-bcf3-743d7f4a7a0b" + "WESTUS2:20190206T233708Z:501966f5-852e-4176-bcf3-743d7f4a7a0b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -311,7 +311,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-09-26T23:34:07.21Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-02-06T23:34:07.21Z\"\r\n}", "StatusCode": 200 }, { @@ -330,7 +330,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:38:08 GMT" + "Wed, 06 Feb 2019 23:38:08 GMT" ], "Pragma": [ "no-cache" @@ -351,7 +351,7 @@ "c46ca395-de04-4d7f-a6b7-de3cab23c869" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T233808Z:c46ca395-de04-4d7f-a6b7-de3cab23c869" + "WESTUS2:20190206T233808Z:c46ca395-de04-4d7f-a6b7-de3cab23c869" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -369,7 +369,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-09-26T23:34:07.21Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-02-06T23:34:07.21Z\"\r\n}", "StatusCode": 200 }, { @@ -388,7 +388,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:39:08 GMT" + "Wed, 06 Feb 2019 23:39:08 GMT" ], "Pragma": [ "no-cache" @@ -409,7 +409,7 @@ "01e94c0f-58ae-4bb3-9fe0-3c86151c0d47" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T233908Z:01e94c0f-58ae-4bb3-9fe0-3c86151c0d47" + "WESTUS2:20190206T233908Z:01e94c0f-58ae-4bb3-9fe0-3c86151c0d47" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -427,7 +427,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-09-26T23:34:07.21Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"80ce63de-6ef4-4bb0-9a90-a22ad0318c54\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-02-06T23:34:07.21Z\"\r\n}", "StatusCode": 200 }, { @@ -446,7 +446,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:39:08 GMT" + "Wed, 06 Feb 2019 23:39:08 GMT" ], "Pragma": [ "no-cache" @@ -464,7 +464,7 @@ "128bea23-43c6-4dd7-883c-1ccda22ae98f" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T233909Z:128bea23-43c6-4dd7-883c-1ccda22ae98f" + "WESTUS2:20190206T233909Z:128bea23-43c6-4dd7-883c-1ccda22ae98f" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -507,7 +507,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:43:10 GMT" + "Wed, 06 Feb 2019 23:43:10 GMT" ], "Pragma": [ "no-cache" @@ -525,7 +525,7 @@ "f81c8e51-253d-41bb-a1ad-bcafd689ab09" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234311Z:f81c8e51-253d-41bb-a1ad-bcafd689ab09" + "WESTUS2:20190206T234311Z:f81c8e51-253d-41bb-a1ad-bcafd689ab09" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -562,7 +562,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:44:12 GMT" + "Wed, 06 Feb 2019 23:44:12 GMT" ], "Pragma": [ "no-cache" @@ -580,7 +580,7 @@ "e5261810-a994-4daa-b845-67ca6a05d8be" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234412Z:e5261810-a994-4daa-b845-67ca6a05d8be" + "WESTUS2:20190206T234412Z:e5261810-a994-4daa-b845-67ca6a05d8be" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -605,7 +605,7 @@ "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk2?api-version=2015-05-01-preview", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTY4NDMvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbWFuYWdlZEluc3RhbmNlcy9zcWxjbC1jcnVkdGVzdHN3aXRoZG5zem9uZS1kb3RuZXRzZGsyP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"MIGP8G4\",\r\n \"tier\": \"GeneralPurpose\"\r\n },\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"dnsZonePartner\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk1\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n }\r\n}", + "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"MIGP8G4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\"\r\n },\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"dnsZonePartner\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk1\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"proxyOverride\": \"Proxy\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ "c702c816-38a6-4946-84bb-767cb7cf9908" @@ -629,7 +629,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:39:09 GMT" + "Wed, 06 Feb 2019 23:39:09 GMT" ], "Pragma": [ "no-cache" @@ -656,7 +656,7 @@ "75ccf27b-e4bb-49bd-ac68-627e86a2b5d5" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T233909Z:75ccf27b-e4bb-49bd-ac68-627e86a2b5d5" + "WESTUS2:20190206T233909Z:75ccf27b-e4bb-49bd-ac68-627e86a2b5d5" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -674,7 +674,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"UpsertManagedServer\",\r\n \"startTime\": \"2018-09-26T23:39:09.757Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"UpsertManagedServer\",\r\n \"startTime\": \"2019-02-06T23:39:09.757Z\"\r\n}", "StatusCode": 202 }, { @@ -693,7 +693,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:40:10 GMT" + "Wed, 06 Feb 2019 23:40:10 GMT" ], "Pragma": [ "no-cache" @@ -714,7 +714,7 @@ "2328c91d-6885-4e52-96c7-1110230f3e73" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234010Z:2328c91d-6885-4e52-96c7-1110230f3e73" + "WESTUS2:20190206T234010Z:2328c91d-6885-4e52-96c7-1110230f3e73" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -732,7 +732,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"b781fd68-cefe-4ebe-a38d-eefc8a593ab5\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-09-26T23:39:09.757Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"b781fd68-cefe-4ebe-a38d-eefc8a593ab5\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-02-06T23:39:09.757Z\"\r\n}", "StatusCode": 200 }, { @@ -751,7 +751,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:41:09 GMT" + "Wed, 06 Feb 2019 23:41:09 GMT" ], "Pragma": [ "no-cache" @@ -772,7 +772,7 @@ "df72ac57-c029-4bb8-b8b2-b73e78c403cd" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234110Z:df72ac57-c029-4bb8-b8b2-b73e78c403cd" + "WESTUS2:20190206T234110Z:df72ac57-c029-4bb8-b8b2-b73e78c403cd" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -790,7 +790,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"b781fd68-cefe-4ebe-a38d-eefc8a593ab5\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-09-26T23:39:09.757Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"b781fd68-cefe-4ebe-a38d-eefc8a593ab5\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-02-06T23:39:09.757Z\"\r\n}", "StatusCode": 200 }, { @@ -809,7 +809,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:42:09 GMT" + "Wed, 06 Feb 2019 23:42:09 GMT" ], "Pragma": [ "no-cache" @@ -830,7 +830,7 @@ "797474a5-1091-49ee-abe3-a317e31335af" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234210Z:797474a5-1091-49ee-abe3-a317e31335af" + "WESTUS2:20190206T234210Z:797474a5-1091-49ee-abe3-a317e31335af" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -848,7 +848,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"b781fd68-cefe-4ebe-a38d-eefc8a593ab5\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-09-26T23:39:09.757Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"b781fd68-cefe-4ebe-a38d-eefc8a593ab5\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2019-02-06T23:39:09.757Z\"\r\n}", "StatusCode": 200 }, { @@ -867,7 +867,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:43:10 GMT" + "Wed, 06 Feb 2019 23:43:10 GMT" ], "Pragma": [ "no-cache" @@ -888,7 +888,7 @@ "1fc239e3-f2b9-4265-9e30-67972dba6945" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234310Z:1fc239e3-f2b9-4265-9e30-67972dba6945" + "WESTUS2:20190206T234310Z:1fc239e3-f2b9-4265-9e30-67972dba6945" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -906,7 +906,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"b781fd68-cefe-4ebe-a38d-eefc8a593ab5\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-09-26T23:39:09.757Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"b781fd68-cefe-4ebe-a38d-eefc8a593ab5\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-02-06T23:39:09.757Z\"\r\n}", "StatusCode": 200 }, { @@ -925,7 +925,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:43:10 GMT" + "Wed, 06 Feb 2019 23:43:10 GMT" ], "Pragma": [ "no-cache" @@ -943,7 +943,7 @@ "61112b74-de64-41be-905a-55d1a34ead8b" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234311Z:61112b74-de64-41be-905a-55d1a34ead8b" + "WESTUS2:20190206T234311Z:61112b74-de64-41be-905a-55d1a34ead8b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -961,7 +961,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk2.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk2.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"proxyOverride\": \"Proxy\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 200 }, { @@ -986,7 +986,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:43:10 GMT" + "Wed, 06 Feb 2019 23:43:10 GMT" ], "Pragma": [ "no-cache" @@ -1004,7 +1004,7 @@ "8b4944e7-29ed-4bbc-b765-97f621c79ee7" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234311Z:8b4944e7-29ed-4bbc-b765-97f621c79ee7" + "WESTUS2:20190206T234311Z:8b4944e7-29ed-4bbc-b765-97f621c79ee7" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1022,7 +1022,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk2.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", + "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk2.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"proxyOverride\": \"Proxy\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n}", "StatusCode": 200 }, { @@ -1047,7 +1047,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:43:10 GMT" + "Wed, 06 Feb 2019 23:43:10 GMT" ], "Pragma": [ "no-cache" @@ -1065,7 +1065,7 @@ "3427380b-22de-4dcf-a057-ee59848032e1" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234311Z:3427380b-22de-4dcf-a057-ee59848032e1" + "WESTUS2:20190206T234311Z:3427380b-22de-4dcf-a057-ee59848032e1" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1083,7 +1083,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk2.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n },\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk1.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk1\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk1\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk2.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"proxyOverride\": \"Proxy\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n },\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk1.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk1\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk1\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { @@ -1108,7 +1108,7 @@ "no-cache" ], "Date": [ - "Thu, 27 Sep 2018 00:16:53 GMT" + "Thu, 07 Feb 2019 00:16:53 GMT" ], "Pragma": [ "no-cache" @@ -1126,7 +1126,7 @@ "b1ddd8d3-cec8-4c8a-822a-c717b1731d32" ], "x-ms-routing-request-id": [ - "WESTUS2:20180927T001654Z:b1ddd8d3-cec8-4c8a-822a-c717b1731d32" + "WESTUS2:20190207T001654Z:b1ddd8d3-cec8-4c8a-822a-c717b1731d32" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1144,7 +1144,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk2.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"GP_Gen4\",\r\n \"tier\": \"GeneralPurpose\",\r\n \"family\": \"Gen4\",\r\n \"capacity\": 16\r\n },\r\n \"properties\": {\r\n \"fullyQualifiedDomainName\": \"sqlcl-crudtestswithdnszone-dotnetsdk2.710c2a823568.database.windows.net\",\r\n \"administratorLogin\": \"dummylogin\",\r\n \"subnetId\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/StdjordjTestResourceGroup/providers/Microsoft.Network/virtualNetworks/ZiwaVirtualNetwork4/subnets/default\",\r\n \"state\": \"Ready\",\r\n \"licenseType\": \"LicenseIncluded\",\r\n \"vCores\": 16,\r\n \"storageSizeInGB\": 32,\r\n \"collation\": \"SQL_Latin1_General_CP1_CI_AS\",\r\n \"publicDataEndpointEnabled\": true,\r\n \"proxyOverride\": \"Proxy\"\r\n },\r\n \"location\": \"westcentralus\",\r\n \"tags\": {\r\n \"tagKey1\": \"TagValue1\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-6843/providers/Microsoft.Sql/managedInstances/sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"name\": \"sqlcl-crudtestswithdnszone-dotnetsdk2\",\r\n \"type\": \"Microsoft.Sql/managedInstances\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { @@ -1169,7 +1169,7 @@ "no-cache" ], "Date": [ - "Thu, 27 Sep 2018 00:17:23 GMT" + "Thu, 07 Feb 2019 00:17:23 GMT" ], "Pragma": [ "no-cache" @@ -1187,7 +1187,7 @@ "0054c64f-b1ce-4672-a281-a554e787b84a" ], "x-ms-routing-request-id": [ - "WESTUS2:20180927T001724Z:0054c64f-b1ce-4672-a281-a554e787b84a" + "WESTUS2:20190207T001724Z:0054c64f-b1ce-4672-a281-a554e787b84a" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1236,7 +1236,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:43:11 GMT" + "Wed, 06 Feb 2019 23:43:11 GMT" ], "Pragma": [ "no-cache" @@ -1263,7 +1263,7 @@ "85f6d8fa-4a90-4062-ab19-acf0019813b1" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234312Z:85f6d8fa-4a90-4062-ab19-acf0019813b1" + "WESTUS2:20190206T234312Z:85f6d8fa-4a90-4062-ab19-acf0019813b1" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1281,7 +1281,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"UpsertManagedServer\",\r\n \"startTime\": \"2018-09-26T23:43:12.2Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"UpsertManagedServer\",\r\n \"startTime\": \"2019-02-06T23:43:12.2Z\"\r\n}", "StatusCode": 202 }, { @@ -1300,7 +1300,7 @@ "no-cache" ], "Date": [ - "Wed, 26 Sep 2018 23:44:12 GMT" + "Wed, 06 Feb 2019 23:44:12 GMT" ], "Pragma": [ "no-cache" @@ -1321,7 +1321,7 @@ "204d4dda-420f-4c8c-a371-de0fdda3bafc" ], "x-ms-routing-request-id": [ - "WESTUS2:20180926T234412Z:204d4dda-420f-4c8c-a371-de0fdda3bafc" + "WESTUS2:20190206T234412Z:204d4dda-420f-4c8c-a371-de0fdda3bafc" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1339,7 +1339,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"34af2565-ea5e-4a35-b2c8-ca4081582109\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-09-26T23:43:12.2Z\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"34af2565-ea5e-4a35-b2c8-ca4081582109\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-02-06T23:43:12.2Z\"\r\n}", "StatusCode": 200 }, { @@ -1364,7 +1364,7 @@ "no-cache" ], "Date": [ - "Thu, 27 Sep 2018 00:16:26 GMT" + "Thu, 07 Feb 2019 00:16:26 GMT" ], "Pragma": [ "no-cache" @@ -1391,7 +1391,7 @@ "46daba7a-9efa-43a4-ad11-b25b8c10bed1" ], "x-ms-routing-request-id": [ - "WESTUS2:20180927T001627Z:46daba7a-9efa-43a4-ad11-b25b8c10bed1" + "WESTUS2:20190207T001627Z:46daba7a-9efa-43a4-ad11-b25b8c10bed1" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1409,7 +1409,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"DropManagedServer\",\r\n \"startTime\": \"2018-09-27T00:16:27.027Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"DropManagedServer\",\r\n \"startTime\": \"2019-02-07T00:16:27.027Z\"\r\n}", "StatusCode": 202 }, { @@ -1434,7 +1434,7 @@ "no-cache" ], "Date": [ - "Thu, 27 Sep 2018 00:16:59 GMT" + "Thu, 07 Feb 2019 00:16:59 GMT" ], "Pragma": [ "no-cache" @@ -1461,7 +1461,7 @@ "9b1b2bb5-c09a-46b0-801b-53c59c455ad3" ], "x-ms-routing-request-id": [ - "WESTUS2:20180927T001700Z:9b1b2bb5-c09a-46b0-801b-53c59c455ad3" + "WESTUS2:20190207T001700Z:9b1b2bb5-c09a-46b0-801b-53c59c455ad3" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1479,7 +1479,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"operation\": \"DropManagedServer\",\r\n \"startTime\": \"2018-09-27T00:16:59.983Z\"\r\n}", + "ResponseBody": "{\r\n \"operation\": \"DropManagedServer\",\r\n \"startTime\": \"2019-02-07T00:16:59.983Z\"\r\n}", "StatusCode": 202 }, { @@ -1498,7 +1498,7 @@ "no-cache" ], "Date": [ - "Thu, 27 Sep 2018 00:17:23 GMT" + "Thu, 07 Feb 2019 00:17:23 GMT" ], "Pragma": [ "no-cache" @@ -1516,7 +1516,7 @@ "04804d48-e8cd-4df9-9d37-5258058ac1e8" ], "x-ms-routing-request-id": [ - "WESTUS2:20180927T001724Z:04804d48-e8cd-4df9-9d37-5258058ac1e8" + "WESTUS2:20190207T001724Z:04804d48-e8cd-4df9-9d37-5258058ac1e8" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -1559,7 +1559,7 @@ "no-cache" ], "Date": [ - "Thu, 27 Sep 2018 00:17:30 GMT" + "Thu, 07 Feb 2019 00:17:30 GMT" ], "Pragma": [ "no-cache" @@ -1580,7 +1580,7 @@ "18976646-4cc7-4c38-8c5a-7488d075de70" ], "x-ms-routing-request-id": [ - "WESTUS2:20180927T001730Z:18976646-4cc7-4c38-8c5a-7488d075de70" + "WESTUS2:20190207T001730Z:18976646-4cc7-4c38-8c5a-7488d075de70" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" diff --git a/src/SDKs/_metadata/sql_resource-manager.txt b/src/SDKs/_metadata/sql_resource-manager.txt index 0eee85270ac7..6701ee2d1bd8 100644 --- a/src/SDKs/_metadata/sql_resource-manager.txt +++ b/src/SDKs/_metadata/sql_resource-manager.txt @@ -3,12 +3,12 @@ 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/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\azure-sdk-for-net\src\SDKs -2019-01-18 17:41:20 UTC +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\azure-sdk-for-net\src\SDKs +2019-02-08 17:59:13 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 2c26ca134086846b742141e3dfffcc8b92afeccf +Commit: be751b27058624ecde8be51d7327443ce3c86264 AutoRest information Requested version: latest Bootstrapper version: autorest@2.0.4283