<commit_before>﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net.Http;
using System.Threading.Tasks;
using Kudu.Client.Infrastructure;
using Kudu.Contracts.Infrastructure;
using Newtonsoft.Json.Linq;

namespace Kudu.Client.Deployment
{
    public class RemoteDeploymentSettingsManager : KuduRemoteClientBase
    {
        public RemoteDeploymentSettingsManager(string serviceUrl)
            : base(serviceUrl)
        {
        }

        public RemoteDeploymentSettingsManager(string serviceUrl, HttpClientHandler handler)
            : base(serviceUrl, handler)
        {
        }

        public Task SetValueLegacy(string key, string value)
        {
            var values = HttpClientHelper.CreateJsonContent(new KeyValuePair<string, string>("key", key), new KeyValuePair<string, string>("value", value));
            return _client.PostAsync(String.Empty, values).Then(response => response.EnsureSuccessful());
        }

        public Task SetValue(string key, string value)
        {
            var values = HttpClientHelper.CreateJsonContent(new KeyValuePair<string, string>(key, value));
            return _client.PostAsync(String.Empty, values).Then(response => response.EnsureSuccessful());
        }

        public Task<NameValueCollection> GetValues()
        {
            return _client.GetJsonAsync<JObject>(String.Empty).Then(obj =>
            {
                var nvc = new NameValueCollection();
                foreach (var pair in obj)<commit_msg>add SetValues to RemoteDeploymentSettingsManager<commit_after>﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net.Http;
using System.Threading.Tasks;
using Kudu.Client.Infrastructure;
using Kudu.Contracts.Infrastructure;
using Newtonsoft.Json.Linq;

namespace Kudu.Client.Deployment
{
    public class RemoteDeploymentSettingsManager : KuduRemoteClientBase
    {
        public RemoteDeploymentSettingsManager(string serviceUrl)
            : base(serviceUrl)
        {
        }

        public RemoteDeploymentSettingsManager(string serviceUrl, HttpClientHandler handler)
            : base(serviceUrl, handler)
        {
        }

        public Task SetValueLegacy(string key, string value)
        {
            var values = HttpClientHelper.CreateJsonContent(new KeyValuePair<string, string>("key", key), new KeyValuePair<string, string>("value", value));
            return _client.PostAsync(String.Empty, values).Then(response => response.EnsureSuccessful());
        }

        public Task SetValue(string key, string value)
        {
            var values = HttpClientHelper.CreateJsonContent(new KeyValuePair<string, string>(key, value));
            return _client.PostAsync(String.Empty, values).Then(response => response.EnsureSuccessful());
        }

        public Task SetValues(params KeyValuePair<string, string>[] values)
        {
            var jsonvalues = HttpClientHelper.CreateJsonContent(values);
            return _client.PostAsync(String.Empty, jsonvalues).Then(response => response.EnsureSuccessful());
        }

        public Task<NameValueCollection> GetValues()
        {
            return _client.GetJsonAsync<JObject>(String.Empty).Then(obj =>
            {
                var nvc = new NameValueCollection();
                foreach (var pair in obj)
{'fraction_non_alphanumeric': 0.09115122817401598, 'fraction_numerical': 0.0, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6033205', 'n_tokens_mistral': 862, 'n_tokens_neox': 860, 'n_words': 181}