public LRSResponse DeleteAgentProfile(AgentProfileDocument profile) { var queryParams = new Dictionary<String, String>(); queryParams.Add("profileId", profile.id); queryParams.Add("agent", profile.agent.ToJSON(version)); // TODO: need to pass Etag? return DeleteDocument("agents/profile", queryParams); }
public LRSResponse SaveAgentProfile(AgentProfileDocument profile) { var queryParams = new Dictionary<String, String>(); queryParams.Add("profileId", profile.id); queryParams.Add("agent", profile.agent.ToJSON(version)); return SaveDocument("agents/profile", queryParams, profile); }
public void TestDeleteAgentProfile() { var doc = new AgentProfileDocument(); doc.agent = agent; doc.id = "test"; LRSResponse lrsRes = lrs.DeleteAgentProfile(doc); Assert.IsTrue(lrsRes.success); }
public AgentProfileLRSResponse RetrieveAgentProfile(String id, Agent agent) { var r = new AgentProfileLRSResponse(); var queryParams = new Dictionary<String, String>(); queryParams.Add("profileId", id); queryParams.Add("agent", agent.ToJSON(version)); var profile = new AgentProfileDocument(); profile.id = id; profile.agent = agent; var resp = GetDocument("agents/profile", queryParams, profile); if (resp.status != HttpStatusCode.OK && resp.status != HttpStatusCode.NotFound) { r.success = false; r.httpException = resp.ex; r.SetErrMsgFromBytes(resp.content); return r; } r.success = true; r.content = profile; return r; }
public void TestSaveAgentProfile() { var doc = new AgentProfileDocument(); doc.agent = agent; doc.id = "test"; doc.content = System.Text.Encoding.UTF8.GetBytes("Test value"); LRSResponse lrsRes = lrs.SaveAgentProfile(doc); Assert.IsTrue(lrsRes.success); }