syntax = "proto3";

package worldmonitor.positive_events.v1;

import "sebuf/http/annotations.proto";

message PositiveGeoEvent {
  double latitude = 1;
  double longitude = 2;
  string name = 3;
  string category = 4;
  int32 count = 5;
  int64 timestamp = 6 [(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER];
}

message ListPositiveGeoEventsRequest {}

message ListPositiveGeoEventsResponse {
  repeated PositiveGeoEvent events = 1;

  // Unix epoch ms at which the underlying source data was last successfully
  // fetched. Always set when serving from cache or in-process fallback; 0 if
  // no data is available. Clients can use this to display a freshness
  // indicator or "data is X minutes old" warning. See issue #3706.
  int64 fetched_at = 2 [(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER];

  // True when the response is being served from the in-process fallback
  // cache because the upstream source is unavailable or returned stale
  // data. Clients can surface a "data may be out of date" indicator. See
  // issue #3706.
  bool stale = 3;
}
