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

34 lines
945 B
C#

using System;
using System.Collections.Generic;
namespace Retailcrm.Versions.V5
{
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"};
if (!statuses.Contains(status))
{
throw new ArgumentException("Parameter `status` must be equal one of these values: `free|busy|dinner|break`");
}
return Request.MakeRequest(
$"/users/{id}/status",
Request.MethodPost,
new Dictionary<string, object>
{
{ "status", status }
}
);
}
}
}