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: 0x02000019 RID: 25
	public class LawsuitPhase
	{
		// Token: 0x06000091 RID: 145 RVA: 0x00005750 File Offset: 0x00003950
		internal List<LawsuitPhase> LawsuitPhasesToSync()
		{
			string result = new Client(WSProperties.UrlApi)._request("GET", WSProperties.LawsuitPhasesToSync, WSProperties.Token, null, string.Empty, null);
			return JsonConvert.DeserializeObject<List<LawsuitPhase>>(result);
		}

		// Token: 0x06000092 RID: 146 RVA: 0x00005790 File Offset: 0x00003990
		internal string UpdateUrl(LawsuitPhase lawsuitPhase)
		{
			string a = new JavaScriptSerializer().Serialize(new
			{
				lawsuitPhase
			});
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateLawsuitPhaseLink, WSProperties.Token, null, a, null);
		}

		// Token: 0x06000093 RID: 147 RVA: 0x000057D4 File Offset: 0x000039D4
		internal string UpdateSync(LawsuitPhase lawsuitPhase, int status)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateLawsuitPhaseSync, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				EntityId = lawsuitPhase.EntityId,
				ClientId = lawsuitPhase.ClientId,
				FieldOfLawId = lawsuitPhase.FieldOfLawId,
				LawsuitId = lawsuitPhase.LawsuitId,
				Id = lawsuitPhase.Id,
				SyncId = lawsuitPhase.SyncId,
				SyncStatus = status
			}), null);
		}
	}
}
