syntax = "proto3";

package worldmonitor.unrest.v1;

import "sebuf/http/annotations.proto";
import "worldmonitor/core/v1/pagination.proto";
import "worldmonitor/core/v1/severity.proto";
import "worldmonitor/unrest/v1/unrest_event.proto";

// ListUnrestEventsRequest specifies filters for retrieving social unrest events.
message ListUnrestEventsRequest {
  // Start of time range (inclusive), Unix epoch milliseconds.
  int64 start = 1 [(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER, (sebuf.http.query) = { name: "start" }];
  // End of time range (inclusive), Unix epoch milliseconds.
  int64 end = 2 [(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER, (sebuf.http.query) = { name: "end" }];
  // Maximum items per page (1-100).
  // Accepted but currently ignored; no-op until this handler supports the parameter.
  int32 page_size = 3 [(sebuf.http.query) = { name: "page_size" }, (sebuf.http.unimplemented) = true];
  // Cursor for next page.
  // Accepted but currently ignored; no-op until this handler supports the parameter.
  string cursor = 4 [(sebuf.http.query) = { name: "cursor" }, (sebuf.http.unimplemented) = true];
  // Optional country filter (ISO 3166-1 alpha-2).
  string country = 5 [(sebuf.http.query) = { name: "country" }];
  // Optional minimum severity filter.
  // Accepted but currently ignored; no-op until this handler supports the parameter.
  worldmonitor.core.v1.SeverityLevel min_severity = 6 [(sebuf.http.query) = { name: "min_severity" }, (sebuf.http.unimplemented) = true];
  // North-east corner latitude of bounding box.
  // Accepted but currently ignored; no-op until this handler supports the parameter.
  double ne_lat = 7 [(sebuf.http.query) = { name: "ne_lat" }, (sebuf.http.unimplemented) = true];
  // North-east corner longitude of bounding box.
  // Accepted but currently ignored; no-op until this handler supports the parameter.
  double ne_lon = 8 [(sebuf.http.query) = { name: "ne_lon" }, (sebuf.http.unimplemented) = true];
  // South-west corner latitude of bounding box.
  // Accepted but currently ignored; no-op until this handler supports the parameter.
  double sw_lat = 9 [(sebuf.http.query) = { name: "sw_lat" }, (sebuf.http.unimplemented) = true];
  // South-west corner longitude of bounding box.
  // Accepted but currently ignored; no-op until this handler supports the parameter.
  double sw_lon = 10 [(sebuf.http.query) = { name: "sw_lon" }, (sebuf.http.unimplemented) = true];
}

// ListUnrestEventsResponse contains unrest events and clusters matching the request.
message ListUnrestEventsResponse {
  // Individual unrest events.
  repeated UnrestEvent events = 1;
  // Geographic clusters of related events.
  repeated UnrestCluster clusters = 2;
  // Pagination metadata.
  worldmonitor.core.v1.PaginationResponse pagination = 3;
}
