<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;

namespace Ecommerce.Prestashop
{
    //public enum IOFormat
    //{
    //    XML,
    //    JSON
    //}

    public class PrestaShopWebserviceException : Exception
    {
        public PrestaShopWebserviceException() { }
        public PrestaShopWebserviceException(string message) : base(message) { }
        public PrestaShopWebserviceException(string message, Exception innerException) : base(message, innerException) { }
    }

    public class RequestResponse
    {
        public RequestResponse(int code, string header, string data)
        {
            this.Code = code;
            this.Header = header;
            this.Data = data;
        }

        public int Code { get; set; }
        public string Header { get; set; }
        public string Data { get; set; }
    }

    /// <summary>
    /// Instantiate the PrestaShopWebService to start executing operations against the PrestaShop Web Service
    /// </summary>
    public class PrestaShopWebService : IPrestaShopWebService
    {
        private readonly string apiUrl;
        private readonly string apiKey;
        private readonly bool debug;

        // Versions of the PrestaShop Web Service supported by this client library
        private readonly Version MIN_COMPATIBLE_VERSION;
        private readonly Version MAX_COMPATIBLE_VERSION;

        // For URL encoding
        private readonly Encoding ENCODING;

        // Output type (XML or JSON, default: XML)
        // Only supported in PS 1.6.0.9 and greater
        //private readonly IOFormat IO_FORMAT;

        public Version CurrentVersion { get; private set; }

        /// <summary>
        /// Create instance of PrestaShopWebService
        /// </summary>
        /// <param name="apiUrl"></param>
        /// <param name="apiKey"></param>
        /// <param name="ioFormat">Only supported in PS 1.6.0.9 and greater</param>
        /// <param name="debug"></param>
        public PrestaShopWebService(string apiUrl, string apiKey, bool debug = true)
        {
            this.MIN_COMPATIBLE_VERSION = new Version("1.4.0.17");
            this.MAX_COMPATIBLE_VERSION = new Version("1.6.0.9");

            this.ENCODING = Encoding.UTF8;

            this.apiUrl = MakeValidApiUrl(apiUrl);
            this.apiKey = apiKey;
            this.debug = debug;
        }<commit_msg>Added support for PS 1.6.0.14<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;

namespace Ecommerce.Prestashop
{
    //public enum IOFormat
    //{
    //    XML,
    //    JSON
    //}

    public class PrestaShopWebserviceException : Exception
    {
        public PrestaShopWebserviceException() { }
        public PrestaShopWebserviceException(string message) : base(message) { }
        public PrestaShopWebserviceException(string message, Exception innerException) : base(message, innerException) { }
    }

    public class RequestResponse
    {
        public RequestResponse(int code, string header, string data)
        {
            this.Code = code;
            this.Header = header;
            this.Data = data;
        }

        public int Code { get; set; }
        public string Header { get; set; }
        public string Data { get; set; }
    }

    /// <summary>
    /// Instantiate the PrestaShopWebService to start executing operations against the PrestaShop Web Service
    /// </summary>
    public class PrestaShopWebService : IPrestaShopWebService
    {
        private readonly string apiUrl;
        private readonly string apiKey;
        private readonly bool debug;

        // Versions of the PrestaShop Web Service supported by this client library
        private readonly Version MIN_COMPATIBLE_VERSION;
        private readonly Version MAX_COMPATIBLE_VERSION;

        // For URL encoding
        private readonly Encoding ENCODING;

        // Output type (XML or JSON, default: XML)
        // Only supported in PS 1.6.0.9 and greater
        //private readonly IOFormat IO_FORMAT;

        public Version CurrentVersion { get; private set; }

        /// <summary>
        /// Create instance of PrestaShopWebService
        /// </summary>
        /// <param name="apiUrl"></param>
        /// <param name="apiKey"></param>
        /// <param name="ioFormat">Only supported in PS 1.6.0.9 and greater</param>
        /// <param name="debug"></param>
        public PrestaShopWebService(string apiUrl, string apiKey, bool debug = true)
        {
            this.MIN_COMPATIBLE_VERSION = new Version("1.4.0.17");
            this.MAX_COMPATIBLE_VERSION = new Version("1.6.0.14");

            this.ENCODING = Encoding.UTF8;

            this.apiUrl = MakeValidApiUrl(apiUrl);
            this.apiKey = apiKey;
            this.debug = debug;
        }
{'fraction_non_alphanumeric': 0.09459193706981317, 'fraction_numerical': 0.008259587020648967, 'mean_word_length': 2.247765006385696, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 9, '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': '4544778', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1347, 'n_words': 394}