/// <summary> /// Update the user group identified by its unique identifier /// </summary> public UserGroup UpdateUserGroup(UserGroupRequest userGroup) { string apiMethod = String.Format("/Base/UserGroup/{0}", userGroup.Id); RequestBodyBuilder parameters = PopulateRequestParameters(userGroup, RequestTypes.Create); UserGroupCollection userGroups = Connector.ExecutePut<UserGroupCollection>(apiMethod, parameters.ToString()); if (userGroups.Count > 0) { return userGroups[0]; } return null; }
private static RequestBodyBuilder PopulateRequestParameters(UserGroupRequest userGroup, RequestTypes requestType) { userGroup.EnsureValidData(requestType); RequestBodyBuilder parameters = new RequestBodyBuilder(); if (!String.IsNullOrEmpty(userGroup.Title)) { parameters.AppendRequestData("title", userGroup.Title); } parameters.AppendRequestData("grouptype", EnumUtility.ToApiString(userGroup.GroupType)); //parameters.AppendRequestData("ismaster", Convert.ToInt32(userGroup.Ismaster)); return parameters; }
/// <summary> /// Retrieve the user group identified by its unique identifier /// </summary> public UserGroup CreateUserGroup(UserGroupRequest userGroup) { string apiMethod = "/Base/UserGroup/"; RequestBodyBuilder parameters = PopulateRequestParameters(userGroup, RequestTypes.Create); UserGroupCollection userGroups = Connector.ExecutePost<UserGroupCollection>(apiMethod, parameters.ToString()); if (userGroups != null && userGroups.Count > 0) { return userGroups[0]; } return null; }
public static UserGroup ToResponseData(UserGroupRequest requestData) { return(UserGroupRequest.ToResponseType <UserGroupRequest, UserGroup>(requestData)); }
public static UserGroupRequest FromResponseData(UserGroup responseData) { return(UserGroupRequest.FromResponseType <UserGroup, UserGroupRequest>(responseData)); }
public static UserGroup ToResponseData(UserGroupRequest requestData) => ToResponseType <UserGroupRequest, UserGroup>(requestData);
public static UserGroup ToResponseData(UserGroupRequest requestData) { return UserGroupRequest.ToResponseType<UserGroupRequest, UserGroup>(requestData); }