// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
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 occurred (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 occurrence
  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
}
