2022-07-28 01:27:11 -04:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package weather;
|
|
|
|
|
|
|
|
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
|
|
|
|
2022-08-31 22:40:26 -04:00
|
|
|
import "location.proto";
|
2022-07-28 01:27:11 -04:00
|
|
|
|
|
|
|
// 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
|
|
|
|
* Commented parameters in the message definition are not implemeneted yet
|
|
|
|
* location_type {enum} - name or value
|
|
|
|
* units {enum} - name or value
|
|
|
|
* city {string} - case insensitive, spaces and punctuation allowed
|
|
|
|
* zip_code {string} - non-numeric values permitted
|
|
|
|
* coordinates {Coordinates} - Coordinates message with latitude and longitude
|
|
|
|
*/
|
|
|
|
message RequestCurrent {
|
2022-08-31 22:40:26 -04:00
|
|
|
LocationType location_type = 1;
|
|
|
|
Units units = 2;
|
|
|
|
optional string city = 3;
|
|
|
|
optional string zip_code = 4;
|
|
|
|
optional Coordinates coordinates = 5;
|
2022-07-28 01:27:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Response to RequestCurrent
|
|
|
|
message SendCurrent {
|
|
|
|
string payload = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the extended forecast for a given location up to 16 days in the future
|
|
|
|
* Commented parameters in the message definition are not implemeneted yet
|
|
|
|
* location_type {enum} - name or value
|
|
|
|
* units {enum} - name or value
|
|
|
|
* city {string} - case insensitive, spaces and punctuation allowed
|
|
|
|
* zip_code {string} - non-numeric values permitted
|
|
|
|
* coordinates {Coordinates} - Coordinates message with latitude and longitude
|
|
|
|
*/
|
2022-08-31 22:40:26 -04:00
|
|
|
message RequestFiveDay {
|
|
|
|
LocationType location_type = 1;
|
|
|
|
Units units = 2;
|
|
|
|
optional string city = 3;
|
|
|
|
optional string zip_code = 4;
|
|
|
|
optional Coordinates coordinates = 5;
|
2022-07-28 01:27:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Response to RequestExtended
|
2022-08-31 22:40:26 -04:00
|
|
|
message SendFiveDay {
|
2022-07-28 01:27:11 -04:00
|
|
|
string payload = 1;
|
|
|
|
}
|