/// <summary> /// Creates a com.esendex.sdk.groups.Group instance and returns the new com.esendex.sdk.groups.Group instance. /// </summary> /// <param name="group">A com.esendex.sdk.groups.Group instance that contains the group.</param> /// <returns>A com.esendex.sdk.groups.Group instance that contains the group with an Id assigned.</returns> /// <exception cref="System.ArgumentException"></exception> /// <exception cref="System.Net.WebException"></exception> public Group CreateGroup(Group group) { var requestXml = Serialiser.Serialise(group); RestResource resource = new GroupsResource(requestXml); return MakeRequest<GroupResponse>(HttpMethod.POST, resource) .Group; }
/// <summary> /// Returns true if the group was successfully updated; otherwise, false. /// </summary> /// <param name="group">A com.esendex.sdk.groups.Group instance that contains the group.</param> /// <returns>true, if the group was successfully updated; otherwise, false.</returns> /// <exception cref="System.ArgumentException"></exception> /// <exception cref="System.Net.WebException"></exception> public bool UpdateGroup(Group group) { var requestXml = Serialiser.Serialise(group); RestResource resource = new GroupsResource(group.Id, requestXml); var response = MakeRequest(HttpMethod.PUT, resource); return (response != null); }
/// <summary> /// Initialises a new instance of the com.esendex.sdk.groups.GroupCollection /// </summary> /// <param name="group">A com.esendex.sdk.groups.Group instance that contains a contact.</param> public GroupCollection(Group group) { if (group == null) throw new ArgumentNullException("contactgroup"); Items.Add(group); }
protected bool Equals(Group other) { return Id.Equals(other.Id) && string.Equals(Name, other.Name) && string.Equals(AccountReference, other.AccountReference); }