mirror of
https://github.com/retailcrm/api-client-dotnet.git
synced 2024-11-25 06:16:02 +03:00
72cac6d6f0
* Multiversion sdk * Remove redundant code * More test coverage;
42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web.Script.Serialization;
|
|
|
|
namespace Retailcrm.Versions.V4
|
|
{
|
|
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)
|
|
{
|
|
throw new ArgumentException("Parameter `configuration` must contain data");
|
|
}
|
|
|
|
if (!configuration.ContainsKey("code"))
|
|
{
|
|
throw new ArgumentException("Parameter `configuration` should contain `code`");
|
|
}
|
|
|
|
if (!configuration.ContainsKey("name"))
|
|
{
|
|
throw new ArgumentException("Parameter `configuration` should contain `name`");
|
|
}
|
|
|
|
return Request.MakeRequest(
|
|
$"/marketplace/external/setting/{configuration["code"].ToString()}/edit",
|
|
Request.MethodPost,
|
|
new Dictionary<string, object>
|
|
{
|
|
{ "configuration", new JavaScriptSerializer().Serialize(configuration) }
|
|
}
|
|
);
|
|
}
|
|
}
|
|
}
|