2022-07-26 15:05:21 -04:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package weather;
|
|
|
|
|
|
|
|
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
|
|
|
|
|
|
|
//import "units.proto"
|
|
|
|
|
2022-07-28 01:27:11 -04:00
|
|
|
// Sub-message used by Current & Extended for exact coordinates
|
|
|
|
message Coordinates {
|
|
|
|
float latitude = 1;
|
|
|
|
float longitude = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Used by Location, Current, and Extended to help the API find info for the
|
|
|
|
// correct location. If unspecified, an attept is still made but results may
|
|
|
|
// be inaccurate
|
|
|
|
enum LocationType {
|
|
|
|
LOCATION_TYPE_UNSPECIFIED = 0;
|
|
|
|
LOCATION_CITY = 1;
|
|
|
|
LOCATION_ZIP = 2;
|
|
|
|
LOCATION_COORDS = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the latitude and longitude for a given location
|
|
|
|
* Commented parameters in the message definition are not implemeneted yet
|
|
|
|
* location_type {enum} - name or value
|
|
|
|
* city {string} - case insensitive, spaces and punctuation allowed
|
|
|
|
* zip_code {string} - non-numeric values permitted
|
|
|
|
*/
|
2022-07-26 15:05:21 -04:00
|
|
|
message RequestLocation {
|
2022-07-28 01:27:11 -04:00
|
|
|
// LocationType location_type = 1;
|
2022-07-26 15:05:21 -04:00
|
|
|
string city = 1;
|
2022-07-28 01:27:11 -04:00
|
|
|
// optional string zip_code = 2;
|
2022-07-26 15:05:21 -04:00
|
|
|
}
|
|
|
|
|
2022-07-28 01:27:11 -04:00
|
|
|
// Response to RequestLocation
|
2022-07-26 15:05:21 -04:00
|
|
|
message SendLocation {
|
|
|
|
float latitude = 1;
|
|
|
|
float longitude = 2;
|
|
|
|
}
|