Skip to content

Commit a3b60b0

Browse files
Google APIscopybara-github
authored andcommitted
chore: migrate maps/routes onto the {Java,Python} microgenerators
Committer: @miraleung PiperOrigin-RevId: 357773363
1 parent 28a44ec commit a3b60b0

3 files changed

Lines changed: 19 additions & 34 deletions

File tree

google/maps/routes/v1/BUILD.bazel

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@ proto_library_with_info(
5050

5151
##############################################################################
5252
# Java
53-
# DO NOT OVERRIDE with autogenerated rules if NOT migrated to Java Microgen
5453
##############################################################################
5554
load(
5655
"@com_google_googleapis_imports//:imports.bzl",
56+
"java_gapic_assembly_gradle_pkg",
5757
"java_grpc_library",
5858
"java_proto_library",
59-
java_gapic_assembly_gradle_pkg = "java_gapic_assembly_gradle_pkg_legacy",
6059
)
6160

6261
java_proto_library(
@@ -107,39 +106,13 @@ go_proto_library(
107106
##############################################################################
108107
load(
109108
"@com_google_googleapis_imports//:imports.bzl",
110-
"moved_proto_library",
111-
"py_grpc_library",
112-
"py_proto_library",
109+
"py_gapic_library",
113110
)
114111

115-
moved_proto_library(
116-
name = "routes_moved_proto",
112+
py_gapic_library(
113+
name = "routes_py_gapic",
117114
srcs = [":routes_proto"],
118-
deps = [
119-
"//google/api:annotations_proto",
120-
"//google/api:client_proto",
121-
"//google/api:field_behavior_proto",
122-
"//google/geo/type:viewport_proto",
123-
"//google/rpc:status_proto",
124-
"//google/type:latlng_proto",
125-
"//google/type:money_proto",
126-
"@com_google_protobuf//:duration_proto",
127-
"@com_google_protobuf//:struct_proto",
128-
"@com_google_protobuf//:timestamp_proto",
129-
"@com_google_protobuf//:wrappers_proto",
130-
],
131-
)
132-
133-
py_proto_library(
134-
name = "routes_py_proto",
135-
plugin = "@protoc_docs_plugin//:docs_plugin",
136-
deps = [":routes_moved_proto"],
137-
)
138-
139-
py_grpc_library(
140-
name = "routes_py_grpc",
141-
srcs = [":routes_moved_proto"],
142-
deps = [":routes_py_proto"],
115+
grpc_service_config = "routes_grpc_service_config.json",
143116
)
144117

145118
##############################################################################

google/maps/routes/v1/route_service.proto

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ option php_namespace = "Google\\Maps\\Routes\\V1";
3535
// The Routes Preferred API.
3636
service RoutesPreferred {
3737
option (google.api.default_host) = "routespreferred.googleapis.com";
38-
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/maps-platform.routespreferred";
38+
option (google.api.oauth_scopes) =
39+
"https://www.googleapis.com/auth/maps-platform.routespreferred";
3940

4041
// Returns the primary route along with optional alternate routes, given a set
4142
// of terminal and intermediate waypoints.
@@ -77,6 +78,8 @@ service RoutesPreferred {
7778
post: "/v1:computeRoutes"
7879
body: "*"
7980
};
81+
82+
option (google.api.method_signature) = "origin,destination";
8083
}
8184

8285
// Takes in a list of origins and destinations and returns a stream containing
@@ -114,7 +117,8 @@ service RoutesPreferred {
114117
// be automatically included in the response.
115118
// * Selecting only the fields that you need results in a smaller response
116119
// size, and thus higher network throughput.
117-
rpc ComputeRouteMatrix(ComputeRouteMatrixRequest) returns (stream RouteMatrixElement) {
120+
rpc ComputeRouteMatrix(ComputeRouteMatrixRequest)
121+
returns (stream RouteMatrixElement) {
118122
option (google.api.http) = {
119123
post: "/v1:computeRouteMatrix"
120124
body: "*"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"methodConfig": [
3+
{
4+
"name": [{"service": "google.maps.routes.v1.RoutesPreferred" }],
5+
"timeout": "60s"
6+
}
7+
]
8+
}

0 commit comments

Comments
 (0)