From a5af7393e99ae82149a7899324b1ab3c3c4fa2e9 Mon Sep 17 00:00:00 2001 From: adxsdknet <39844661+adxsdknet@users.noreply.github.com> Date: Tue, 23 Apr 2019 14:49:12 -0700 Subject: [PATCH] .NET SDK Resource Provider:'SqlManagement' (#5899) REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/5730' REST Spec PR Author 'johnpaulkee' REST Spec PR Last commit --- ...agedDatabaseSensitivityLabelsOperations.cs | 78 ++- .../Generated/IManagedInstancesOperations.cs | 95 ++- .../Generated/ISensitivityLabelsOperations.cs | 78 ++- ...agedDatabaseSensitivityLabelsOperations.cs | 437 +++++++++++++- ...seSensitivityLabelsOperationsExtensions.cs | 142 ++++- .../Generated/ManagedInstancesOperations.cs | 544 +++++++++++++++--- .../ManagedInstancesOperationsExtensions.cs | 156 +++-- .../Generated/Models/ManagedInstance.cs | 101 +++- .../Models/ManagedInstanceLicenseType.cs | 22 + .../Generated/Models/ManagedInstanceUpdate.cs | 95 ++- ...Override.cs => ManagedServerCreateMode.cs} | 7 +- .../Generated/Models/SensitivityLabel.cs | 16 +- .../Generated/SdkInfo_SqlManagementClient.cs | 11 - .../Generated/SensitivityLabelsOperations.cs | 437 +++++++++++++- .../SensitivityLabelsOperationsExtensions.cs | 142 ++++- 15 files changed, 2146 insertions(+), 215 deletions(-) create mode 100644 src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceLicenseType.cs rename src/SDKs/SqlManagement/Management.Sql/Generated/Models/{ManagedInstanceProxyOverride.cs => ManagedServerCreateMode.cs} (70%) diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedDatabaseSensitivityLabelsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedDatabaseSensitivityLabelsOperations.cs index 85dacc28eb6cf..c63e8601974e0 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedDatabaseSensitivityLabelsOperations.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedDatabaseSensitivityLabelsOperations.cs @@ -146,6 +146,79 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Disables sensitivity recommendations on 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 DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enables sensitivity recommendations on a given column + /// (recommendations are enabled by default on all columns) + /// + /// + /// 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 EnableRecommendationWithHttpMessagesAsync(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 /// /// @@ -195,6 +268,9 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// OData parameters to apply to the operation. /// + /// + /// Specifies whether to include disabled recommendations or not. + /// /// /// /// @@ -212,7 +288,7 @@ public partial interface IManagedDatabaseSensitivityLabelsOperations /// /// 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)); + Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), bool? includeDisabledRecommendations = default(bool?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the sensitivity labels of a given database /// diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedInstancesOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedInstancesOperations.cs index ca73e258f610c..779b1fbbfc31a 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedInstancesOperations.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedInstancesOperations.cs @@ -23,25 +23,6 @@ namespace Microsoft.Azure.Management.Sql /// public partial interface IManagedInstancesOperations { - /// - /// Gets a list of all managed instances in the subscription. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of managed instances in a resource group. /// @@ -178,6 +159,52 @@ public partial interface IManagedInstancesOperations /// Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets a list of all managed instances in an instance pool. + /// + /// + /// 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 instance pool name. + /// + /// + /// 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>> ListByInstancePoolWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates or updates a managed instance. /// /// @@ -262,7 +289,7 @@ public partial interface IManagedInstancesOperations /// Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of all managed instances in the subscription. + /// Gets a list of managed instances in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -282,9 +309,9 @@ public partial interface IManagedInstancesOperations /// /// Thrown when a required parameter is null /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The NextLink from the previous successful call to List operation. @@ -304,6 +331,28 @@ public partial interface IManagedInstancesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInstancePoolNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(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 index cddf9fa19d5e5..bc4c9920da284 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/ISensitivityLabelsOperations.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISensitivityLabelsOperations.cs @@ -74,6 +74,9 @@ public partial interface ISensitivityLabelsOperations /// /// OData parameters to apply to the operation. /// + /// + /// Specifies whether to include disabled recommendations or not. + /// /// /// /// @@ -91,7 +94,80 @@ public partial interface ISensitivityLabelsOperations /// /// 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)); + Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), bool? includeDisabledRecommendations = default(bool?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enables sensitivity recommendations on a given column + /// (recommendations are enabled by default on all columns) + /// + /// + /// 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 EnableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Disables sensitivity recommendations on 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 DisableRecommendationWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the sensitivity label of a given column /// diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperations.cs index 3a77c5221ca49..04ed1a2032b9f 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperations.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperations.cs @@ -767,6 +767,433 @@ public async Task DeleteWithHttpMessagesAsync(string res return _result; } + /// + /// Disables sensitivity recommendations on 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 DisableRecommendationWithHttpMessagesAsync(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 = "recommended"; + 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, "DisableRecommendation", 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}/disable").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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) + /// + /// + /// 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 EnableRecommendationWithHttpMessagesAsync(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 = "recommended"; + 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, "EnableRecommendation", 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}/enable").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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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 /// @@ -999,6 +1426,9 @@ public async Task>> ListCurrentBy /// /// OData parameters to apply to the operation. /// + /// + /// Specifies whether to include disabled recommendations or not. + /// /// /// /// @@ -1022,7 +1452,7 @@ public async Task>> ListCurrentBy /// /// 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)) + public async Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), bool? includeDisabledRecommendations = default(bool?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1052,6 +1482,7 @@ public async Task>> ListRecommend tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("includeDisabledRecommendations", includeDisabledRecommendations); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1073,6 +1504,10 @@ public async Task>> ListRecommend _queryParameters.Add(_odataFilter); } } + if (includeDisabledRecommendations != null) + { + _queryParameters.Add(string.Format("includeDisabledRecommendations={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeDisabledRecommendations, Client.SerializationSettings).Trim('"')))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs index 701df89b3ef1a..b619b09ab8b96 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedDatabaseSensitivityLabelsOperationsExtensions.cs @@ -231,6 +231,134 @@ public static async Task DeleteAsync(this IManagedDatabaseSensitivityLabelsOpera (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Disables sensitivity recommendations on 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 DisableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) + { + operations.DisableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + } + + /// + /// Disables sensitivity recommendations on 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 DisableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) + /// + /// + /// 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 EnableRecommendation(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) + { + operations.EnableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + } + + /// + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) + /// + /// + /// 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 EnableRecommendationAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Gets the sensitivity labels of a given database /// @@ -304,11 +432,14 @@ public static async Task> ListCurrentByDatabaseAsync(thi /// /// OData parameters to apply to the operation. /// + /// + /// Specifies whether to include disabled recommendations or not. + /// /// /// - public static IPage ListRecommendedByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + public static IPage ListRecommendedByDatabase(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), bool? includeDisabledRecommendations = default(bool?), string skipToken = default(string)) { - return operations.ListRecommendedByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken).GetAwaiter().GetResult(); + return operations.ListRecommendedByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, includeDisabledRecommendations, skipToken).GetAwaiter().GetResult(); } /// @@ -330,14 +461,17 @@ public static IPage ListRecommendedByDatabase(this IManagedDat /// /// OData parameters to apply to the operation. /// + /// + /// Specifies whether to include disabled recommendations or not. + /// /// /// /// /// 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)) + public static async Task> ListRecommendedByDatabaseAsync(this IManagedDatabaseSensitivityLabelsOperations operations, string resourceGroupName, string managedInstanceName, string databaseName, ODataQuery odataQuery = default(ODataQuery), bool? includeDisabledRecommendations = default(bool?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, managedInstanceName, databaseName, odataQuery, includeDisabledRecommendations, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstancesOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstancesOperations.cs index 855c4b1476078..8136af88031ce 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstancesOperations.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstancesOperations.cs @@ -51,8 +51,12 @@ internal ManagedInstancesOperations(SqlManagementClient client) public SqlManagementClient Client { get; private set; } /// - /// Gets a list of all managed instances in the subscription. + /// Gets a list of managed instances in a resource group. /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// /// /// Headers that will be added to request. /// @@ -74,8 +78,12 @@ internal ManagedInstancesOperations(SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -88,13 +96,15 @@ public async Task>> ListWithHttpMe { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -227,12 +237,15 @@ public async Task>> ListWithHttpMe } /// - /// Gets a list of managed instances in a resource group. + /// Gets a managed instance. /// /// /// 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. + /// /// /// Headers that will be added to request. /// @@ -254,12 +267,16 @@ public async Task>> ListWithHttpMe /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, 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 (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -273,14 +290,16 @@ public async Task>> ListByResource _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("managedInstanceName", managedInstanceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + 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").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -380,7 +399,7 @@ public async Task>> ListByResource throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -393,7 +412,7 @@ public async Task>> ListByResource _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -413,7 +432,56 @@ public async Task>> ListByResource } /// - /// Gets a managed instance. + /// Creates or updates a managed instance. + /// + /// + /// 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 requested managed instance resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a managed instance. + /// + /// + /// 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 headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a managed instance. /// /// /// The name of the resource group that contains the resource. You can obtain @@ -422,6 +490,32 @@ public async Task>> ListByResource /// /// The name of the managed instance. /// + /// + /// The requested managed instance resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a list of all managed instances in an instance pool. + /// + /// + /// 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 instance pool name. + /// /// /// Headers that will be added to request. /// @@ -443,15 +537,15 @@ public async Task>> ListByResource /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByInstancePoolWithHttpMessagesAsync(string resourceGroupName, string instancePoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (managedInstanceName == null) + if (instancePoolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "instancePoolName"); } if (Client.SubscriptionId == null) { @@ -466,16 +560,16 @@ public async Task> GetWithHttpMessagesAs _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("instancePoolName", instancePoolName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInstancePool", 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{instancePoolName}", System.Uri.EscapeDataString(instancePoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -575,7 +669,7 @@ public async Task> GetWithHttpMessagesAs throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -588,7 +682,7 @@ public async Task> GetWithHttpMessagesAs _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -608,78 +702,179 @@ public async Task> GetWithHttpMessagesAs } /// - /// Creates or updates a managed instance. + /// Gets a list of all managed instances in the subscription. /// - /// - /// 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 requested managed instance resource state. - /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstance parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances").ToString(); + _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); + } - /// - /// Deletes a managed instance. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, managedInstanceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// - /// Updates a managed instance. - /// - /// - /// 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 requested managed instance resource state. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, ManagedInstanceUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { + 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 - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + 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; } /// @@ -1297,7 +1492,7 @@ public async Task> BeginUpdateWithHttpMe } /// - /// Gets a list of all managed instances in the subscription. + /// Gets a list of managed instances in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1323,7 +1518,7 @@ public async Task> BeginUpdateWithHttpMe /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1338,7 +1533,7 @@ public async Task>> ListNextWithHt Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1470,7 +1665,7 @@ public async Task>> ListNextWithHt } /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The NextLink from the previous successful call to List operation. @@ -1496,7 +1691,7 @@ public async Task>> ListNextWithHt /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByInstancePoolNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1511,7 +1706,180 @@ public async Task>> ListByResource Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInstancePoolNext", 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 a list of all managed instances in the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstancesOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstancesOperationsExtensions.cs index e714971cf255b..2877fb5abf37a 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstancesOperationsExtensions.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstancesOperationsExtensions.cs @@ -21,34 +21,6 @@ namespace Microsoft.Azure.Management.Sql /// public static partial class ManagedInstancesOperationsExtensions { - /// - /// Gets a list of all managed instances in the subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IManagedInstancesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all managed instances in the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IManagedInstancesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets a list of managed instances in a resource group. /// @@ -262,6 +234,76 @@ public static async Task UpdateAsync(this IManagedInstancesOper } } + /// + /// Gets a list of all managed instances in an instance pool. + /// + /// + /// 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 instance pool name. + /// + public static IPage ListByInstancePool(this IManagedInstancesOperations operations, string resourceGroupName, string instancePoolName) + { + return operations.ListByInstancePoolAsync(resourceGroupName, instancePoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all managed instances in an instance pool. + /// + /// + /// 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 instance pool name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByInstancePoolAsync(this IManagedInstancesOperations operations, string resourceGroupName, string instancePoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInstancePoolWithHttpMessagesAsync(resourceGroupName, instancePoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IManagedInstancesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IManagedInstancesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates or updates a managed instance. /// @@ -398,7 +440,7 @@ public static async Task BeginUpdateAsync(this IManagedInstance } /// - /// Gets a list of all managed instances in the subscription. + /// Gets a list of managed instances in a resource group. /// /// /// The operations group for this extension method. @@ -406,13 +448,13 @@ public static async Task BeginUpdateAsync(this IManagedInstance /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IManagedInstancesOperations operations, string nextPageLink) + public static IPage ListByResourceGroupNext(this IManagedInstancesOperations operations, string nextPageLink) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets a list of all managed instances in the subscription. + /// Gets a list of managed instances in a resource group. /// /// /// The operations group for this extension method. @@ -423,16 +465,16 @@ public static IPage ListNext(this IManagedInstancesOperations o /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IManagedInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByResourceGroupNextAsync(this IManagedInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The operations group for this extension method. @@ -440,13 +482,13 @@ public static async Task> ListNextAsync(this IManagedInst /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByResourceGroupNext(this IManagedInstancesOperations operations, string nextPageLink) + public static IPage ListByInstancePoolNext(this IManagedInstancesOperations operations, string nextPageLink) { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByInstancePoolNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets a list of managed instances in a resource group. + /// Gets a list of all managed instances in an instance pool. /// /// /// The operations group for this extension method. @@ -457,9 +499,43 @@ public static IPage ListByResourceGroupNext(this IManagedInstan /// /// The cancellation token. /// - public static async Task> ListByResourceGroupNextAsync(this IManagedInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByInstancePoolNextAsync(this IManagedInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInstancePoolNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IManagedInstancesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IManagedInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(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 870cf1ac335a8..54cb38876a316 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstance.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstance.cs @@ -41,7 +41,17 @@ public ManagedInstance() /// Resource tags. /// The Azure Active Directory identity of the /// managed instance. - /// Managed instance sku + /// Managed instance SKU. Allowed values for + /// sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5 + /// Specifies the mode of + /// database creation. + /// + /// Default: Regular instance creation. + /// + /// Restore: Creates an instance by restoring a set of backups to + /// specific point in time. RestorePointInTime and + /// SourceManagedInstanceId must be specified. Possible values include: + /// 'Default', 'PointInTimeRestore' /// The fully qualified domain /// name of the managed instance. /// Administrator username for the @@ -53,24 +63,33 @@ public ManagedInstance() /// instance. /// The state of the managed instance. /// The license type. Possible values are - /// 'LicenseIncluded' and 'BasePrice'. - /// The number of VCores. - /// The maximum storage size in - /// GB. + /// 'LicenseIncluded' (regular price inclusive of a new SQL license) + /// and 'BasePrice' (discounted AHB price for bringing your own SQL + /// licenses). Possible values include: 'LicenseIncluded', + /// 'BasePrice' + /// The number of vCores. Allowed values: 8, 16, + /// 24, 32, 40, 64, 80. + /// Storage size in GB. Minimum value: + /// 32. Maximum value: 8192. Increments of 32 GB allowed only. /// Collation of the managed instance. - /// The Dns Zone that the managed instance is + /// The Dns Zone taht the managed instance is /// in. /// 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' + /// The resource identifier of + /// the source managed instance associated with create operation of + /// this instance. + /// Specifies the point in time + /// (ISO8601 format) of the source database that will be restored to + /// create the new database. + /// Proxy override of the managed + /// instance. /// Id of the timezone. Allowed values are /// timezones supported by Windows. - /// Windows keeps details on supported timezones, including the id, in + /// Winodws keeps details on supported timezones, including the id, in /// registry under /// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time /// Zones. @@ -80,11 +99,14 @@ public ManagedInstance() /// [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. /// An example of valid timezone id is "Pacific Standard Time" or "W. /// Europe Standard Time". - 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), string timezoneId = default(string)) + /// The Id of the instance pool this + /// managed server belongs to. + 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 managedInstanceCreateMode = default(string), 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 sourceManagedInstanceId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), string proxyOverride = default(string), string timezoneId = default(string), string instancePoolId = default(string)) : base(location, id, name, type, tags) { Identity = identity; Sku = sku; + ManagedInstanceCreateMode = managedInstanceCreateMode; FullyQualifiedDomainName = fullyQualifiedDomainName; AdministratorLogin = administratorLogin; AdministratorLoginPassword = administratorLoginPassword; @@ -97,8 +119,11 @@ public ManagedInstance(string location, string id = default(string), string name DnsZone = dnsZone; DnsZonePartner = dnsZonePartner; PublicDataEndpointEnabled = publicDataEndpointEnabled; + SourceManagedInstanceId = sourceManagedInstanceId; + RestorePointInTime = restorePointInTime; ProxyOverride = proxyOverride; TimezoneId = timezoneId; + InstancePoolId = instancePoolId; CustomInit(); } @@ -115,11 +140,25 @@ public ManagedInstance(string location, string id = default(string), string name public ResourceIdentity Identity { get; set; } /// - /// Gets or sets managed instance sku + /// Gets or sets managed instance SKU. Allowed values for sku.name: + /// GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5 /// [JsonProperty(PropertyName = "sku")] public Sku Sku { get; set; } + /// + /// Gets or sets specifies the mode of database creation. + /// + /// Default: Regular instance creation. + /// + /// Restore: Creates an instance by restoring a set of backups to + /// specific point in time. RestorePointInTime and + /// SourceManagedInstanceId must be specified. Possible values include: + /// 'Default', 'PointInTimeRestore' + /// + [JsonProperty(PropertyName = "properties.managedInstanceCreateMode")] + public string ManagedInstanceCreateMode { get; set; } + /// /// Gets the fully qualified domain name of the managed instance. /// @@ -155,19 +194,23 @@ public ManagedInstance(string location, string id = default(string), string name /// /// Gets or sets the license type. Possible values are - /// 'LicenseIncluded' and 'BasePrice'. + /// 'LicenseIncluded' (regular price inclusive of a new SQL license) + /// and 'BasePrice' (discounted AHB price for bringing your own SQL + /// licenses). Possible values include: 'LicenseIncluded', 'BasePrice' /// [JsonProperty(PropertyName = "properties.licenseType")] public string LicenseType { get; set; } /// - /// Gets or sets the number of VCores. + /// Gets or sets the number of vCores. Allowed values: 8, 16, 24, 32, + /// 40, 64, 80. /// [JsonProperty(PropertyName = "properties.vCores")] public int? VCores { get; set; } /// - /// Gets or sets the maximum storage size in GB. + /// Gets or sets storage size in GB. Minimum value: 32. Maximum value: + /// 8192. Increments of 32 GB allowed only. /// [JsonProperty(PropertyName = "properties.storageSizeInGB")] public int? StorageSizeInGB { get; set; } @@ -179,7 +222,7 @@ public ManagedInstance(string location, string id = default(string), string name public string Collation { get; set; } /// - /// Gets the Dns Zone that the managed instance is in. + /// Gets the Dns Zone taht the managed instance is in. /// [JsonProperty(PropertyName = "properties.dnsZone")] public string DnsZone { get; private set; } @@ -198,8 +241,21 @@ public ManagedInstance(string location, string id = default(string), string name public bool? PublicDataEndpointEnabled { get; set; } /// - /// Gets or sets connection type used for connecting to the instance. - /// Possible values include: 'Proxy', 'Redirect', 'Default' + /// Gets or sets the resource identifier of the source managed instance + /// associated with create operation of this instance. + /// + [JsonProperty(PropertyName = "properties.sourceManagedInstanceId")] + public string SourceManagedInstanceId { get; set; } + + /// + /// Gets or sets specifies the point in time (ISO8601 format) of the + /// source database that will be restored to create the new database. + /// + [JsonProperty(PropertyName = "properties.restorePointInTime")] + public System.DateTime? RestorePointInTime { get; set; } + + /// + /// Gets or sets proxy override of the managed instance. /// [JsonProperty(PropertyName = "properties.proxyOverride")] public string ProxyOverride { get; set; } @@ -207,7 +263,7 @@ public ManagedInstance(string location, string id = default(string), string name /// /// Gets or sets id of the timezone. Allowed values are timezones /// supported by Windows. - /// Windows keeps details on supported timezones, including the id, in + /// Winodws keeps details on supported timezones, including the id, in /// registry under /// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time /// Zones. @@ -221,6 +277,13 @@ public ManagedInstance(string location, string id = default(string), string name [JsonProperty(PropertyName = "properties.timezoneId")] public string TimezoneId { get; set; } + /// + /// Gets or sets the Id of the instance pool this managed server + /// belongs to. + /// + [JsonProperty(PropertyName = "properties.instancePoolId")] + public string InstancePoolId { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceLicenseType.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceLicenseType.cs new file mode 100644 index 0000000000000..518832b8e90d8 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceLicenseType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql.Models +{ + + /// + /// Defines values for ManagedInstanceLicenseType. + /// + public static class ManagedInstanceLicenseType + { + public const string LicenseIncluded = "LicenseIncluded"; + public const string BasePrice = "BasePrice"; + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceUpdate.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceUpdate.cs index 4ad944b68194f..b3530dd15d6e7 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceUpdate.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceUpdate.cs @@ -35,6 +35,15 @@ public ManagedInstanceUpdate() /// Initializes a new instance of the ManagedInstanceUpdate class. /// /// Managed instance sku + /// Specifies the mode of + /// database creation. + /// + /// Default: Regular instance creation. + /// + /// Restore: Creates an instance by restoring a set of backups to + /// specific point in time. RestorePointInTime and + /// SourceManagedInstanceId must be specified. Possible values include: + /// 'Default', 'PointInTimeRestore' /// The fully qualified domain /// name of the managed instance. /// Administrator username for the @@ -46,24 +55,33 @@ public ManagedInstanceUpdate() /// instance. /// The state of the managed instance. /// The license type. Possible values are - /// 'LicenseIncluded' and 'BasePrice'. - /// The number of VCores. - /// The maximum storage size in - /// GB. + /// 'LicenseIncluded' (regular price inclusive of a new SQL license) + /// and 'BasePrice' (discounted AHB price for bringing your own SQL + /// licenses). Possible values include: 'LicenseIncluded', + /// 'BasePrice' + /// The number of vCores. Allowed values: 8, 16, + /// 24, 32, 40, 64, 80. + /// Storage size in GB. Minimum value: + /// 32. Maximum value: 8192. Increments of 32 GB allowed only. /// Collation of the managed instance. - /// The Dns Zone that the managed instance is + /// The Dns Zone taht the managed instance is /// in. /// 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' + /// The resource identifier of + /// the source managed instance associated with create operation of + /// this instance. + /// Specifies the point in time + /// (ISO8601 format) of the source database that will be restored to + /// create the new database. + /// Proxy override of the managed + /// instance. /// Id of the timezone. Allowed values are /// timezones supported by Windows. - /// Windows keeps details on supported timezones, including the id, in + /// Winodws keeps details on supported timezones, including the id, in /// registry under /// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time /// Zones. @@ -73,10 +91,13 @@ public ManagedInstanceUpdate() /// [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. /// An example of valid timezone id is "Pacific Standard Time" or "W. /// Europe Standard Time". + /// The Id of the instance pool this + /// managed server belongs to. /// 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), bool? publicDataEndpointEnabled = default(bool?), string proxyOverride = default(string), string timezoneId = default(string), IDictionary tags = default(IDictionary)) + public ManagedInstanceUpdate(Sku sku = default(Sku), string managedInstanceCreateMode = default(string), 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 sourceManagedInstanceId = default(string), System.DateTime? restorePointInTime = default(System.DateTime?), string proxyOverride = default(string), string timezoneId = default(string), string instancePoolId = default(string), IDictionary tags = default(IDictionary)) { Sku = sku; + ManagedInstanceCreateMode = managedInstanceCreateMode; FullyQualifiedDomainName = fullyQualifiedDomainName; AdministratorLogin = administratorLogin; AdministratorLoginPassword = administratorLoginPassword; @@ -89,8 +110,11 @@ public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomain DnsZone = dnsZone; DnsZonePartner = dnsZonePartner; PublicDataEndpointEnabled = publicDataEndpointEnabled; + SourceManagedInstanceId = sourceManagedInstanceId; + RestorePointInTime = restorePointInTime; ProxyOverride = proxyOverride; TimezoneId = timezoneId; + InstancePoolId = instancePoolId; Tags = tags; CustomInit(); } @@ -106,6 +130,19 @@ public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomain [JsonProperty(PropertyName = "sku")] public Sku Sku { get; set; } + /// + /// Gets or sets specifies the mode of database creation. + /// + /// Default: Regular instance creation. + /// + /// Restore: Creates an instance by restoring a set of backups to + /// specific point in time. RestorePointInTime and + /// SourceManagedInstanceId must be specified. Possible values include: + /// 'Default', 'PointInTimeRestore' + /// + [JsonProperty(PropertyName = "properties.managedInstanceCreateMode")] + public string ManagedInstanceCreateMode { get; set; } + /// /// Gets the fully qualified domain name of the managed instance. /// @@ -141,19 +178,23 @@ public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomain /// /// Gets or sets the license type. Possible values are - /// 'LicenseIncluded' and 'BasePrice'. + /// 'LicenseIncluded' (regular price inclusive of a new SQL license) + /// and 'BasePrice' (discounted AHB price for bringing your own SQL + /// licenses). Possible values include: 'LicenseIncluded', 'BasePrice' /// [JsonProperty(PropertyName = "properties.licenseType")] public string LicenseType { get; set; } /// - /// Gets or sets the number of VCores. + /// Gets or sets the number of vCores. Allowed values: 8, 16, 24, 32, + /// 40, 64, 80. /// [JsonProperty(PropertyName = "properties.vCores")] public int? VCores { get; set; } /// - /// Gets or sets the maximum storage size in GB. + /// Gets or sets storage size in GB. Minimum value: 32. Maximum value: + /// 8192. Increments of 32 GB allowed only. /// [JsonProperty(PropertyName = "properties.storageSizeInGB")] public int? StorageSizeInGB { get; set; } @@ -165,7 +206,7 @@ public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomain public string Collation { get; set; } /// - /// Gets the Dns Zone that the managed instance is in. + /// Gets the Dns Zone taht the managed instance is in. /// [JsonProperty(PropertyName = "properties.dnsZone")] public string DnsZone { get; private set; } @@ -184,8 +225,21 @@ public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomain public bool? PublicDataEndpointEnabled { get; set; } /// - /// Gets or sets connection type used for connecting to the instance. - /// Possible values include: 'Proxy', 'Redirect', 'Default' + /// Gets or sets the resource identifier of the source managed instance + /// associated with create operation of this instance. + /// + [JsonProperty(PropertyName = "properties.sourceManagedInstanceId")] + public string SourceManagedInstanceId { get; set; } + + /// + /// Gets or sets specifies the point in time (ISO8601 format) of the + /// source database that will be restored to create the new database. + /// + [JsonProperty(PropertyName = "properties.restorePointInTime")] + public System.DateTime? RestorePointInTime { get; set; } + + /// + /// Gets or sets proxy override of the managed instance. /// [JsonProperty(PropertyName = "properties.proxyOverride")] public string ProxyOverride { get; set; } @@ -193,7 +247,7 @@ public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomain /// /// Gets or sets id of the timezone. Allowed values are timezones /// supported by Windows. - /// Windows keeps details on supported timezones, including the id, in + /// Winodws keeps details on supported timezones, including the id, in /// registry under /// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time /// Zones. @@ -207,6 +261,13 @@ public ManagedInstanceUpdate(Sku sku = default(Sku), string fullyQualifiedDomain [JsonProperty(PropertyName = "properties.timezoneId")] public string TimezoneId { get; set; } + /// + /// Gets or sets the Id of the instance pool this managed server + /// belongs to. + /// + [JsonProperty(PropertyName = "properties.instancePoolId")] + public string InstancePoolId { get; set; } + /// /// Gets or sets resource tags. /// diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceProxyOverride.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedServerCreateMode.cs similarity index 70% rename from src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceProxyOverride.cs rename to src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedServerCreateMode.cs index dd6d2f6602692..141db5dae3f7d 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedInstanceProxyOverride.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/ManagedServerCreateMode.cs @@ -12,12 +12,11 @@ namespace Microsoft.Azure.Management.Sql.Models { /// - /// Defines values for ManagedInstanceProxyOverride. + /// Defines values for ManagedServerCreateMode. /// - public static class ManagedInstanceProxyOverride + public static class ManagedServerCreateMode { - public const string Proxy = "Proxy"; - public const string Redirect = "Redirect"; public const string Default = "Default"; + public const string PointInTimeRestore = "PointInTimeRestore"; } } diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabel.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabel.cs index b02c7ca609800..6c6f6c943ae2a 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabel.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/SensitivityLabel.cs @@ -39,13 +39,18 @@ public SensitivityLabel() /// 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)) + /// Is sensitivity recommendation disabled. + /// Applicable for recommended sensitivity label only. Specifies + /// whether the sensitivity recommendation on this column is disabled + /// (dismissed) or not. + 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), bool? isDisabled = default(bool?)) : base(id, name, type) { LabelName = labelName; LabelId = labelId; InformationType = informationType; InformationTypeId = informationTypeId; + IsDisabled = isDisabled; CustomInit(); } @@ -78,5 +83,14 @@ public SensitivityLabel(string id = default(string), string name = default(strin [JsonProperty(PropertyName = "properties.informationTypeId")] public string InformationTypeId { get; set; } + /// + /// Gets is sensitivity recommendation disabled. Applicable for + /// recommended sensitivity label only. Specifies whether the + /// sensitivity recommendation on this column is disabled (dismissed) + /// or not. + /// + [JsonProperty(PropertyName = "properties.isDisabled")] + public bool? IsDisabled { get; private set; } + } } diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs index 12a1f48e72910..bf5a63564ab78 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs @@ -105,16 +105,5 @@ internal static partial class SdkInfo }.AsEnumerable(); } } - // 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:\\git\\azure-sdk-for-net\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "8e9cb1d67ee601367a89188821acabff9eca36d2"; - 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 index a628476643ad8..0dd4fe37efe69 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperations.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperations.cs @@ -283,6 +283,9 @@ public async Task>> ListCurrentBy /// /// OData parameters to apply to the operation. /// + /// + /// Specifies whether to include disabled recommendations or not. + /// /// /// /// @@ -306,7 +309,7 @@ public async Task>> ListCurrentBy /// /// 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)) + public async Task>> ListRecommendedByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), bool? includeDisabledRecommendations = default(bool?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -336,6 +339,7 @@ public async Task>> ListRecommend tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serverName", serverName); tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("includeDisabledRecommendations", includeDisabledRecommendations); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -357,6 +361,10 @@ public async Task>> ListRecommend _queryParameters.Add(_odataFilter); } } + if (includeDisabledRecommendations != null) + { + _queryParameters.Add(string.Format("includeDisabledRecommendations={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeDisabledRecommendations, Client.SerializationSettings).Trim('"')))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -490,6 +498,433 @@ public async Task>> ListRecommend return _result; } + /// + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) + /// + /// + /// 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 EnableRecommendationWithHttpMessagesAsync(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 = "recommended"; + 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, "EnableRecommendation", 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}/enable").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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + + /// + /// Disables sensitivity recommendations on 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 DisableRecommendationWithHttpMessagesAsync(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 = "recommended"; + 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, "DisableRecommendation", 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}/disable").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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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 label of a given column /// diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperationsExtensions.cs index 3488d98927f8d..a647ae07ee4a1 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperationsExtensions.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SensitivityLabelsOperationsExtensions.cs @@ -95,11 +95,14 @@ public static async Task> ListCurrentByDatabaseAsync(thi /// /// OData parameters to apply to the operation. /// + /// + /// Specifies whether to include disabled recommendations or not. + /// /// /// - public static IPage ListRecommendedByDatabase(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + public static IPage ListRecommendedByDatabase(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), bool? includeDisabledRecommendations = default(bool?), string skipToken = default(string)) { - return operations.ListRecommendedByDatabaseAsync(resourceGroupName, serverName, databaseName, odataQuery, skipToken).GetAwaiter().GetResult(); + return operations.ListRecommendedByDatabaseAsync(resourceGroupName, serverName, databaseName, odataQuery, includeDisabledRecommendations, skipToken).GetAwaiter().GetResult(); } /// @@ -121,19 +124,150 @@ public static IPage ListRecommendedByDatabase(this ISensitivit /// /// OData parameters to apply to the operation. /// + /// + /// Specifies whether to include disabled recommendations or not. + /// /// /// /// /// 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)) + public static async Task> ListRecommendedByDatabaseAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, ODataQuery odataQuery = default(ODataQuery), bool? includeDisabledRecommendations = default(bool?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListRecommendedByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, odataQuery, includeDisabledRecommendations, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) + /// + /// + /// 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 EnableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) + { + operations.EnableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + } + + /// + /// Enables sensitivity recommendations on a given column (recommendations are + /// enabled by default on all columns) + /// + /// + /// 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 EnableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.EnableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Disables sensitivity recommendations on 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 DisableRecommendation(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) + { + operations.DisableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + } + + /// + /// Disables sensitivity recommendations on 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 DisableRecommendationAsync(this ISensitivityLabelsOperations operations, string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DisableRecommendationWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Gets the sensitivity label of a given column ///