mirror of
https://github.com/retailcrm/api-client-dotnet.git
synced 2024-11-22 21:06:02 +03:00
72cac6d6f0
* Multiversion sdk * Remove redundant code * More test coverage;
34 lines
945 B
C#
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 }
|
|
}
|
|
);
|
|
}
|
|
}
|
|
}
|