コード例 #1
0
        /// <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;
		}
コード例 #2
0
		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;
		}
コード例 #3
0
        /// <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;
		}
コード例 #4
0
 public static UserGroup ToResponseData(UserGroupRequest requestData)
 {
     return(UserGroupRequest.ToResponseType <UserGroupRequest, UserGroup>(requestData));
 }
コード例 #5
0
 public static UserGroupRequest FromResponseData(UserGroup responseData)
 {
     return(UserGroupRequest.FromResponseType <UserGroup, UserGroupRequest>(responseData));
 }
コード例 #6
0
 public static UserGroup ToResponseData(UserGroupRequest requestData) => ToResponseType <UserGroupRequest, UserGroup>(requestData);
コード例 #7
0
 public static UserGroup ToResponseData(UserGroupRequest requestData)
 {
     return UserGroupRequest.ToResponseType<UserGroupRequest, UserGroup>(requestData);
 }