// Flights — Airports, airlines, two and a half thousand scheduled flights and their bookings — the live-board one. // sondahub (https://sondahub.com): served over gRPC-Web and Connect at https://api.sondahub.com/grpc. // Writes are simulated: answered as a real server would, kept only in the x-sondahub-session token you send back. syntax = "proto3"; package sondahub.flights.v1; import "google/protobuf/struct.proto"; service FlightsService { // A page of airports: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListAirports(ListAirportsRequest) returns (ListAirportsResponse); // One airport by id. rpc GetAirport(GetAirportRequest) returns (Airport); // Create a airport (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateAirport(Airport) returns (Airport); // Change the fields set in airport (simulated). rpc UpdateAirport(UpdateAirportRequest) returns (Airport); // Delete one (simulated); answers what was removed. rpc DeleteAirport(DeleteAirportRequest) returns (Airport); // A page of airlines: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListAirlines(ListAirlinesRequest) returns (ListAirlinesResponse); // One airline by id. rpc GetAirline(GetAirlineRequest) returns (Airline); // Create a airline (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateAirline(Airline) returns (Airline); // Change the fields set in airline (simulated). rpc UpdateAirline(UpdateAirlineRequest) returns (Airline); // Delete one (simulated); answers what was removed. rpc DeleteAirline(DeleteAirlineRequest) returns (Airline); // A page of flights: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListFlights(ListFlightsRequest) returns (ListFlightsResponse); // One flight by id. rpc GetFlight(GetFlightRequest) returns (Flight); // Create a flight (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateFlight(Flight) returns (Flight); // Change the fields set in flight (simulated). rpc UpdateFlight(UpdateFlightRequest) returns (Flight); // Delete one (simulated); answers what was removed. rpc DeleteFlight(DeleteFlightRequest) returns (Flight); // A page of bookings: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListBookings(ListBookingsRequest) returns (ListBookingsResponse); // One booking by id. rpc GetBooking(GetBookingRequest) returns (Booking); // Create a booking (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateBooking(Booking) returns (Booking); // Change the fields set in booking (simulated). rpc UpdateBooking(UpdateBookingRequest) returns (Booking); // Delete one (simulated); answers what was removed. rpc DeleteBooking(DeleteBookingRequest) returns (Booking); // The API's live activity as a server stream, each topic at its own pace: board (every 3 s), bookings (every 6 s). max_events ends the stream (default 10, at most 120). rpc Watch(WatchRequest) returns (stream Event); } message Airport { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional string iata = 4; optional string name = 5; optional string city = 6; optional string country = 7; optional string timezone = 8; optional double lat = 9; optional double lon = 10; optional int64 terminals = 11; } message ListAirportsRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListAirportsResponse { repeated Airport data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateAirportRequest { int64 id = 1; Airport airport = 2; } message GetAirportRequest { int64 id = 1; } message DeleteAirportRequest { int64 id = 1; } message Airline { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional string code = 4; optional string name = 5; optional string alliance = 6; optional int64 fleet_size = 7; } message ListAirlinesRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListAirlinesResponse { repeated Airline data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateAirlineRequest { int64 id = 1; Airline airline = 2; } message GetAirlineRequest { int64 id = 1; } message DeleteAirlineRequest { int64 id = 1; } message Flight { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional string number = 4; optional int64 airline_id = 5; // IATA code. optional string origin = 6; optional string destination = 7; optional int64 origin_airport_id = 8; optional int64 destination_airport_id = 9; // Local date at the origin. optional string departure_date = 10; optional string scheduled_departure = 11; optional string scheduled_arrival = 12; optional string estimated_departure = 13; optional string actual_departure = 14; optional string status = 15; optional int64 delay_minutes = 16; optional string gate = 17; optional string terminal = 18; optional string aircraft = 19; optional int64 duration_minutes = 20; optional int64 distance_km = 21; optional int64 seats_total = 22; optional int64 seats_available = 23; // USD, economy. optional double base_fare = 24; } message ListFlightsRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListFlightsResponse { repeated Flight data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateFlightRequest { int64 id = 1; Flight flight = 2; } message GetFlightRequest { int64 id = 1; } message DeleteFlightRequest { int64 id = 1; } message Booking { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; // Six-character record locator, unique. optional string locator = 4; optional int64 flight_id = 5; google.protobuf.Value passenger = 6; // Assigned by the hub on POST when omitted. optional string seat = 7; optional string cabin = 8; optional string status = 9; optional double fare = 10; optional string currency = 11; optional int64 bags = 12; optional string frequent_flyer = 13; google.protobuf.Value special_requests = 14; optional string booked_at = 15; optional string checked_in_at = 16; } message ListBookingsRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListBookingsResponse { repeated Booking data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateBookingRequest { int64 id = 1; Booking booking = 2; } message GetBookingRequest { int64 id = 1; } message DeleteBookingRequest { int64 id = 1; } message WatchRequest { repeated string topics = 1; int32 max_events = 2; } message Event { string topic = 1; string api = 2; string ts = 3; google.protobuf.Struct data = 4; }