private void PatchOperations(string resourceGroupName, string serverName, string databaseName,
                                     PatchOperations operations, bool isManagedInstance, string currentOrRecommended)
        {
            Uri    endpoint = Context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager);
            string uri      = $"{endpoint}/subscriptions/{Subscription.Id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/{(isManagedInstance ? "managedInstances" : "servers")}/{serverName}/databases/{databaseName}/{currentOrRecommended}SensitivityLabels?api-version=2017-03-01-preview";
            string content  = JsonConvert.SerializeObject(operations, new JsonSerializerSettings
            {
                Converters = new List <JsonConverter>()
                {
                    new Rest.Serialization.TransformationJsonConverter()
                },
                NullValueHandling = NullValueHandling.Ignore
            });

            HttpRequestMessage httpRequest = new HttpRequestMessage
            {
                Method     = new HttpMethod("Patch"),
                RequestUri = new Uri(uri),
                Content    = new StringContent(content, Encoding.UTF8, "application/json")
            };

            SqlManagementClient client = GetCurrentSqlManagementClient();

            client.Credentials.ProcessHttpRequestAsync(httpRequest, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();
            HttpResponseMessage response = client.HttpClient.SendAsync(httpRequest, CancellationToken.None).Result;

            response.EnsureSuccessStatusCode();
        }
 internal void PatchManagedDatabaseSensitivityRecommendations(string resourceGroupName, string managedInstanceName, string databaseName,
                                                              PatchOperations operations)
 {
     PatchOperations(resourceGroupName, managedInstanceName, databaseName, operations,
                     isManagedInstance: true, currentOrRecommended: "recommended");
 }
 internal void PatchSensitivityRecommendations(string resourceGroupName, string serverName, string databaseName,
                                               PatchOperations operations)
 {
     PatchOperations(resourceGroupName, serverName, databaseName, operations,
                     isManagedInstance: false, currentOrRecommended: "recommended");
 }