/// <summary> /// Removes a member from a project in Pivotal /// </summary> /// <param name="user">The user to get the ApiToken from</param> /// <param name="project">The project to remove the person from</param> /// <param name="member">The member to remove</param> /// <returns>The member that was removed</returns> public static PivotalMembership RemoveMember(PivotalUser user, PivotalProject project, PivotalMembership member) { string url = String.Format("{0}/projects/{1}/memberships/{2}?token={3}", PivotalService.BaseUrl, project.Id.GetValueOrDefault(), member.Id.GetValueOrDefault(), user.ApiToken); XmlDocument response = PivotalService.SubmitData(url, null, ServiceMethod.DELETE); return member; }
/// <summary> /// Removes a member from a project in Pivotal /// </summary> /// <param name="user">The user to get the ApiToken from</param> /// <param name="member">The member to remove</param> /// <returns>The member that was removed</returns> public PivotalMembership RemoveMember(PivotalUser user, PivotalMembership member) { return RemoveMember(user, this, member); }
/// <summary> /// Adds a member to a project /// </summary> /// <param name="user">The user to get the ApiToken from</param> /// <param name="project">The project to get membership info for</param> /// <param name="member">The person and role to add to the project</param> /// <returns>The added member's identity</returns> public static PivotalMembership AddMember(PivotalUser user, PivotalProject project, PivotalMembership member) { string url = String.Format("{0}/projects/{1}/memberships?token={2}", PivotalService.BaseUrl, project.Id.ToString(), user.ApiToken); XmlDocument xml = SerializationHelper.SerializeToXmlDocument<PivotalMembership>(member); string memberXml = PivotalService.CleanXmlForSubmission(xml, "//membership", ExcludeNodesOnSubmit, true); XmlDocument response = PivotalService.SubmitData(url, memberXml, ServiceMethod.POST); return SerializationHelper.DeserializeFromXmlDocument<PivotalMembership>(response); }
/// <summary> /// Removes a member from a project in Pivotal /// </summary> /// <param name="user">The user to get the ApiToken from</param> /// <param name="project">The project to remove the person from</param> /// <param name="member">The member to remove</param> /// <returns>The member that was removed</returns> public static PivotalMembership RemoveMember(PivotalUser user, PivotalProject project, PivotalMembership member) { string url = String.Format("{0}/projects/{1}/memberships/{2}?token={3}", PivotalService.BaseUrl, project.Id.GetValueOrDefault(), member.Id.GetValueOrDefault(), user.ApiToken); XmlDocument response = PivotalService.SubmitData(url, null, ServiceMethod.DELETE); return(member); }
/// <summary> /// Removes a member from a project in Pivotal /// </summary> /// <param name="user">The user to get the ApiToken from</param> /// <param name="member">The member to remove</param> /// <returns>The member that was removed</returns> public PivotalMembership RemoveMember(PivotalUser user, PivotalMembership member) { return(RemoveMember(user, this, member)); }
/// <summary> /// Adds a member to a project /// </summary> /// <param name="user">The user to get the ApiToken from</param> /// <param name="project">The project to get membership info for</param> /// <param name="member">The person and role to add to the project</param> /// <returns>The added member's identity</returns> public static PivotalMembership AddMember(PivotalUser user, PivotalProject project, PivotalMembership member) { string url = String.Format("{0}/projects/{1}/memberships?token={2}", PivotalService.BaseUrl, project.Id.ToString(), user.ApiToken); XmlDocument xml = SerializationHelper.SerializeToXmlDocument <PivotalMembership>(member); string memberXml = PivotalService.CleanXmlForSubmission(xml, "//membership", ExcludeNodesOnSubmit, true); XmlDocument response = PivotalService.SubmitData(url, memberXml, ServiceMethod.POST); return(SerializationHelper.DeserializeFromXmlDocument <PivotalMembership>(response)); }