syntax = "proto3";

package worldmonitor.military.v1;

import "sebuf/http/annotations.proto";
import "worldmonitor/military/v1/list_military_flights.proto";
import "worldmonitor/military/v1/get_theater_posture.proto";
import "worldmonitor/military/v1/get_aircraft_details.proto";
import "worldmonitor/military/v1/get_aircraft_details_batch.proto";
import "worldmonitor/military/v1/get_wingbits_status.proto";
import "worldmonitor/military/v1/get_usni_fleet_report.proto";
import "worldmonitor/military/v1/list_military_bases.proto";
import "worldmonitor/military/v1/get_wingbits_live_flight.proto";
import "worldmonitor/military/v1/list_defense_patents.proto";

// MilitaryService provides APIs for military flight and vessel tracking
// sourced from OpenSky, Wingbits, and AIS data.
service MilitaryService {
  option (sebuf.http.service_config) = {base_path: "/api/military/v1"};

  // ListMilitaryFlights retrieves tracked military aircraft from OpenSky and Wingbits.
  rpc ListMilitaryFlights(ListMilitaryFlightsRequest) returns (ListMilitaryFlightsResponse) {
    option (sebuf.http.config) = {path: "/list-military-flights", method: HTTP_METHOD_GET};
  }

  // GetTheaterPosture retrieves military posture assessments for geographic theaters.
  rpc GetTheaterPosture(GetTheaterPostureRequest) returns (GetTheaterPostureResponse) {
    option (sebuf.http.config) = {path: "/get-theater-posture", method: HTTP_METHOD_GET};
  }

  // GetAircraftDetails retrieves Wingbits aircraft enrichment data for a single ICAO24 hex.
  rpc GetAircraftDetails(GetAircraftDetailsRequest) returns (GetAircraftDetailsResponse) {
    option (sebuf.http.config) = {path: "/get-aircraft-details", method: HTTP_METHOD_GET};
  }

  // GetAircraftDetailsBatch retrieves Wingbits aircraft enrichment data for multiple ICAO24 hexes.
  rpc GetAircraftDetailsBatch(GetAircraftDetailsBatchRequest) returns (GetAircraftDetailsBatchResponse) {
    option (sebuf.http.config) = {path: "/get-aircraft-details-batch", method: HTTP_METHOD_POST};
  }

  // GetWingbitsStatus checks whether the Wingbits enrichment API is configured.
  rpc GetWingbitsStatus(GetWingbitsStatusRequest) returns (GetWingbitsStatusResponse) {
    option (sebuf.http.config) = {path: "/get-wingbits-status", method: HTTP_METHOD_GET};
  }

  // GetUSNIFleetReport retrieves the latest parsed USNI Fleet Tracker report.
  rpc GetUSNIFleetReport(GetUSNIFleetReportRequest) returns (GetUSNIFleetReportResponse) {
    option (sebuf.http.config) = {path: "/get-usni-fleet-report", method: HTTP_METHOD_GET};
  }

  // ListMilitaryBases retrieves military bases within a bounding box, with server-side clustering.
  rpc ListMilitaryBases(ListMilitaryBasesRequest) returns (ListMilitaryBasesResponse) {
    option (sebuf.http.config) = {path: "/list-military-bases", method: HTTP_METHOD_GET};
  }

  // GetWingbitsLiveFlight retrieves real-time position data from the Wingbits ECS network for a single aircraft.
  rpc GetWingbitsLiveFlight(GetWingbitsLiveFlightRequest) returns (GetWingbitsLiveFlightResponse) {
    option (sebuf.http.config) = {path: "/get-wingbits-live-flight", method: HTTP_METHOD_GET};
  }

  // ListDefensePatents retrieves recent defense/dual-use patent filings from USPTO PatentsView.
  rpc ListDefensePatents(ListDefensePatentsRequest) returns (ListDefensePatentsResponse) {
    option (sebuf.http.config) = {path: "/list-defense-patents", method: HTTP_METHOD_GET};
  }
}
