code: function _setMembershipState(client, roomId, userId, membershipValue, reason,
                               callback) {
      if (utils.isFunction(reason)) {
          callback = reason; reason = undefined;
      }
  
      const path = utils.encodeUri(
          "/rooms/$roomId/state/m.room.member/$userId",
          { $roomId: roomId, $userId: userId},
      );
  
      return client._http.authedRequest(callback, "PUT", path, undefined, {
          membership: membershipValue,
          reason: reason,
      });
  }
docs: This is an internal method.
  @param {MatrixClient} client
  @param {string} roomId
  @param {string} userId
  @param {string} membershipValue
  @param {string} reason
  @param {module:client.callback} callback Optional.
  @return {module:client.Promise} Resolves: TODO
  @return {module:http-api.MatrixError} Rejects: with an error response.