diff --git a/proto/location.proto b/proto/location.proto index fe4f3e5..a04906c 100644 --- a/proto/location.proto +++ b/proto/location.proto @@ -4,13 +4,31 @@ package weather; option go_package = "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"; -// Sub-message for Coordinates +/* Get the latitude and longitude for a given location + * Commented parameters in the message definition are not implemeneted yet + * location_type {LocationType} - name or value of the desired LocationType enum + * location {OneOfLocation} - city name, zip code, or coordinates + */ +message RequestLocation { + LocationType location_type = 1; + OneOfLocation location = 2; +} + +// Response to RequestLocation +message SendLocation { + float latitude = 1; + float longitude = 2; +} + +// Sub-message for OneOfLocation +// Used to specify actual coordinates for the desired location message Coordinates { float latitude = 1; float longitude = 2; } -// Sub-message for RequestLocation +// Sub-message for RequestLocation, RequestCurrent, and RequestFiveDay +// Used to specify the desired location: city, zip code, or coordinates. message OneOfLocation { oneof location_id { string city = 1; @@ -30,19 +48,3 @@ enum LocationType { LOCATION_TYPE_ZIP_CODE = 2; LOCATION_TYPE_COORDS = 3; } - -/* Get the latitude and longitude for a given location - * Commented parameters in the message definition are not implemeneted yet - * location_type {LocationType} - name or value of the desired LocationType enum - * location {OneOfLocation} - city name, zip code, or coordinates - */ -message RequestLocation { - LocationType location_type = 1; - OneOfLocation location = 2; -} - -// Response to RequestLocation -message SendLocation { - float latitude = 1; - float longitude = 2; -} diff --git a/proto/weather.proto b/proto/weather.proto index 6e4482b..73c3fcd 100644 --- a/proto/weather.proto +++ b/proto/weather.proto @@ -6,14 +6,6 @@ option go_package = "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"; import "location.proto"; -// Sub-message used by Current & Extended to specify preferred units -enum Units { - UNITS_UNSPECIFIED = 0; - UNITS_STANDARD = 1; - UNITS_METRIC = 2; - UNITS_IMPERIAL = 3; -} - /* Get the current forecast for a given location * location_type {LocationType} - name or value of the desired LocationType enum * units {Units} - name or value of the desired Units enum @@ -45,3 +37,12 @@ message RequestFiveDay { message SendFiveDay { string payload = 1; } + +// Sub-message used by Current & Extended to specify preferred units +// If unspecified, results will default to standard (temperature in Kelvin) +enum Units { + UNITS_UNSPECIFIED = 0; + UNITS_STANDARD = 1; + UNITS_METRIC = 2; + UNITS_IMPERIAL = 3; +}