const CONTRIBUTEES = ["get", "https://api.x.com/1.1/users/contributees.json"];
const CONTRIBUTORS = ["get", "https://api.x.com/1.1/users/contributors.json"];

export async function contributees(opts = {}) {
  const params = { ...opts.params };
  if (opts.userId) params.user_id = opts.userId;
  if (opts.screenName) params.screen_name = opts.screenName;
  const res = await this.v1_1(CONTRIBUTEES, { params });
  return await res.json();
}

export async function contributors(opts = {}) {
  const params = { ...opts.params };
  if (opts.userId) params.user_id = opts.userId;
  if (opts.screenName) params.screen_name = opts.screenName;
  const res = await this.v1_1(CONTRIBUTORS, { params });
  return await res.json();
}

export function actAs(userId) {
  return this.setActingAs(userId);
}

export function stop() {
  return this.setActingAs(null);
}

export function current() {
  return this.actingAs;
}
