// SPDX-FileCopyrightText: 2024 Google LLC
// SPDX-License-Identifier: Apache-2.0

/**
Events represent discrete moments in time or windows in time where something
happened.
*/

syntax = "proto2";

package pebble.pipeline;

option java_package = "com.getpebble.pipeline";

import "activity.proto";
import "common.proto";

message Event {
  enum Type {
    UnknownEvent = 0; /// Protocol Buffers uses the first enum as the default
    ActivitySessionEvent = 1;
    // NotificationEvent = 2;
    // ViewHealthChart = 3;
  }
  required bytes uuid = 1; /// 16-byte uuid for efficient message size
  optional User user = 2; /// can usually be omitted and included in Requests
  required Type type = 4; /// string types are more sanely extensible, but enum types would be more typo resistant and smaller message size
  required uint32 time_utc = 5; /// when the event occured (unix epoch seconds)
  required sint32 utc_to_local = 6; /// time_utc + utc_to_local = time_local. sint32 stores neg number efficiently. need to recast before adding to time_utc, but saves storage
  optional uint32 created_time_utc = 7; /// events may be created at times other than their occurance
  optional uint32 duration = 8;  /// in same units as time_utc (sec)
  optional LocationInfo location = 9;
  optional ActivitySession activity_session = 10;
  // We will add the additional properties for events needed here later
}
