using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using WooCommerceNET;
using WooCommerceNET.WooCommerce.v3;

namespace SVS_XDWooSync_Isolcasa
{
    public class fWoo
    {

        //Atualiza o stock de um artigo em especifico
        private bool atualizaStockWoo(string woosku)
        {

            return true;
        }

        public void ResponseFilter(HttpWebResponse response)
        {
            //var total = int.Parse(response.Headers["X-WP-Total"]);
            //var pagecount = int.Parse(response.Headers["X-WP-TotalPages"]);
            var statuscode = response.StatusCode; //int.Parse(response.Headers["StatusCode"]);
            var location = response.Method; // int.Parse(response.Headers["Location"]);
        }

        private void RequestFilter(HttpWebRequest request)
        {
            request.UserAgent = "SVS XDWooSync";
        }

        public string createWooProduct(Product product)
        {

            return "";
        }

        public bool testcon()
        {
            RestAPI rest = new RestAPI(globals.WooURL, globals.WooCK, globals.WooCS, requestFilter: RequestFilter, responseFilter: ResponseFilter);
            WCObject wc = new WCObject(rest);

            wc.Product.GetAll().GetAwaiter().GetResult();

            
            
            return false;
            return true;
        }



        




    }
}
