syntax = "proto3";

import "proto/user_id.proto";

package context;

// Next ID: 5
message RequestContext {
  user_id.UserId user_id = 1;

  // Group ID for the request.
  //
  // If omitted, we try to fall back to the first group we can find
  // that matches the following list of criteria (in order):
  //
  // 1. Any group with an owned domain.
  // 2. The default group, unless `no_app_default_user_group` is set in the
  // config.
  // 3. The user's self-owned group, if it exists.
  // 4. Any group with a write token.
  string group_id = 2;

  // Group ID to act as. This requires special permissions that are configured
  // at the installation level.
  string impersonating_group_id = 4;

  // The difference, in minutes, between the current date as evaluated in the
  // UTC time zone, and the same date as evaluated in the local time zone.
  //
  // Ex: if the current timezone offset is UTC-7, this should be set to
  // -((-7) * 60) = 420.
  //
  // See also
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset
  int32 timezone_offset_minutes = 3;
}

message ResponseContext {
  // Nada. Zip. Zilch.
}
