diff --git a/proto/location.proto b/proto/location.proto index 991d732..63bdaa0 100644 --- a/proto/location.proto +++ b/proto/location.proto @@ -4,8 +4,6 @@ package weather; option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto"; -//import "units.proto" - // Sub-message used by Current & Extended for exact coordinates message Coordinates { float latitude = 1; @@ -29,9 +27,9 @@ enum LocationType { * zip_code {string} - non-numeric values permitted */ message RequestLocation { - // LocationType location_type = 1; - string city = 1; - // optional string zip_code = 2; + LocationType location_type = 1; + optional string city = 2; + optional string zip_code = 3; } // Response to RequestLocation diff --git a/proto/service.proto b/proto/service.proto index f66c80f..50e7227 100644 --- a/proto/service.proto +++ b/proto/service.proto @@ -9,6 +9,6 @@ import "location.proto"; service WeatherService { rpc Current(RequestCurrent) returns (SendCurrent); - rpc Extended(RequestExtended) returns (SendExtended); + rpc Extended(RequestFiveDay) returns (SendFiveDay); rpc Location(RequestLocation) returns (SendLocation); } diff --git a/proto/weather.proto b/proto/weather.proto index e8f3282..ea5e88b 100644 --- a/proto/weather.proto +++ b/proto/weather.proto @@ -4,7 +4,7 @@ package weather; option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto"; -//import "location.proto" +import "location.proto"; // Sub-message used by Current & Extended to specify preferred units enum Units { @@ -23,11 +23,11 @@ enum Units { * coordinates {Coordinates} - Coordinates message with latitude and longitude */ message RequestCurrent { - // LocationType location_type = 1; - // Units units = 2; - string city = 1; - // optional string zip_code = 2; - // Coordinates coordinates = 2; + LocationType location_type = 1; + Units units = 2; + optional string city = 3; + optional string zip_code = 4; + optional Coordinates coordinates = 5; } // Response to RequestCurrent @@ -42,18 +42,16 @@ message SendCurrent { * city {string} - case insensitive, spaces and punctuation allowed * zip_code {string} - non-numeric values permitted * coordinates {Coordinates} - Coordinates message with latitude and longitude - * days {uint32} - number of days to fetch, max 16 */ -message RequestExtended { - // LocationType location_type = 1; - // Units units = 2; - string city = 1; - // optional string zip_code = 2; - // Coordinates coordinates = 3; - uint32 days = 2; +message RequestFiveDay { + LocationType location_type = 1; + Units units = 2; + optional string city = 3; + optional string zip_code = 4; + optional Coordinates coordinates = 5; } // Response to RequestExtended -message SendExtended { +message SendFiveDay { string payload = 1; }