2022-07-28 01:27:11 -04:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package weather;
|
|
|
|
|
2024-06-19 12:51:47 -04:00
|
|
|
option go_package = "codeberg.org/andyscott/OpenWeather-gRPC-API/proto";
|
2022-07-28 01:27:11 -04:00
|
|
|
|
2022-08-31 22:40:26 -04:00
|
|
|
import "location.proto";
|
2022-07-28 01:27:11 -04:00
|
|
|
|
|
|
|
/* Get the current forecast for a given location
|
2022-09-01 02:05:33 -04:00
|
|
|
* location_type {LocationType} - name or value of the desired LocationType enum
|
|
|
|
* units {Units} - name or value of the desired Units enum
|
|
|
|
* location {OneOfLocation} - city name, zip code, or coordinates
|
2022-07-28 01:27:11 -04:00
|
|
|
*/
|
|
|
|
message RequestCurrent {
|
2022-08-31 22:40:26 -04:00
|
|
|
LocationType location_type = 1;
|
|
|
|
Units units = 2;
|
2022-09-01 02:05:33 -04:00
|
|
|
OneOfLocation location = 3;
|
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
|
2022-09-01 02:05:33 -04:00
|
|
|
* location_type {LocationType} - name or value of the desired LocationType enum
|
|
|
|
* units {Units} - name or value of the desired Units enum
|
|
|
|
* location {OneOfLocation} - city name, zip code, or coordinates
|
2022-07-28 01:27:11 -04:00
|
|
|
*/
|
2022-08-31 22:40:26 -04:00
|
|
|
message RequestFiveDay {
|
|
|
|
LocationType location_type = 1;
|
|
|
|
Units units = 2;
|
2022-09-01 02:05:33 -04:00
|
|
|
OneOfLocation location = 3;
|
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;
|
|
|
|
}
|
2022-09-02 22:52:02 -04:00
|
|
|
|
|
|
|
// 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;
|
|
|
|
}
|