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: 0x0200001D RID: 29
	public class Activity
	{
		// Token: 0x060000A0 RID: 160 RVA: 0x00005D64 File Offset: 0x00003F64
		internal string ActivityCreate(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.ActivityCreate, WSProperties.Token, null, new JavaScriptSerializer().Serialize(activity), null);
		}

		// Token: 0x060000A1 RID: 161 RVA: 0x00005DA4 File Offset: 0x00003FA4
		internal string UpdateActivityUrl(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivityUrl, WSProperties.Token, null, new JavaScriptSerializer().Serialize(activity), null);
		}

		// Token: 0x060000A2 RID: 162 RVA: 0x00005DE4 File Offset: 0x00003FE4
		internal string UpdateActivityCaseUrl(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivityCaseUrl, WSProperties.Token, null, new JavaScriptSerializer().Serialize(activity), null);
		}

		// Token: 0x060000A3 RID: 163 RVA: 0x00005E24 File Offset: 0x00004024
		internal string UpdateActivityFieldValue(Activity activity, string name, string value)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivityFieldValue, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				EntityId = activity.EntityId,
				ActivityId = activity.Id,
				ElementName = name,
				Value = value
			}), null);
		}

		// Token: 0x060000A4 RID: 164 RVA: 0x00005E74 File Offset: 0x00004074
		internal string UpdateActivitySync(Activity activity, int syncStatus)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivitySync, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				EntityId = activity.EntityId,
				ActivityId = activity.Id,
				SyncId = activity.SyncId,
				SyncStatus = syncStatus
			}), null);
		}

		// Token: 0x060000A5 RID: 165 RVA: 0x00005EC8 File Offset: 0x000040C8
		internal string UpdateAttachmentLink(Attachment attachemnt)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateAttachmentLink, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				EntityId = attachemnt.EntityId,
				ActivityId = attachemnt.ActivityId,
				Link = attachemnt.Link.AbsoluteUri
			}), null);
		}

		// Token: 0x060000A6 RID: 166 RVA: 0x00005F20 File Offset: 0x00004120
		internal List<Activity> ActivityToSync()
		{
			string result = new Client(WSProperties.UrlApi)._request("GET", "exporter/3/test", WSProperties.Token, null, string.Empty, null);
			return JsonConvert.DeserializeObject<List<Activity>>(result);
		}

		// Token: 0x060000A7 RID: 167 RVA: 0x00005F60 File Offset: 0x00004160
		internal List<Activity> ActivitiesToCreateDataJuri()
		{
			string result = new Client(WSProperties.UrlApi)._request("GET", WSProperties.ActivitiesToCreateDataJuri, WSProperties.Token, null, string.Empty, null);
			JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer();
			return jsonSerialiser.Deserialize<List<Activity>>(result);
		}

		// Token: 0x060000A8 RID: 168 RVA: 0x00005FA8 File Offset: 0x000041A8
		internal List<Activity> ActivityToCanceling()
		{
			string result = new Client(WSProperties.UrlApi)._request("GET", WSProperties.ActivitiesToCanceling, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				name = "Wu shang hao"
			}), null);
			JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer();
			return jsonSerialiser.Deserialize<List<Activity>>(result);
		}

		// Token: 0x060000A9 RID: 169 RVA: 0x00006000 File Offset: 0x00004200
		internal List<Activity> ActivityCanceled(Activity activity)
		{
			string result = new Client(WSProperties.UrlApi)._request("PUT", WSProperties.ActivityCanceled, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				entity_id = activity.EntityId,
				id = activity.Id,
				activity_type_id = activity.TypeId
			}), null);
			JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer();
			return jsonSerialiser.Deserialize<List<Activity>>(result);
		}

		// Token: 0x060000AA RID: 170 RVA: 0x00006064 File Offset: 0x00004264
		internal string ActivityDone(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.ActivityDone, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				entity_id = activity.EntityId,
				id = activity.Id,
				activity_type_id = activity.TypeId
			}), null);
		}
	}
}
