api-client-dotnet/Retailcrm/Versions/V5/Segments.cs
Alex Lushpai 72cac6d6f0
Multiversion client (#6)
* Multiversion sdk
* Remove redundant code
* More test coverage;
2017-10-30 13:51:45 +03:00

37 lines
975 B
C#

using System.Collections.Generic;
namespace Retailcrm.Versions.V5
{
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 = 1, int limit = 20)
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
if (filter != null && filter.Count > 0)
{
parameters.Add("filter", filter);
}
if (page > 0)
{
parameters.Add("page", page);
}
if (limit > 0)
{
parameters.Add("limit", limit);
}
return Request.MakeRequest("/segments", Request.MethodGet, parameters);
}
}
}