Box.V2.Managers.BoxUsersManager.UpdateUserInformationAsync C# (CSharp) Method

UpdateUserInformationAsync() public method

Used to edit the settings and information about a user. This method only works for enterprise admins. To roll a user out of the enterprise (and convert them to a standalone free user), update the special enterprise attribute to be null.
public UpdateUserInformationAsync ( BoxUserRequest userRequest, List fields = null ) : Task
userRequest BoxUserRequest BoxUserRequest object.
fields List Attribute(s) to include in the response.
return Task
        public async Task<BoxUser> UpdateUserInformationAsync(BoxUserRequest userRequest, List<string> fields = null)
        {
            userRequest.ThrowIfNull("userRequest")
                .Id.ThrowIfNullOrWhiteSpace("userRequest.Id");
            BoxRequest request = new BoxRequest(_config.UserEndpointUri, userRequest.Id)
                .Param(ParamFields, fields)
                .Payload(_converter.Serialize(userRequest))
                .Method(RequestMethod.Put);

            IBoxResponse<BoxUser> response = await ToResponseAsync<BoxUser>(request).ConfigureAwait(false);

            return response.ResponseObject;
        }