112 lines
2.7 KiB
Protocol Buffer
112 lines
2.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package address.v1;
|
|
|
|
service AddressService {
|
|
rpc SearchRegions(SearchRequest) returns (SearchResponse);
|
|
rpc SearchCities(SearchRequest) returns (SearchResponse);
|
|
rpc SearchLocalities(LocalitySearchRequest) returns (SearchResponse);
|
|
rpc SearchStreets(SearchRequest) returns (SearchResponse);
|
|
rpc SearchHouses(SearchRequest) returns (HouseSearchResponse);
|
|
rpc Search(UniversalSearchRequest) returns (SearchResponse);
|
|
rpc SearchSuggest(SearchRequest) returns (SearchResponse);
|
|
rpc Health(HealthRequest) returns (HealthResponse);
|
|
}
|
|
|
|
enum SearchKind {
|
|
SEARCH_KIND_UNSPECIFIED = 0;
|
|
SEARCH_KIND_REGION = 1;
|
|
SEARCH_KIND_CITY = 2;
|
|
SEARCH_KIND_STREET = 3;
|
|
}
|
|
|
|
message SearchRequest {
|
|
string query = 1;
|
|
optional string region_code = 2;
|
|
optional int64 parent_id = 3;
|
|
optional int32 limit = 4;
|
|
int32 offset = 5;
|
|
optional bool fuzzy = 6;
|
|
optional string kladr_id = 7;
|
|
optional string parent_kladr_id = 8;
|
|
optional string parent_fias_id = 9;
|
|
optional string fias_id = 10;
|
|
optional bool include_parent = 11;
|
|
}
|
|
|
|
message LocalitySearchRequest {
|
|
string query = 1;
|
|
int32 region_id = 2;
|
|
optional int64 parent_id = 3;
|
|
optional int32 limit = 4;
|
|
int32 offset = 5;
|
|
optional bool fuzzy = 6;
|
|
optional string kladr_id = 7;
|
|
optional string fias_id = 8;
|
|
optional string parent_kladr_id = 9;
|
|
optional string parent_fias_id = 10;
|
|
optional bool include_parent = 11;
|
|
}
|
|
|
|
message UniversalSearchRequest {
|
|
string query = 1;
|
|
string region_code = 2;
|
|
optional int64 parent_id = 3;
|
|
optional int32 limit = 4;
|
|
int32 offset = 5;
|
|
optional bool fuzzy = 6;
|
|
SearchKind kind = 7;
|
|
optional string kladr_id = 8;
|
|
optional string fias_id = 9;
|
|
optional string parent_kladr_id = 10;
|
|
optional string parent_fias_id = 11;
|
|
optional bool include_parent = 12;
|
|
}
|
|
|
|
message Address {
|
|
int64 id = 1;
|
|
string fias_id = 2;
|
|
optional int64 object_id = 3;
|
|
optional int64 parent_id = 4;
|
|
string name = 5;
|
|
string type_name = 6;
|
|
int32 level = 7;
|
|
string region_code = 8;
|
|
string kladr_id = 9;
|
|
optional Address parent = 10;
|
|
string label = 11;
|
|
string full_label = 12;
|
|
string short_label = 13;
|
|
}
|
|
|
|
message SearchResponse {
|
|
int32 count = 1;
|
|
repeated Address items = 2;
|
|
}
|
|
|
|
message House {
|
|
string fias_id = 1;
|
|
int64 object_id = 2;
|
|
optional int64 parent_id = 3;
|
|
string region_code = 4;
|
|
string house_number = 5;
|
|
optional int32 house_type = 6;
|
|
string additional_number_1 = 7;
|
|
optional int32 additional_type_1 = 8;
|
|
string additional_number_2 = 9;
|
|
optional int32 additional_type_2 = 10;
|
|
string postal_code = 11;
|
|
string display_number = 12;
|
|
}
|
|
|
|
message HouseSearchResponse {
|
|
int32 count = 1;
|
|
repeated House items = 2;
|
|
}
|
|
|
|
message HealthRequest {}
|
|
|
|
message HealthResponse {
|
|
string status = 1;
|
|
}
|