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

syntax = "proto3";

package chrome.cros.reporting.proto;

option optimize_for = LITE_RUNTIME;

// This message is used to upload the report of aggregated metrics about SaaS
// usage on the client side.
message SaasUsageReportEvent {

  // Identifier of the profile. On a managed browser this is the path to the
  // profile storage which must be used in conjunction with the device
  // identifier. On an unmanaged device, this is the profile identifier
  // documented here: go/chrome-profile-identifier-dd.
  string profile_id = 1;

  // Whether the profile is affiliated with the browser.
  bool profile_affiliated = 2;

  // Metrics for each SaaS domain visited by the user.
  repeated SaasDomainMetrics domain_metrics = 3;
}

message SaasDomainMetrics {
  // The domain of the SaaS site.
  string domain = 1;

  // The number of times the domain was visited.
  uint64 visit_count = 2;

  // The encryption protocols used to access the SaaS site.
  repeated string encryption_protocols = 3;

  // Timestamp of when the first event occurred in milliseconds since epoch.
  int64 start_time_millis = 4;

  // Timestamp of when the last event occurred in milliseconds since epoch.
  int64 end_time_millis = 5;

}
