chromium/chrome/browser/apps/almanac_api_client/proto/client_context.proto

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package apps.proto;

// This file is a mirror of the proto file maintained in the server code base at
// go/almanac-api-client-context-proto. Changes should be made by updating the
// server code base and then copying the result to Chromium.

// Context about the client device making this request.
message ClientDeviceContext {
  // The channel that this device is enrolled in.
  enum Channel {
    // Default for deserialization when an unexpected value is encountered.
    // Indicates to the client that the server has a new channel and needs
    // the proto file updated.
    CHANNEL_UNKNOWN = 0;

    // Canary channel.
    CHANNEL_CANARY = 2;

    // Developer channel.
    CHANNEL_DEV = 3;

    // Beta channel.
    CHANNEL_BETA = 4;

    // Stable channel.
    CHANNEL_STABLE = 5;

    // Default channel for builds that don't define a channel e.g. all builds
    // except official signed builds.
    CHANNEL_DEFAULT = 6;

    // No longer used.
    reserved "CHANNEL_INTERNAL";
    reserved 1;
  }

  // Version info about the OS, Browser and other platforms.
  message Versions {
    // No longer used. Need to figure out to properly deprecate this without
    // causing issues with one platform.
    optional string chrome_os_platform = 1;
    optional string chrome_lacros = 3;

    // Required. Chrome version for Ash on the device.
    optional string chrome_ash = 2;

    // Optional. Arc SDK version if enabled and present. Otherwise, 0 or unset.
    optional int32 arc_sdk = 4;

    // Optional. Steam client version if present.
    optional string steam_client = 5;
  }

  // The board identifier for the device sending the request.
  optional string board = 1;

  // The model identifier for the device sending the request.
  optional string model = 2;

  // The channel the device is allocated to.
  optional Channel channel = 3;

  // The ChromeOS version information.
  optional Versions versions = 4;

  // The HWID identifier for the device sending the request.
  optional string hardware_id = 5;

  // The custom-label tag for the device sending the request, used to
  // distinguish between variations of a device which have different branding
  // but the same hardware. Only set for devices with custom-label variants.
  optional string custom_label_tag = 7;

  // Instructs the server to bypass any response cache is configured on the
  // endpoint and always return a fresh response. This is useful for debugging.
  optional bool bypass_response_cache = 8;
}

// Context about the user of the client device making this request.
message ClientUserContext {
  // The type of the User account making this request.
  enum UserType {
    // Default for deserialization when an unexpected value is encountered.
    // Indicates to the client that the server has a new user type and needs
    // the proto file updated.
    USERTYPE_UNKNOWN = 0;

    // Normal consumer.
    USERTYPE_UNMANAGED = 1;

    // Enterprise, education, etc.
    USERTYPE_MANAGED = 2;

    // A child account that has restricted access to adult content.
    USERTYPE_CHILD = 3;

    // A guest account on the device.
    USERTYPE_GUEST = 4;

    // A managed user who has a @google.com account.
    USERTYPE_GOOGLE = 5;

    // A managed guest account on the device.
    USERTYPE_MANAGED_GUEST = 6;
  }

  // The language-country identifier for the user in language in
  // "language-COUNTRY" format, and must match one of the valid Google
  // recognised codes.
  // Note: this should ideally be the user's preferred language, if absent
  // use the language specified by the UI. The server will attempt to honour
  // this explicitly, but if it cannot it wil fall-back onto the next best
  // available or en-US in the worst.case.
  optional string language = 1;

  // The type of user account making this request.
  optional UserType user_type = 2;
}

// Wrapper message for ClientDeviceContext and ClientUserContext.
message ClientContext {
  // Context about the client device making this request.
  optional ClientDeviceContext device_context = 1;

  // Context about the user of the client device making this request.
  optional ClientUserContext user_context = 2;
}