UpdateUser() public method

Update a user.

It mirrors To the following Smartsheet REST API method: PUT /users/{userId}

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public UpdateUser ( User user ) : User
user User the user To update
return User
        public virtual void TestUpdateUser()
        {
            server.setResponseBody("../../../TestSDK/resources/updateUser.json");

            User user        = new User.UpdateUserBuilder(123L, true, true).Build();
            User updatedUser = userResources.UpdateUser(user);

            Assert.AreEqual(true, updatedUser.Admin);
            Assert.AreEqual(true, updatedUser.LicensedSheetCreator);
        }
Example #2
0
        public virtual void TestUpdateUser()
        {
            server.setResponseBody("../../../TestSDK/resources/updateUser.json");

            User user = new User();

            user.ID    = 1234L;
            user.Admin = true;
            user.LicensedSheetCreator = true;
            User updatedUser = userResources.UpdateUser(user);

            Assert.AreEqual("*****@*****.**", updatedUser.Email);
            Assert.AreEqual(false, updatedUser.Admin);
            Assert.AreEqual(true, updatedUser.LicensedSheetCreator);
            Assert.AreEqual(8166691168380804L, (long)updatedUser.ID);
            Assert.AreEqual(UserStatus.ACTIVE, updatedUser.Status);
        }