diff --git a/Retailcrm/Connection.cs b/Retailcrm/Connection.cs index 64420f7..ea7056c 100644 --- a/Retailcrm/Connection.cs +++ b/Retailcrm/Connection.cs @@ -2,10 +2,18 @@ { using System.Collections.Generic; + /// + /// Unversioned API Client + /// public class Connection { private readonly Request _request; - + + /// + /// Unversioned API Client Constructor + /// + /// + /// public Connection(string url, string key) { if ("/" != url.Substring(url.Length - 1, 1)) @@ -18,6 +26,10 @@ _request = new Request(url, new Dictionary { { "apiKey", key } }); } + /// + /// Get available API versions + /// + /// public Response Versions() { return _request.MakeRequest( @@ -26,6 +38,10 @@ ); } + /// + /// Get available API methods + /// + /// public Response Credentials() { return _request.MakeRequest( diff --git a/Retailcrm/QueryBuilder.cs b/Retailcrm/QueryBuilder.cs index 1dc4536..cef037a 100644 --- a/Retailcrm/QueryBuilder.cs +++ b/Retailcrm/QueryBuilder.cs @@ -5,11 +5,20 @@ using System.Collections.Generic; using System.Linq; + /// + /// QueryBuilder + /// public class QueryBuilder { private readonly List> _keyValuePairs = new List>(); + /// + /// Build PHP like query string + /// + /// + /// + /// public static string BuildQueryString(object queryData, string argSeperator = "&") { var encoder = new QueryBuilder(); diff --git a/Retailcrm/Request.cs b/Retailcrm/Request.cs index f1685de..bac5dde 100644 --- a/Retailcrm/Request.cs +++ b/Retailcrm/Request.cs @@ -7,9 +7,18 @@ using System.Net; using System.Text; + /// + /// Request + /// public class Request { + /// + /// Get method + /// public const string MethodGet = "GET"; + /// + /// Post method + /// 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 _defaultParameters; + /// + /// Request constructor + /// + /// + /// + /// public Request(string apiUrl, Dictionary parameters = null) { if (apiUrl.IndexOf("https://", StringComparison.Ordinal) == -1) @@ -28,6 +43,15 @@ _defaultParameters = parameters; } + /// + /// Make request method + /// + /// + /// + /// + /// + /// + /// public Response MakeRequest(string path, string method, Dictionary parameters = null) { string[] allowedMethods = { MethodGet, MethodPost }; diff --git a/Retailcrm/Response.cs b/Retailcrm/Response.cs index 3e3a4ae..fe836eb 100644 --- a/Retailcrm/Response.cs +++ b/Retailcrm/Response.cs @@ -3,12 +3,21 @@ using System; using System.Collections.Generic; + /// + /// Response + /// public class Response { private readonly int _statusCode; private readonly string _rawResponse; private readonly Dictionary _responseData; + /// + /// Response constructor + /// + /// + /// + /// public Response(int statusCode, string responseBody = null) { _statusCode = statusCode; @@ -24,21 +33,37 @@ _responseData = (Dictionary)jsSerializer.DeserializeObject(responseBody); } + /// + /// Get response status code + /// + /// public int GetStatusCode() { return _statusCode; } + /// + /// Get response body data + /// + /// public Dictionary GetResponse() { return _responseData; } + /// + /// Get raw response body + /// + /// public string GetRawResponse() { return _rawResponse; } + /// + /// Check response is successfull + /// + /// public bool IsSuccessfull() { return _statusCode < 400; diff --git a/Retailcrm/Retailcrm.csproj b/Retailcrm/Retailcrm.csproj index a8abe9b..9322c2c 100644 --- a/Retailcrm/Retailcrm.csproj +++ b/Retailcrm/Retailcrm.csproj @@ -31,6 +31,9 @@ bin\Release\Retailcrm.xml + + ..\..\Marwin\packages\JetBrains.Annotations.11.0.0\lib\net20\JetBrains.Annotations.dll + @@ -78,6 +81,7 @@ + diff --git a/Retailcrm/Versions/V3/Client.cs b/Retailcrm/Versions/V3/Client.cs index 0108130..f5eb81f 100644 --- a/Retailcrm/Versions/V3/Client.cs +++ b/Retailcrm/Versions/V3/Client.cs @@ -4,11 +4,26 @@ using System.Collections.Generic; using System.Linq; + /// + /// V3 Client + /// public partial class Client { + /// + /// Request + /// protected Request Request; + /// + /// Site code + /// protected string SiteCode; + /// + /// V3 Client Constructor + /// + /// + /// + /// public Client(string url, string key, string site = "") { if ("/" != url.Substring(url.Length - 1, 1)) diff --git a/Retailcrm/Versions/V3/Customers.cs b/Retailcrm/Versions/V3/Customers.cs index a44cf7a..7c8a906 100644 --- a/Retailcrm/Versions/V3/Customers.cs +++ b/Retailcrm/Versions/V3/Customers.cs @@ -6,6 +6,13 @@ public partial class Client { + /// + /// Create customer + /// + /// + /// + /// + /// public Response CustomersCreate(Dictionary customer, string site = "") { if (customer.Count < 1) @@ -26,6 +33,14 @@ ); } + /// + /// Update customer + /// + /// + /// + /// + /// + /// public Response CustomersUpdate(Dictionary customer, string by = "externalId", string site = "") { if (customer.Count < 1) @@ -56,6 +71,13 @@ ); } + /// + /// Get customer + /// + /// + /// + /// + /// public Response CustomersGet(string id, string by = "externalId", string site = "") { CheckIdParameter(by); @@ -72,6 +94,13 @@ ); } + /// + /// Get customers list + /// + /// + /// + /// + /// public Response CustomersList(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -94,6 +123,11 @@ return Request.MakeRequest("/customers", Request.MethodGet, parameters); } + /// + /// Fix external id + /// + /// + /// public Response CustomersFixExternalIds(Dictionary[] ids) { return Request.MakeRequest( @@ -106,6 +140,13 @@ ); } + /// + /// Upload customers + /// + /// + /// + /// + /// public Response CustomersUpload(List customers, string site = "") { if (customers.Count < 1) diff --git a/Retailcrm/Versions/V3/Orders.cs b/Retailcrm/Versions/V3/Orders.cs index 6fe9372..f62b244 100644 --- a/Retailcrm/Versions/V3/Orders.cs +++ b/Retailcrm/Versions/V3/Orders.cs @@ -6,6 +6,12 @@ public partial class Client { + /// + /// Create order + /// + /// + /// + /// public Response OrdersCreate(Dictionary order, string site = "") { if (order.Count < 1) @@ -26,6 +32,13 @@ ); } + /// + /// Update order + /// + /// + /// + /// + /// public Response OrdersUpdate(Dictionary order, string by = "externalId", string site = "") { if (order.Count < 1) @@ -56,6 +69,13 @@ ); } + /// + /// Get order + /// + /// + /// + /// + /// public Response OrdersGet(string id, string by = "externalId", string site = "") { CheckIdParameter(by); @@ -72,7 +92,14 @@ ); } - public Response OrdersList(Dictionary filter = null, int page = 0, int limit = 0) + /// + /// + /// + /// + /// + /// + /// + public Response OrdersList(Dictionary filter = null, int page = 1, int limit = 20) { Dictionary parameters = new Dictionary(); @@ -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); } + /// + /// Fix external ids + /// + /// + /// public Response OrdersFixExternalIds(Dictionary[] ids) { return Request.MakeRequest( @@ -106,6 +138,15 @@ ); } + /// + /// Get orders history + /// + /// + /// + /// + /// + /// + /// public Response OrdersHistory(DateTime? startDate = null, DateTime? endDate = null, int limit = 200, int offset = 0, bool skipMyChanges = true) { Dictionary parameters = new Dictionary(); @@ -139,6 +180,12 @@ ); } + /// + /// Get orders statuses + /// + /// + /// + /// public Response OrdersStatuses(List ids, List externalIds = null) { Dictionary parameters = new Dictionary(); @@ -174,6 +221,12 @@ ); } + /// + /// Orders upload + /// + /// + /// + /// public Response OrdersUpload(List orders, string site = "") { if (orders.Count < 1) diff --git a/Retailcrm/Versions/V3/Packs.cs b/Retailcrm/Versions/V3/Packs.cs index 3a81f8b..4dd6d69 100644 --- a/Retailcrm/Versions/V3/Packs.cs +++ b/Retailcrm/Versions/V3/Packs.cs @@ -6,6 +6,13 @@ public partial class Client { + /// + /// Get packs list + /// + /// + /// + /// + /// public Response PacksList(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -28,6 +35,11 @@ return Request.MakeRequest("/orders/packs", Request.MethodGet, parameters); } + /// + /// Create pack + /// + /// + /// public Response PacksCreate(Dictionary pack) { if (pack.Count < 1) @@ -45,6 +57,11 @@ ); } + /// + /// Update pack data + /// + /// + /// public Response PacksUpdate(Dictionary pack) { if (pack.Count < 1) @@ -67,6 +84,11 @@ ); } + /// + /// Delete pack + /// + /// + /// public Response PacksDelete(string id) { return Request.MakeRequest( @@ -75,6 +97,11 @@ ); } + /// + /// Get pack by id + /// + /// + /// public Response PacksGet(string id) { return Request.MakeRequest( @@ -83,6 +110,13 @@ ); } + /// + /// Get packs history + /// + /// + /// + /// + /// public Response PacksHistory(Dictionary filter = null, int page = 1, int limit = 20) { Dictionary parameters = new Dictionary(); diff --git a/Retailcrm/Versions/V3/References.cs b/Retailcrm/Versions/V3/References.cs index f9fed36..1e8a450 100644 --- a/Retailcrm/Versions/V3/References.cs +++ b/Retailcrm/Versions/V3/References.cs @@ -6,6 +6,10 @@ public partial class Client { + /// + /// Countries + /// + /// public Response Countries() { return Request.MakeRequest( @@ -14,6 +18,10 @@ ); } + /// + /// Delivery services + /// + /// public Response DeliveryServices() { return Request.MakeRequest( @@ -22,6 +30,10 @@ ); } + /// + /// Delivery types + /// + /// public Response DeliveryTypes() { return Request.MakeRequest( @@ -30,6 +42,10 @@ ); } + /// + /// Order methods + /// + /// public Response OrderMethods() { return Request.MakeRequest( @@ -38,6 +54,10 @@ ); } + /// + /// Order types + /// + /// public Response OrderTypes() { return Request.MakeRequest( @@ -46,6 +66,10 @@ ); } + /// + /// Payment statuses + /// + /// public Response PaymentStatuses() { return Request.MakeRequest( @@ -54,6 +78,10 @@ ); } + /// + /// Payment types + /// + /// public Response PaymentTypes() { return Request.MakeRequest( @@ -62,6 +90,10 @@ ); } + /// + /// Product statuses + /// + /// public Response ProductStatuses() { return Request.MakeRequest( @@ -70,6 +102,10 @@ ); } + /// + /// Sites + /// + /// public Response Sites() { return Request.MakeRequest( @@ -78,6 +114,10 @@ ); } + /// + /// Statuses groups + /// + /// public Response StatusGroups() { return Request.MakeRequest( @@ -86,6 +126,10 @@ ); } + /// + /// Statuses + /// + /// public Response Statuses() { return Request.MakeRequest( @@ -94,6 +138,10 @@ ); } + /// + /// Stores + /// + /// public Response Stores() { return Request.MakeRequest( @@ -102,6 +150,11 @@ ); } + /// + /// Delivery services edit + /// + /// + /// public Response DeliveryServicesEdit(Dictionary service) { if (!service.ContainsKey("code")) @@ -124,6 +177,11 @@ ); } + /// + /// Delivery types edit + /// + /// + /// public Response DeliveryTypesEdit(Dictionary type) { if (!type.ContainsKey("code")) @@ -156,6 +214,11 @@ ); } + /// + /// Orders methods edit + /// + /// + /// public Response OrderMethodsEdit(Dictionary method) { if (!method.ContainsKey("code")) @@ -178,6 +241,11 @@ ); } + /// + /// Order types edit + /// + /// + /// public Response OrderTypesEdit(Dictionary type) { if (!type.ContainsKey("code")) @@ -200,6 +268,11 @@ ); } + /// + /// Payment statuses edit + /// + /// + /// public Response PaymentStatusesEdit(Dictionary status) { if (!status.ContainsKey("code")) @@ -222,6 +295,11 @@ ); } + /// + /// Payment types edit + /// + /// + /// public Response PaymentTypesEdit(Dictionary type) { if (!type.ContainsKey("code")) @@ -244,6 +322,11 @@ ); } + /// + /// Product statuses edit + /// + /// + /// public Response ProductStatusesEdit(Dictionary status) { if (!status.ContainsKey("code")) @@ -266,6 +349,11 @@ ); } + /// + /// Sites edit + /// + /// + /// public Response SitesEdit(Dictionary site) { if (!site.ContainsKey("code")) @@ -293,6 +381,11 @@ ); } + /// + /// Statuses edit + /// + /// + /// public Response StatusesEdit(Dictionary status) { if (!status.ContainsKey("code")) @@ -325,6 +418,11 @@ ); } + /// + /// Stores edit + /// + /// + /// public Response StoresEdit(Dictionary store) { if (!store.ContainsKey("code")) diff --git a/Retailcrm/Versions/V3/Statistic.cs b/Retailcrm/Versions/V3/Statistic.cs index acf97fa..fbb93f2 100644 --- a/Retailcrm/Versions/V3/Statistic.cs +++ b/Retailcrm/Versions/V3/Statistic.cs @@ -2,6 +2,10 @@ { public partial class Client { + /// + /// Update statistic + /// + /// public Response StatisticUpdate() { return Request.MakeRequest( diff --git a/Retailcrm/Versions/V3/Stores.cs b/Retailcrm/Versions/V3/Stores.cs index c95f7cb..829c48f 100644 --- a/Retailcrm/Versions/V3/Stores.cs +++ b/Retailcrm/Versions/V3/Stores.cs @@ -6,6 +6,13 @@ public partial class Client { + /// + /// Get inventories + /// + /// + /// + /// + /// public Response StoreInventoriesGet(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -28,6 +35,12 @@ return Request.MakeRequest("/store/inventories", Request.MethodGet, parameters); } + /// + /// Upload inventories + /// + /// + /// + /// public Response StoreInventoriesUpload(List offers, string site = "") { if (offers.Count< 1) diff --git a/Retailcrm/Versions/V4/Client.cs b/Retailcrm/Versions/V4/Client.cs index c6b44a4..30584f2 100644 --- a/Retailcrm/Versions/V4/Client.cs +++ b/Retailcrm/Versions/V4/Client.cs @@ -3,8 +3,17 @@ using System.Collections.Generic; using ParentClass = V3.Client; + /// + /// V4 Client + /// public partial class Client : ParentClass { + /// + /// V4 Client Constructor + /// + /// + /// + /// public Client(string url, string key, string site = "") : base(url, key, site) { if ("/" != url.Substring(url.Length - 1, 1)) diff --git a/Retailcrm/Versions/V4/Customers.cs b/Retailcrm/Versions/V4/Customers.cs index 90d5c7b..d3a3452 100644 --- a/Retailcrm/Versions/V4/Customers.cs +++ b/Retailcrm/Versions/V4/Customers.cs @@ -4,6 +4,13 @@ public partial class Client { + /// + /// Customers history + /// + /// + /// + /// + /// public Response CustomersHistory(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); diff --git a/Retailcrm/Versions/V4/Delivery.cs b/Retailcrm/Versions/V4/Delivery.cs index 31e3b15..a530a80 100644 --- a/Retailcrm/Versions/V4/Delivery.cs +++ b/Retailcrm/Versions/V4/Delivery.cs @@ -6,6 +6,11 @@ public partial class Client { + /// + /// Get delivery settings + /// + /// + /// public Response DeliverySettingGet(string code) { if (string.IsNullOrEmpty(code)) @@ -19,6 +24,11 @@ ); } + /// + /// Edit delivery settings + /// + /// + /// public Response DeliverySettingsEdit(Dictionary configuration) { if (configuration.Count < 1) @@ -56,6 +66,12 @@ ); } + /// + /// Update delivery tracking + /// + /// + /// + /// public Response DeliveryTracking(string code, List statusUpdate) { if (string.IsNullOrEmpty(code)) diff --git a/Retailcrm/Versions/V4/Marketplace.cs b/Retailcrm/Versions/V4/Marketplace.cs index 46930c4..7e7f465 100644 --- a/Retailcrm/Versions/V4/Marketplace.cs +++ b/Retailcrm/Versions/V4/Marketplace.cs @@ -6,6 +6,11 @@ public partial class Client { + /// + /// Edit marketplace module settings + /// + /// + /// public Response MarketplaceSettingsEdit(Dictionary configuration) { if (configuration.Count < 1) diff --git a/Retailcrm/Versions/V4/Orders.cs b/Retailcrm/Versions/V4/Orders.cs index d5a2083..ec747a2 100644 --- a/Retailcrm/Versions/V4/Orders.cs +++ b/Retailcrm/Versions/V4/Orders.cs @@ -4,6 +4,13 @@ public partial class Client { + /// + /// Get orders history + /// + /// + /// + /// + /// public Response OrdersHistory(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); diff --git a/Retailcrm/Versions/V4/References.cs b/Retailcrm/Versions/V4/References.cs index 05bbd2e..5abd0c5 100644 --- a/Retailcrm/Versions/V4/References.cs +++ b/Retailcrm/Versions/V4/References.cs @@ -6,6 +6,10 @@ public partial class Client { + /// + /// Price types + /// + /// public Response PriceTypes() { return Request.MakeRequest( @@ -14,6 +18,11 @@ ); } + /// + /// Price type edit + /// + /// + /// public Response PriceTypesEdit(Dictionary type) { if (!type.ContainsKey("code")) diff --git a/Retailcrm/Versions/V4/Stores.cs b/Retailcrm/Versions/V4/Stores.cs index 558edfa..606967f 100644 --- a/Retailcrm/Versions/V4/Stores.cs +++ b/Retailcrm/Versions/V4/Stores.cs @@ -6,6 +6,13 @@ public partial class Client { + /// + /// Get products + /// + /// + /// + /// + /// public Response StoreProducts(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -28,6 +35,11 @@ return Request.MakeRequest("/store/products", Request.MethodGet, parameters); } + /// + /// Upload prices + /// + /// + /// public Response StorePricesUpload(List prices) { if (prices.Count< 1) @@ -50,6 +62,11 @@ ); } + /// + /// Get store settings + /// + /// + /// public Response StoreSettingGet(string code) { if (string.IsNullOrEmpty(code)) @@ -63,6 +80,11 @@ ); } + /// + /// Edit store settings + /// + /// + /// public Response StoreSettingsEdit(Dictionary configuration) { if (configuration.Count < 1) diff --git a/Retailcrm/Versions/V4/Users.cs b/Retailcrm/Versions/V4/Users.cs index a15cd3d..9d6ed77 100644 --- a/Retailcrm/Versions/V4/Users.cs +++ b/Retailcrm/Versions/V4/Users.cs @@ -4,6 +4,13 @@ public partial class Client { + /// + /// Get users + /// + /// + /// + /// + /// public Response Users(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -26,6 +33,12 @@ return Request.MakeRequest("/users", Request.MethodGet, parameters); } + /// + /// Get users groups + /// + /// + /// + /// public Response UsersGroups(int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -43,6 +56,11 @@ return Request.MakeRequest("/user-groups", Request.MethodGet, parameters); } + /// + /// Get user + /// + /// + /// public Response User(int id) { return Request.MakeRequest($"/users/{id}", Request.MethodGet); diff --git a/Retailcrm/Versions/V5/Client.cs b/Retailcrm/Versions/V5/Client.cs index 9cac00e..a2464fd 100644 --- a/Retailcrm/Versions/V5/Client.cs +++ b/Retailcrm/Versions/V5/Client.cs @@ -3,8 +3,17 @@ using System.Collections.Generic; using ParentClass = V4.Client; + /// + /// V5 Client + /// public partial class Client : ParentClass { + /// + /// V5 Client Constructor + /// + /// + /// + /// public Client(string url, string key, string site = "") : base(url, key, site) { if ("/" != url.Substring(url.Length - 1, 1)) diff --git a/Retailcrm/Versions/V5/Costs.cs b/Retailcrm/Versions/V5/Costs.cs index 2d67312..6537c5e 100644 --- a/Retailcrm/Versions/V5/Costs.cs +++ b/Retailcrm/Versions/V5/Costs.cs @@ -6,6 +6,13 @@ public partial class Client { + /// + /// Get costs + /// + /// + /// + /// + /// public Response CostsList(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -28,6 +35,12 @@ return Request.MakeRequest("/costs", Request.MethodGet, parameters); } + /// + /// Create cost + /// + /// + /// + /// public Response CostsCreate(Dictionary cost, string site = "") { if (cost.Count < 1) @@ -48,6 +61,11 @@ ); } + /// + /// Delete cost + /// + /// + /// public Response CostsDelete(List ids) { if (ids.Count < 1) @@ -65,6 +83,11 @@ ); } + /// + /// Upload costs + /// + /// + /// public Response CostsUpload(List costs) { if (costs.Count < 1) @@ -82,11 +105,21 @@ ); } + /// + /// Get cost + /// + /// + /// public Response CostsGet(int id) { return Request.MakeRequest($"/costs/{id}", Request.MethodGet); } + /// + /// Batch delete + /// + /// + /// public Response CostsDelete(string id) { return Request.MakeRequest( @@ -95,6 +128,12 @@ ); } + /// + /// Update cost + /// + /// + /// + /// public Response CostsUpdate(Dictionary cost, string site = "") { if (cost.Count < 1) diff --git a/Retailcrm/Versions/V5/CustomFields.cs b/Retailcrm/Versions/V5/CustomFields.cs index 5fff152..249fdc9 100644 --- a/Retailcrm/Versions/V5/CustomFields.cs +++ b/Retailcrm/Versions/V5/CustomFields.cs @@ -6,6 +6,13 @@ public partial class Client { + /// + /// Get custom fields + /// + /// + /// + /// + /// public Response CustomFieldsList(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -28,6 +35,12 @@ return Request.MakeRequest("/custom-fields", Request.MethodGet, parameters); } + /// + /// Create custom field + /// + /// + /// + /// public Response CustomFieldsCreate(Dictionary customField, string entity = "") { List types = new List @@ -72,6 +85,12 @@ ); } + /// + /// Get custom field + /// + /// + /// + /// public Response CustomFieldsGet(string code, string entity) { return Request.MakeRequest( @@ -80,6 +99,12 @@ ); } + /// + /// Update custom field + /// + /// + /// + /// public Response CustomFieldsUpdate(Dictionary customField, string entity = "") { if (customField.Count < 1) @@ -107,6 +132,13 @@ ); } + /// + /// Get custom dictionaries + /// + /// + /// + /// + /// public Response CustomDictionaryList(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -129,6 +161,11 @@ return Request.MakeRequest("/custom-fields/dictionaries", Request.MethodGet, parameters); } + /// + /// Create custom dictionary + /// + /// + /// public Response CustomDictionaryCreate(Dictionary customDictionary) { if (customDictionary.Count < 1) @@ -156,6 +193,11 @@ ); } + /// + /// Get custom dictionary + /// + /// + /// public Response CustomDictionaryGet(string code) { return Request.MakeRequest( @@ -164,6 +206,11 @@ ); } + /// + /// Update custom dictionary + /// + /// + /// public Response CustomDictionaryUpdate(Dictionary customDictionary) { if (customDictionary.Count < 1) diff --git a/Retailcrm/Versions/V5/Delivery.cs b/Retailcrm/Versions/V5/Delivery.cs index d77f6bc..11cf5b0 100644 --- a/Retailcrm/Versions/V5/Delivery.cs +++ b/Retailcrm/Versions/V5/Delivery.cs @@ -5,11 +5,21 @@ public partial class Client { + /// + /// Get delivery settings + /// + /// + /// public new Response DeliverySettingGet(string code) { throw new ArgumentException("This method is unavailable in API V5", code); } + /// + /// Update delivery settings + /// + /// + /// public new Response DeliverySettingsEdit(Dictionary configuration) { throw new ArgumentException("This method is unavailable in API V5"); diff --git a/Retailcrm/Versions/V5/Integrations.cs b/Retailcrm/Versions/V5/Integrations.cs index 1c2c1e9..fc42ddd 100644 --- a/Retailcrm/Versions/V5/Integrations.cs +++ b/Retailcrm/Versions/V5/Integrations.cs @@ -6,6 +6,11 @@ public partial class Client { + /// + /// Get integration settings + /// + /// + /// public Response IntegrationsSettingGet(string code) { if (string.IsNullOrEmpty(code)) @@ -19,6 +24,11 @@ ); } + /// + /// Create/Update integration settings + /// + /// + /// public Response IntegrationsSettingsEdit(Dictionary integrationModule) { if (integrationModule.Count < 1) diff --git a/Retailcrm/Versions/V5/Notes.cs b/Retailcrm/Versions/V5/Notes.cs index c3d81e5..d0bbfad 100644 --- a/Retailcrm/Versions/V5/Notes.cs +++ b/Retailcrm/Versions/V5/Notes.cs @@ -6,6 +6,12 @@ public partial class Client { + /// + /// Create note + /// + /// + /// + /// public Response NotesCreate(Dictionary note, string site = "") { if (note.Count < 1) @@ -26,6 +32,11 @@ ); } + /// + /// Delete note + /// + /// + /// public Response NotesDelete(string id) { return Request.MakeRequest( @@ -34,6 +45,13 @@ ); } + /// + /// Get notes list + /// + /// + /// + /// + /// public Response NotesList(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); diff --git a/Retailcrm/Versions/V5/Orders.cs b/Retailcrm/Versions/V5/Orders.cs index d99f055..be4b9ac 100644 --- a/Retailcrm/Versions/V5/Orders.cs +++ b/Retailcrm/Versions/V5/Orders.cs @@ -6,6 +6,13 @@ public partial class Client { + /// + /// Combine orders + /// + /// + /// + /// + /// public Response OrdersCombine(Dictionary order, Dictionary resultOrder, string technique = "ours") { if (order.Count <= 0) diff --git a/Retailcrm/Versions/V5/Payments.cs b/Retailcrm/Versions/V5/Payments.cs index 21aae8e..ce15990 100644 --- a/Retailcrm/Versions/V5/Payments.cs +++ b/Retailcrm/Versions/V5/Payments.cs @@ -6,6 +6,12 @@ public partial class Client { + /// + /// Create payment + /// + /// + /// + /// public Response PaymentsCreate(Dictionary payment, string site = "") { if (payment.Count < 1) @@ -26,6 +32,13 @@ ); } + /// + /// Update payment + /// + /// + /// + /// + /// public Response PaymentsUpdate(Dictionary payment, string by = "id", string site = "") { if (payment.Count < 1) @@ -56,6 +69,11 @@ ); } + /// + /// Delete payment + /// + /// + /// public Response PaymentsDelete(string id) { return Request.MakeRequest( diff --git a/Retailcrm/Versions/V5/References.cs b/Retailcrm/Versions/V5/References.cs index d271c16..ca999c6 100644 --- a/Retailcrm/Versions/V5/References.cs +++ b/Retailcrm/Versions/V5/References.cs @@ -6,6 +6,10 @@ public partial class Client { + /// + /// Costs groups + /// + /// public Response CostGroups() { return Request.MakeRequest( @@ -14,6 +18,10 @@ ); } + /// + /// Costs + /// + /// public Response CostItems() { return Request.MakeRequest( @@ -22,6 +30,10 @@ ); } + /// + /// Legal entities + /// + /// public Response LegalEntities() { return Request.MakeRequest( @@ -30,6 +42,11 @@ ); } + /// + /// Cost group edit + /// + /// + /// public Response CostGroupsEdit(Dictionary group) { if (!group.ContainsKey("code")) @@ -57,6 +74,11 @@ ); } + /// + /// Cost items edit + /// + /// + /// public Response CostItemsEdit(Dictionary item) { if (!item.ContainsKey("code")) @@ -90,6 +112,11 @@ ); } + /// + /// Legal entities edit + /// + /// + /// public Response LegalEntitiesEdit(Dictionary entity) { if (!entity.ContainsKey("code")) diff --git a/Retailcrm/Versions/V5/Segments.cs b/Retailcrm/Versions/V5/Segments.cs index 6e8eea8..015e4f2 100644 --- a/Retailcrm/Versions/V5/Segments.cs +++ b/Retailcrm/Versions/V5/Segments.cs @@ -1,10 +1,16 @@ namespace Retailcrm.Versions.V5 { - using System; using System.Collections.Generic; public partial class Client { + /// + /// Get segments + /// + /// + /// + /// + /// public Response Segments(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); diff --git a/Retailcrm/Versions/V5/Stores.cs b/Retailcrm/Versions/V5/Stores.cs index e5499c4..663c9a6 100644 --- a/Retailcrm/Versions/V5/Stores.cs +++ b/Retailcrm/Versions/V5/Stores.cs @@ -5,16 +5,33 @@ public partial class Client { + /// + /// Get external store settings + /// + /// + /// public new Response StoreSettingGet(string code) { throw new ArgumentException("This method is unavailable in API V5", code); } + /// + /// Edit external store settings + /// + /// + /// public new Response StoreSettingsEdit(Dictionary configuration) { throw new ArgumentException("This method is unavailable in API V5"); } + /// + /// Get products groups + /// + /// + /// + /// + /// public Response StoreProductsGroups(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); @@ -37,6 +54,13 @@ return Request.MakeRequest("/store/products-groups", Request.MethodGet, parameters); } + /// + /// Get products properties + /// + /// + /// + /// + /// public Response StoreProductsProperties(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); diff --git a/Retailcrm/Versions/V5/Tasks.cs b/Retailcrm/Versions/V5/Tasks.cs index a0c1a3d..0d2809f 100644 --- a/Retailcrm/Versions/V5/Tasks.cs +++ b/Retailcrm/Versions/V5/Tasks.cs @@ -6,6 +6,12 @@ public partial class Client { + /// + /// Create a task + /// + /// + /// + /// public Response TasksCreate(Dictionary task, string site = "") { if (task.Count < 1) @@ -26,6 +32,12 @@ ); } + /// + /// Update a task + /// + /// + /// + /// public Response TasksUpdate(Dictionary task, string site = "") { if (task.Count < 1) @@ -51,6 +63,11 @@ ); } + /// + /// Get task + /// + /// + /// public Response TasksGet(string id) { return Request.MakeRequest( @@ -59,6 +76,13 @@ ); } + /// + /// Get tasks list + /// + /// + /// + /// + /// public Response TasksList(Dictionary filter = null, int page = 0, int limit = 0) { Dictionary parameters = new Dictionary(); diff --git a/Retailcrm/Versions/V5/Users.cs b/Retailcrm/Versions/V5/Users.cs index 831bf12..a14c04c 100644 --- a/Retailcrm/Versions/V5/Users.cs +++ b/Retailcrm/Versions/V5/Users.cs @@ -5,6 +5,12 @@ public partial class Client { + /// + /// Update user status + /// + /// + /// + /// public Response UsersStatus(int id, string status) { List statuses = new List { "free", "busy", "dinner", "break"}; diff --git a/Retailcrm/packages.config b/Retailcrm/packages.config new file mode 100644 index 0000000..4672169 --- /dev/null +++ b/Retailcrm/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file