mirror of
https://github.com/retailcrm/api-client-dotnet.git
synced 2025-04-11 13:00:55 +00:00
annotations
This commit is contained in:
parent
66be54b6db
commit
f9f688c209
34 changed files with 683 additions and 5 deletions
|
@ -2,10 +2,18 @@
|
|||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Unversioned API Client
|
||||
/// </summary>
|
||||
public class Connection
|
||||
{
|
||||
private readonly Request _request;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Unversioned API Client Constructor
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="key"></param>
|
||||
public Connection(string url, string key)
|
||||
{
|
||||
if ("/" != url.Substring(url.Length - 1, 1))
|
||||
|
@ -18,6 +26,10 @@
|
|||
_request = new Request(url, new Dictionary<string, object> { { "apiKey", key } });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get available API versions
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response Versions()
|
||||
{
|
||||
return _request.MakeRequest(
|
||||
|
@ -26,6 +38,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get available API methods
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response Credentials()
|
||||
{
|
||||
return _request.MakeRequest(
|
||||
|
|
|
@ -5,11 +5,20 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
/// <summary>
|
||||
/// QueryBuilder
|
||||
/// </summary>
|
||||
public class QueryBuilder
|
||||
{
|
||||
private readonly List<KeyValuePair<string, object>> _keyValuePairs
|
||||
= new List<KeyValuePair<string, object>>();
|
||||
|
||||
/// <summary>
|
||||
/// Build PHP like query string
|
||||
/// </summary>
|
||||
/// <param name="queryData"></param>
|
||||
/// <param name="argSeperator"></param>
|
||||
/// <returns></returns>
|
||||
public static string BuildQueryString(object queryData, string argSeperator = "&")
|
||||
{
|
||||
var encoder = new QueryBuilder();
|
||||
|
|
|
@ -7,9 +7,18 @@
|
|||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
/// <summary>
|
||||
/// Request
|
||||
/// </summary>
|
||||
public class Request
|
||||
{
|
||||
/// <summary>
|
||||
/// Get method
|
||||
/// </summary>
|
||||
public const string MethodGet = "GET";
|
||||
/// <summary>
|
||||
/// Post method
|
||||
/// </summary>
|
||||
public const string MethodPost = "POST";
|
||||
private const string UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
|
||||
private const string ContentType = "application/x-www-form-urlencoded";
|
||||
|
@ -17,6 +26,12 @@
|
|||
private readonly string _url;
|
||||
private readonly Dictionary<string, object> _defaultParameters;
|
||||
|
||||
/// <summary>
|
||||
/// Request constructor
|
||||
/// </summary>
|
||||
/// <param name="apiUrl"></param>
|
||||
/// <param name="parameters"></param>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
public Request(string apiUrl, Dictionary<string, object> parameters = null)
|
||||
{
|
||||
if (apiUrl.IndexOf("https://", StringComparison.Ordinal) == -1)
|
||||
|
@ -28,6 +43,15 @@
|
|||
_defaultParameters = parameters;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make request method
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="method"></param>
|
||||
/// <param name="parameters"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
/// <exception cref="WebException"></exception>
|
||||
public Response MakeRequest(string path, string method, Dictionary<string, object> parameters = null)
|
||||
{
|
||||
string[] allowedMethods = { MethodGet, MethodPost };
|
||||
|
|
|
@ -3,12 +3,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Response
|
||||
/// </summary>
|
||||
public class Response
|
||||
{
|
||||
private readonly int _statusCode;
|
||||
private readonly string _rawResponse;
|
||||
private readonly Dictionary<string, object> _responseData;
|
||||
|
||||
/// <summary>
|
||||
/// Response constructor
|
||||
/// </summary>
|
||||
/// <param name="statusCode"></param>
|
||||
/// <param name="responseBody"></param>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
public Response(int statusCode, string responseBody = null)
|
||||
{
|
||||
_statusCode = statusCode;
|
||||
|
@ -24,21 +33,37 @@
|
|||
_responseData = (Dictionary<string, object>)jsSerializer.DeserializeObject(responseBody);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get response status code
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int GetStatusCode()
|
||||
{
|
||||
return _statusCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get response body data
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Dictionary<string, object> GetResponse()
|
||||
{
|
||||
return _responseData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get raw response body
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetRawResponse()
|
||||
{
|
||||
return _rawResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check response is successfull
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsSuccessfull()
|
||||
{
|
||||
return _statusCode < 400;
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
<DocumentationFile>bin\Release\Retailcrm.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="JetBrains.Annotations, Version=11.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\Marwin\packages\JetBrains.Annotations.11.0.0\lib\net20\JetBrains.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
|
@ -78,6 +81,7 @@
|
|||
<Compile Include="Versions\V5\Users.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Retailcrm.nuspec" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
|
|
@ -4,11 +4,26 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
/// <summary>
|
||||
/// V3 Client
|
||||
/// </summary>
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Request
|
||||
/// </summary>
|
||||
protected Request Request;
|
||||
/// <summary>
|
||||
/// Site code
|
||||
/// </summary>
|
||||
protected string SiteCode;
|
||||
|
||||
/// <summary>
|
||||
/// V3 Client Constructor
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="site"></param>
|
||||
public Client(string url, string key, string site = "")
|
||||
{
|
||||
if ("/" != url.Substring(url.Length - 1, 1))
|
||||
|
|
|
@ -6,6 +6,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Create customer
|
||||
/// </summary>
|
||||
/// <param name="customer"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
public Response CustomersCreate(Dictionary<string, object> customer, string site = "")
|
||||
{
|
||||
if (customer.Count < 1)
|
||||
|
@ -26,6 +33,14 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update customer
|
||||
/// </summary>
|
||||
/// <param name="customer"></param>
|
||||
/// <param name="by"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
public Response CustomersUpdate(Dictionary<string, object> customer, string by = "externalId", string site = "")
|
||||
{
|
||||
if (customer.Count < 1)
|
||||
|
@ -56,6 +71,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get customer
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="by"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomersGet(string id, string by = "externalId", string site = "")
|
||||
{
|
||||
CheckIdParameter(by);
|
||||
|
@ -72,6 +94,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get customers list
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomersList(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -94,6 +123,11 @@
|
|||
return Request.MakeRequest("/customers", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fix external id
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomersFixExternalIds(Dictionary<string, object>[] ids)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -106,6 +140,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upload customers
|
||||
/// </summary>
|
||||
/// <param name="customers"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
public Response CustomersUpload(List<object> customers, string site = "")
|
||||
{
|
||||
if (customers.Count < 1)
|
||||
|
|
|
@ -6,6 +6,12 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Create order
|
||||
/// </summary>
|
||||
/// <param name="order"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersCreate(Dictionary<string, object> order, string site = "")
|
||||
{
|
||||
if (order.Count < 1)
|
||||
|
@ -26,6 +32,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update order
|
||||
/// </summary>
|
||||
/// <param name="order"></param>
|
||||
/// <param name="by"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersUpdate(Dictionary<string, object> order, string by = "externalId", string site = "")
|
||||
{
|
||||
if (order.Count < 1)
|
||||
|
@ -56,6 +69,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get order
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="by"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersGet(string id, string by = "externalId", string site = "")
|
||||
{
|
||||
CheckIdParameter(by);
|
||||
|
@ -72,7 +92,14 @@
|
|||
);
|
||||
}
|
||||
|
||||
public Response OrdersList(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersList(Dictionary<string, object> filter = null, int page = 1, int limit = 20)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
||||
|
@ -81,12 +108,12 @@
|
|||
parameters.Add("filter", filter);
|
||||
}
|
||||
|
||||
if (page > 0)
|
||||
if (page > 1)
|
||||
{
|
||||
parameters.Add("page", page);
|
||||
}
|
||||
|
||||
if (limit > 0)
|
||||
if (limit > 20)
|
||||
{
|
||||
parameters.Add("limit", limit);
|
||||
}
|
||||
|
@ -94,6 +121,11 @@
|
|||
return Request.MakeRequest("/orders", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fix external ids
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersFixExternalIds(Dictionary<string, object>[] ids)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -106,6 +138,15 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get orders history
|
||||
/// </summary>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="endDate"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <param name="offset"></param>
|
||||
/// <param name="skipMyChanges"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersHistory(DateTime? startDate = null, DateTime? endDate = null, int limit = 200, int offset = 0, bool skipMyChanges = true)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -139,6 +180,12 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get orders statuses
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <param name="externalIds"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersStatuses(List<string> ids, List<string> externalIds = null)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -174,6 +221,12 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Orders upload
|
||||
/// </summary>
|
||||
/// <param name="orders"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersUpload(List<object> orders, string site = "")
|
||||
{
|
||||
if (orders.Count < 1)
|
||||
|
|
|
@ -6,6 +6,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get packs list
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response PacksList(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -28,6 +35,11 @@
|
|||
return Request.MakeRequest("/orders/packs", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create pack
|
||||
/// </summary>
|
||||
/// <param name="pack"></param>
|
||||
/// <returns></returns>
|
||||
public Response PacksCreate(Dictionary<string, object> pack)
|
||||
{
|
||||
if (pack.Count < 1)
|
||||
|
@ -45,6 +57,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update pack data
|
||||
/// </summary>
|
||||
/// <param name="pack"></param>
|
||||
/// <returns></returns>
|
||||
public Response PacksUpdate(Dictionary<string, object> pack)
|
||||
{
|
||||
if (pack.Count < 1)
|
||||
|
@ -67,6 +84,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete pack
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Response PacksDelete(string id)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -75,6 +97,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get pack by id
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Response PacksGet(string id)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -83,6 +110,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get packs history
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response PacksHistory(Dictionary<string, object> filter = null, int page = 1, int limit = 20)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Countries
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response Countries()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -14,6 +18,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delivery services
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response DeliveryServices()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -22,6 +30,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delivery types
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response DeliveryTypes()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -30,6 +42,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Order methods
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response OrderMethods()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -38,6 +54,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Order types
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response OrderTypes()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -46,6 +66,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Payment statuses
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response PaymentStatuses()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -54,6 +78,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Payment types
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response PaymentTypes()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -62,6 +90,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Product statuses
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response ProductStatuses()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -70,6 +102,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sites
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response Sites()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -78,6 +114,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Statuses groups
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response StatusGroups()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -86,6 +126,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Statuses
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response Statuses()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -94,6 +138,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stores
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response Stores()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -102,6 +150,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delivery services edit
|
||||
/// </summary>
|
||||
/// <param name="service"></param>
|
||||
/// <returns></returns>
|
||||
public Response DeliveryServicesEdit(Dictionary<string, object> service)
|
||||
{
|
||||
if (!service.ContainsKey("code"))
|
||||
|
@ -124,6 +177,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delivery types edit
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public Response DeliveryTypesEdit(Dictionary<string, object> type)
|
||||
{
|
||||
if (!type.ContainsKey("code"))
|
||||
|
@ -156,6 +214,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Orders methods edit
|
||||
/// </summary>
|
||||
/// <param name="method"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrderMethodsEdit(Dictionary<string, object> method)
|
||||
{
|
||||
if (!method.ContainsKey("code"))
|
||||
|
@ -178,6 +241,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Order types edit
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrderTypesEdit(Dictionary<string, object> type)
|
||||
{
|
||||
if (!type.ContainsKey("code"))
|
||||
|
@ -200,6 +268,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Payment statuses edit
|
||||
/// </summary>
|
||||
/// <param name="status"></param>
|
||||
/// <returns></returns>
|
||||
public Response PaymentStatusesEdit(Dictionary<string, object> status)
|
||||
{
|
||||
if (!status.ContainsKey("code"))
|
||||
|
@ -222,6 +295,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Payment types edit
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public Response PaymentTypesEdit(Dictionary<string, object> type)
|
||||
{
|
||||
if (!type.ContainsKey("code"))
|
||||
|
@ -244,6 +322,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Product statuses edit
|
||||
/// </summary>
|
||||
/// <param name="status"></param>
|
||||
/// <returns></returns>
|
||||
public Response ProductStatusesEdit(Dictionary<string, object> status)
|
||||
{
|
||||
if (!status.ContainsKey("code"))
|
||||
|
@ -266,6 +349,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sites edit
|
||||
/// </summary>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response SitesEdit(Dictionary<string, object> site)
|
||||
{
|
||||
if (!site.ContainsKey("code"))
|
||||
|
@ -293,6 +381,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Statuses edit
|
||||
/// </summary>
|
||||
/// <param name="status"></param>
|
||||
/// <returns></returns>
|
||||
public Response StatusesEdit(Dictionary<string, object> status)
|
||||
{
|
||||
if (!status.ContainsKey("code"))
|
||||
|
@ -325,6 +418,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stores edit
|
||||
/// </summary>
|
||||
/// <param name="store"></param>
|
||||
/// <returns></returns>
|
||||
public Response StoresEdit(Dictionary<string, object> store)
|
||||
{
|
||||
if (!store.ContainsKey("code"))
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
{
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Update statistic
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response StatisticUpdate()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
|
|
@ -6,6 +6,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get inventories
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response StoreInventoriesGet(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -28,6 +35,12 @@
|
|||
return Request.MakeRequest("/store/inventories", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upload inventories
|
||||
/// </summary>
|
||||
/// <param name="offers"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response StoreInventoriesUpload(List<object> offers, string site = "")
|
||||
{
|
||||
if (offers.Count< 1)
|
||||
|
|
|
@ -3,8 +3,17 @@
|
|||
using System.Collections.Generic;
|
||||
using ParentClass = V3.Client;
|
||||
|
||||
/// <summary>
|
||||
/// V4 Client
|
||||
/// </summary>
|
||||
public partial class Client : ParentClass
|
||||
{
|
||||
/// <summary>
|
||||
/// V4 Client Constructor
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="site"></param>
|
||||
public Client(string url, string key, string site = "") : base(url, key, site)
|
||||
{
|
||||
if ("/" != url.Substring(url.Length - 1, 1))
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Customers history
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomersHistory(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get delivery settings
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public Response DeliverySettingGet(string code)
|
||||
{
|
||||
if (string.IsNullOrEmpty(code))
|
||||
|
@ -19,6 +24,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edit delivery settings
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
/// <returns></returns>
|
||||
public Response DeliverySettingsEdit(Dictionary<string, object> configuration)
|
||||
{
|
||||
if (configuration.Count < 1)
|
||||
|
@ -56,6 +66,12 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update delivery tracking
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <param name="statusUpdate"></param>
|
||||
/// <returns></returns>
|
||||
public Response DeliveryTracking(string code, List<object> statusUpdate)
|
||||
{
|
||||
if (string.IsNullOrEmpty(code))
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Edit marketplace module settings
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
/// <returns></returns>
|
||||
public Response MarketplaceSettingsEdit(Dictionary<string, object> configuration)
|
||||
{
|
||||
if (configuration.Count < 1)
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get orders history
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersHistory(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Price types
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response PriceTypes()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -14,6 +18,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Price type edit
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public Response PriceTypesEdit(Dictionary<string, object> type)
|
||||
{
|
||||
if (!type.ContainsKey("code"))
|
||||
|
|
|
@ -6,6 +6,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get products
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response StoreProducts(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -28,6 +35,11 @@
|
|||
return Request.MakeRequest("/store/products", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upload prices
|
||||
/// </summary>
|
||||
/// <param name="prices"></param>
|
||||
/// <returns></returns>
|
||||
public Response StorePricesUpload(List<object> prices)
|
||||
{
|
||||
if (prices.Count< 1)
|
||||
|
@ -50,6 +62,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get store settings
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public Response StoreSettingGet(string code)
|
||||
{
|
||||
if (string.IsNullOrEmpty(code))
|
||||
|
@ -63,6 +80,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edit store settings
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
/// <returns></returns>
|
||||
public Response StoreSettingsEdit(Dictionary<string, object> configuration)
|
||||
{
|
||||
if (configuration.Count < 1)
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get users
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response Users(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -26,6 +33,12 @@
|
|||
return Request.MakeRequest("/users", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get users groups
|
||||
/// </summary>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response UsersGroups(int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -43,6 +56,11 @@
|
|||
return Request.MakeRequest("/user-groups", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Response User(int id)
|
||||
{
|
||||
return Request.MakeRequest($"/users/{id}", Request.MethodGet);
|
||||
|
|
|
@ -3,8 +3,17 @@
|
|||
using System.Collections.Generic;
|
||||
using ParentClass = V4.Client;
|
||||
|
||||
/// <summary>
|
||||
/// V5 Client
|
||||
/// </summary>
|
||||
public partial class Client : ParentClass
|
||||
{
|
||||
/// <summary>
|
||||
/// V5 Client Constructor
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="site"></param>
|
||||
public Client(string url, string key, string site = "") : base(url, key, site)
|
||||
{
|
||||
if ("/" != url.Substring(url.Length - 1, 1))
|
||||
|
|
|
@ -6,6 +6,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get costs
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response CostsList(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -28,6 +35,12 @@
|
|||
return Request.MakeRequest("/costs", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create cost
|
||||
/// </summary>
|
||||
/// <param name="cost"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response CostsCreate(Dictionary<string, object> cost, string site = "")
|
||||
{
|
||||
if (cost.Count < 1)
|
||||
|
@ -48,6 +61,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete cost
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public Response CostsDelete(List<string> ids)
|
||||
{
|
||||
if (ids.Count < 1)
|
||||
|
@ -65,6 +83,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upload costs
|
||||
/// </summary>
|
||||
/// <param name="costs"></param>
|
||||
/// <returns></returns>
|
||||
public Response CostsUpload(List<object> costs)
|
||||
{
|
||||
if (costs.Count < 1)
|
||||
|
@ -82,11 +105,21 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get cost
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Response CostsGet(int id)
|
||||
{
|
||||
return Request.MakeRequest($"/costs/{id}", Request.MethodGet);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Batch delete
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Response CostsDelete(string id)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -95,6 +128,12 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update cost
|
||||
/// </summary>
|
||||
/// <param name="cost"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response CostsUpdate(Dictionary<string, object> cost, string site = "")
|
||||
{
|
||||
if (cost.Count < 1)
|
||||
|
|
|
@ -6,6 +6,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get custom fields
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomFieldsList(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -28,6 +35,12 @@
|
|||
return Request.MakeRequest("/custom-fields", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create custom field
|
||||
/// </summary>
|
||||
/// <param name="customField"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomFieldsCreate(Dictionary<string, object> customField, string entity = "")
|
||||
{
|
||||
List<string> types = new List<string>
|
||||
|
@ -72,6 +85,12 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get custom field
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomFieldsGet(string code, string entity)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -80,6 +99,12 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update custom field
|
||||
/// </summary>
|
||||
/// <param name="customField"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomFieldsUpdate(Dictionary<string, object> customField, string entity = "")
|
||||
{
|
||||
if (customField.Count < 1)
|
||||
|
@ -107,6 +132,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get custom dictionaries
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomDictionaryList(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -129,6 +161,11 @@
|
|||
return Request.MakeRequest("/custom-fields/dictionaries", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create custom dictionary
|
||||
/// </summary>
|
||||
/// <param name="customDictionary"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomDictionaryCreate(Dictionary<string, object> customDictionary)
|
||||
{
|
||||
if (customDictionary.Count < 1)
|
||||
|
@ -156,6 +193,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get custom dictionary
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomDictionaryGet(string code)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -164,6 +206,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update custom dictionary
|
||||
/// </summary>
|
||||
/// <param name="customDictionary"></param>
|
||||
/// <returns></returns>
|
||||
public Response CustomDictionaryUpdate(Dictionary<string, object> customDictionary)
|
||||
{
|
||||
if (customDictionary.Count < 1)
|
||||
|
|
|
@ -5,11 +5,21 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get delivery settings
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public new Response DeliverySettingGet(string code)
|
||||
{
|
||||
throw new ArgumentException("This method is unavailable in API V5", code);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update delivery settings
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
/// <returns></returns>
|
||||
public new Response DeliverySettingsEdit(Dictionary<string, object> configuration)
|
||||
{
|
||||
throw new ArgumentException("This method is unavailable in API V5");
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get integration settings
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public Response IntegrationsSettingGet(string code)
|
||||
{
|
||||
if (string.IsNullOrEmpty(code))
|
||||
|
@ -19,6 +24,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create/Update integration settings
|
||||
/// </summary>
|
||||
/// <param name="integrationModule"></param>
|
||||
/// <returns></returns>
|
||||
public Response IntegrationsSettingsEdit(Dictionary<string, object> integrationModule)
|
||||
{
|
||||
if (integrationModule.Count < 1)
|
||||
|
|
|
@ -6,6 +6,12 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Create note
|
||||
/// </summary>
|
||||
/// <param name="note"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response NotesCreate(Dictionary<string, object> note, string site = "")
|
||||
{
|
||||
if (note.Count < 1)
|
||||
|
@ -26,6 +32,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete note
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Response NotesDelete(string id)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -34,6 +45,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get notes list
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response NotesList(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
|
|
@ -6,6 +6,13 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Combine orders
|
||||
/// </summary>
|
||||
/// <param name="order"></param>
|
||||
/// <param name="resultOrder"></param>
|
||||
/// <param name="technique"></param>
|
||||
/// <returns></returns>
|
||||
public Response OrdersCombine(Dictionary<string, object> order, Dictionary<string, object> resultOrder, string technique = "ours")
|
||||
{
|
||||
if (order.Count <= 0)
|
||||
|
|
|
@ -6,6 +6,12 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Create payment
|
||||
/// </summary>
|
||||
/// <param name="payment"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response PaymentsCreate(Dictionary<string, object> payment, string site = "")
|
||||
{
|
||||
if (payment.Count < 1)
|
||||
|
@ -26,6 +32,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update payment
|
||||
/// </summary>
|
||||
/// <param name="payment"></param>
|
||||
/// <param name="by"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response PaymentsUpdate(Dictionary<string, object> payment, string by = "id", string site = "")
|
||||
{
|
||||
if (payment.Count < 1)
|
||||
|
@ -56,6 +69,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete payment
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Response PaymentsDelete(string id)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Costs groups
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response CostGroups()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -14,6 +18,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Costs
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response CostItems()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -22,6 +30,10 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Legal entities
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Response LegalEntities()
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -30,6 +42,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cost group edit
|
||||
/// </summary>
|
||||
/// <param name="group"></param>
|
||||
/// <returns></returns>
|
||||
public Response CostGroupsEdit(Dictionary<string, object> group)
|
||||
{
|
||||
if (!group.ContainsKey("code"))
|
||||
|
@ -57,6 +74,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cost items edit
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <returns></returns>
|
||||
public Response CostItemsEdit(Dictionary<string, object> item)
|
||||
{
|
||||
if (!item.ContainsKey("code"))
|
||||
|
@ -90,6 +112,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Legal entities edit
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public Response LegalEntitiesEdit(Dictionary<string, object> entity)
|
||||
{
|
||||
if (!entity.ContainsKey("code"))
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
namespace Retailcrm.Versions.V5
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get segments
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response Segments(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
|
|
@ -5,16 +5,33 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Get external store settings
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public new Response StoreSettingGet(string code)
|
||||
{
|
||||
throw new ArgumentException("This method is unavailable in API V5", code);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edit external store settings
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
/// <returns></returns>
|
||||
public new Response StoreSettingsEdit(Dictionary<string, object> configuration)
|
||||
{
|
||||
throw new ArgumentException("This method is unavailable in API V5");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get products groups
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response StoreProductsGroups(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
@ -37,6 +54,13 @@
|
|||
return Request.MakeRequest("/store/products-groups", Request.MethodGet, parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get products properties
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response StoreProductsProperties(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
|
|
@ -6,6 +6,12 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a task
|
||||
/// </summary>
|
||||
/// <param name="task"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response TasksCreate(Dictionary<string, object> task, string site = "")
|
||||
{
|
||||
if (task.Count < 1)
|
||||
|
@ -26,6 +32,12 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update a task
|
||||
/// </summary>
|
||||
/// <param name="task"></param>
|
||||
/// <param name="site"></param>
|
||||
/// <returns></returns>
|
||||
public Response TasksUpdate(Dictionary<string, object> task, string site = "")
|
||||
{
|
||||
if (task.Count < 1)
|
||||
|
@ -51,6 +63,11 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get task
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Response TasksGet(string id)
|
||||
{
|
||||
return Request.MakeRequest(
|
||||
|
@ -59,6 +76,13 @@
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get tasks list
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
public Response TasksList(Dictionary<string, object> filter = null, int page = 0, int limit = 0)
|
||||
{
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
|
|
|
@ -5,6 +5,12 @@
|
|||
|
||||
public partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Update user status
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="status"></param>
|
||||
/// <returns></returns>
|
||||
public Response UsersStatus(int id, string status)
|
||||
{
|
||||
List<string> statuses = new List<string> { "free", "busy", "dinner", "break"};
|
||||
|
|
4
Retailcrm/packages.config
Normal file
4
Retailcrm/packages.config
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="JetBrains.Annotations" version="11.0.0" targetFramework="net45" />
|
||||
</packages>
|
Loading…
Add table
Reference in a new issue