mirror of
https://codeberg.org/andyscott/OpenWeather-gRPC-API.git
synced 2024-12-20 12:03:10 -05:00
Update proto files for additional request options and free-tier API
This commit is contained in:
parent
6966aa1d9c
commit
b142b6856d
3 changed files with 17 additions and 21 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue