OpenWeather-gRPC-API/proto/weather.proto

49 lines
1.3 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
package weather;
2022-09-01 23:43:01 -04:00
option go_package = "codeberg.org/andcscott/OpenWeather-gRPC-API/proto";
import "location.proto";
/* 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
* location {OneOfLocation} - city name, zip code, or coordinates
*/
message RequestCurrent {
LocationType location_type = 1;
Units units = 2;
OneOfLocation location = 3;
}
// Response to RequestCurrent
message SendCurrent {
string payload = 1;
}
/* Get the extended forecast for a given location up to 16 days in the future
* 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
*/
message RequestFiveDay {
LocationType location_type = 1;
Units units = 2;
OneOfLocation location = 3;
}
// Response to RequestExtended
message SendFiveDay {
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;
}