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: 0x02000012 RID: 18
	public class Lawsuit
	{
		// Token: 0x06000063 RID: 99 RVA: 0x00004C48 File Offset: 0x00002E48
		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: 0x06000064 RID: 100 RVA: 0x00004C88 File Offset: 0x00002E88
		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: 0x06000065 RID: 101 RVA: 0x00004CCC File Offset: 0x00002ECC
		internal string UpdateSync(Lawsuit lawsuit, int status)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateLawsuitSync, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				Entity_id = lawsuit.Entity_id,
				Client_id = lawsuit.Client_id,
				Field_of_law_id = lawsuit.Field_of_law_id,
				Id = lawsuit.Id,
				Sync_id = lawsuit.Sync_id,
				SyncStatus = status
			}), null);
		}
	}
}
