OpenWeather-gRPC-API/proto/location.proto

42 lines
1.1 KiB
Protocol Buffer
Raw Normal View History

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"
// 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 {
// LocationType location_type = 1;
2022-07-26 15:05:21 -04:00
string city = 1;
// optional string zip_code = 2;
2022-07-26 15:05:21 -04:00
}
// Response to RequestLocation
2022-07-26 15:05:21 -04:00
message SendLocation {
float latitude = 1;
float longitude = 2;
}