using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
namespace Retailcrm.Versions.V4
{
public partial class Client
{
///
/// Price types
///
///
public Response PriceTypes()
{
return Request.MakeRequest(
"/reference/price-types",
Request.MethodGet
);
}
///
/// Price type edit
///
///
///
public Response PriceTypesEdit(Dictionary type)
{
if (!type.ContainsKey("code"))
{
throw new ArgumentException("Parameter `code` is missing");
}
if (!type.ContainsKey("name"))
{
throw new ArgumentException("Parameter `name` is missing");
}
return Request.MakeRequest(
$"/reference/price-types/{type["code"].ToString()}/edit",
Request.MethodPost,
new Dictionary
{
{ "priceType", new JavaScriptSerializer().Serialize(type) }
}
);
}
}
}