code: function _membershipChange(client, roomId, userId, membership, reason, callback) {
      if (utils.isFunction(reason)) {
          callback = reason; reason = undefined;
      }
  
      const path = utils.encodeUri("/rooms/$room_id/$membership", {
          $room_id: roomId,
          $membership: membership,
      });
      return client._http.authedRequest(
          callback, "POST", path, undefined, {
              user_id: userId,  // may be undefined e.g. on leave
              reason: reason,
          },
      );
  }
docs: This is an internal method.
  @param {MatrixClient} client
  @param {string} roomId
  @param {string} userId
  @param {string} membership
  @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.