using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
using Newtonsoft.Json;
using ZionRobot.Models.ZFlow;
using ZionRobot.Persistence;
using ZionVault.WebService;

namespace ZionRobot.WebService
{
	// Token: 0x0200001B RID: 27
	public class Lawsuit
	{
		// Token: 0x0600009A RID: 154 RVA: 0x00005C10 File Offset: 0x00003E10
		internal List<Lawsuit> LawsuitsToSync()
		{
			string result = new Client(WSProperties.UrlApi)._request("GET", WSProperties.LawsuitsToSync, WSProperties.Token, null, string.Empty, null);
			return JsonConvert.DeserializeObject<List<Lawsuit>>(result);
		}

		// Token: 0x0600009B RID: 155 RVA: 0x00005C50 File Offset: 0x00003E50
		internal string UpdateUrl(Lawsuit lawsuit)
		{
			string a = new JavaScriptSerializer().Serialize(new
			{
				lawsuit
			});
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateLawsuitLink, WSProperties.Token, null, a, null);
		}

		// Token: 0x0600009C RID: 156 RVA: 0x00005C94 File Offset: 0x00003E94
		internal string UpdateSync(Lawsuit lawsuit, int status)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateLawsuitSync, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				EntityId = lawsuit.EntityId,
				ClientId = lawsuit.ClientId,
				FieldOfLawId = lawsuit.FieldOfLawId,
				Id = lawsuit.Id,
				SyncId = lawsuit.SyncId,
				SyncStatus = status
			}), null);
		}
	}
}
