Skip to content

Commit 2aee35d

Browse files
chore: upgrade gapic-generator-python (googleapis#10776)
PiperOrigin-RevId: 487492758 Source-Link: googleapis/googleapis@5be5981 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcm91dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix broken generated code Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent da6ecb2 commit 2aee35d

24 files changed

Lines changed: 199 additions & 140 deletions

packages/google-maps-routing/google/maps/routing_v2/services/routes/async_client.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
Awaitable,
2222
Dict,
2323
Mapping,
24+
MutableMapping,
25+
MutableSequence,
2426
Optional,
2527
Sequence,
2628
Tuple,
@@ -159,9 +161,9 @@ def transport(self) -> RoutesTransport:
159161
def __init__(
160162
self,
161163
*,
162-
credentials: ga_credentials.Credentials = None,
164+
credentials: Optional[ga_credentials.Credentials] = None,
163165
transport: Union[str, RoutesTransport] = "grpc_asyncio",
164-
client_options: ClientOptions = None,
166+
client_options: Optional[ClientOptions] = None,
165167
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
166168
) -> None:
167169
"""Instantiates the routes client.
@@ -205,10 +207,10 @@ def __init__(
205207

206208
async def compute_routes(
207209
self,
208-
request: Union[routes_service.ComputeRoutesRequest, dict] = None,
210+
request: Optional[Union[routes_service.ComputeRoutesRequest, dict]] = None,
209211
*,
210212
retry: OptionalRetry = gapic_v1.method.DEFAULT,
211-
timeout: float = None,
213+
timeout: Optional[float] = None,
212214
metadata: Sequence[Tuple[str, str]] = (),
213215
) -> routes_service.ComputeRoutesResponse:
214216
r"""Returns the primary route along with optional alternate routes,
@@ -275,7 +277,7 @@ async def sample_compute_routes():
275277
print(response)
276278
277279
Args:
278-
request (Union[google.maps.routing_v2.types.ComputeRoutesRequest, dict]):
280+
request (Optional[Union[google.maps.routing_v2.types.ComputeRoutesRequest, dict]]):
279281
The request object. ComputeRoutes request message.
280282
retry (google.api_core.retry.Retry): Designation of what errors, if any,
281283
should be retried.
@@ -311,10 +313,10 @@ async def sample_compute_routes():
311313

312314
def compute_route_matrix(
313315
self,
314-
request: Union[routes_service.ComputeRouteMatrixRequest, dict] = None,
316+
request: Optional[Union[routes_service.ComputeRouteMatrixRequest, dict]] = None,
315317
*,
316318
retry: OptionalRetry = gapic_v1.method.DEFAULT,
317-
timeout: float = None,
319+
timeout: Optional[float] = None,
318320
metadata: Sequence[Tuple[str, str]] = (),
319321
) -> Awaitable[AsyncIterable[routes_service.RouteMatrixElement]]:
320322
r"""Takes in a list of origins and destinations and returns a stream
@@ -383,7 +385,7 @@ async def sample_compute_route_matrix():
383385
print(response)
384386
385387
Args:
386-
request (Union[google.maps.routing_v2.types.ComputeRouteMatrixRequest, dict]):
388+
request (Optional[Union[google.maps.routing_v2.types.ComputeRouteMatrixRequest, dict]]):
387389
The request object. ComputeRouteMatrix request message
388390
retry (google.api_core.retry.Retry): Designation of what errors, if any,
389391
should be retried.

packages/google-maps-routing/google/maps/routing_v2/services/routes/client.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@
1616
from collections import OrderedDict
1717
import os
1818
import re
19-
from typing import Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, Union, cast
19+
from typing import (
20+
Dict,
21+
Iterable,
22+
Mapping,
23+
MutableMapping,
24+
MutableSequence,
25+
Optional,
26+
Sequence,
27+
Tuple,
28+
Type,
29+
Union,
30+
cast,
31+
)
2032

2133
from google.api_core import client_options as client_options_lib
2234
from google.api_core import exceptions as core_exceptions
@@ -58,7 +70,7 @@ class RoutesClientMeta(type):
5870

5971
def get_transport_class(
6072
cls,
61-
label: str = None,
73+
label: Optional[str] = None,
6274
) -> Type[RoutesTransport]:
6375
"""Returns an appropriate transport class.
6476
@@ -311,7 +323,7 @@ def __init__(
311323
self,
312324
*,
313325
credentials: Optional[ga_credentials.Credentials] = None,
314-
transport: Union[str, RoutesTransport, None] = None,
326+
transport: Optional[Union[str, RoutesTransport]] = None,
315327
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
316328
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
317329
) -> None:
@@ -409,10 +421,10 @@ def __init__(
409421

410422
def compute_routes(
411423
self,
412-
request: Union[routes_service.ComputeRoutesRequest, dict] = None,
424+
request: Optional[Union[routes_service.ComputeRoutesRequest, dict]] = None,
413425
*,
414426
retry: OptionalRetry = gapic_v1.method.DEFAULT,
415-
timeout: float = None,
427+
timeout: Optional[float] = None,
416428
metadata: Sequence[Tuple[str, str]] = (),
417429
) -> routes_service.ComputeRoutesResponse:
418430
r"""Returns the primary route along with optional alternate routes,
@@ -516,10 +528,10 @@ def sample_compute_routes():
516528

517529
def compute_route_matrix(
518530
self,
519-
request: Union[routes_service.ComputeRouteMatrixRequest, dict] = None,
531+
request: Optional[Union[routes_service.ComputeRouteMatrixRequest, dict]] = None,
520532
*,
521533
retry: OptionalRetry = gapic_v1.method.DEFAULT,
522-
timeout: float = None,
534+
timeout: Optional[float] = None,
523535
metadata: Sequence[Tuple[str, str]] = (),
524536
) -> Iterable[routes_service.RouteMatrixElement]:
525537
r"""Takes in a list of origins and destinations and returns a stream

packages/google-maps-routing/google/maps/routing_v2/services/routes/transports/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848
self,
4949
*,
5050
host: str = DEFAULT_HOST,
51-
credentials: ga_credentials.Credentials = None,
51+
credentials: Optional[ga_credentials.Credentials] = None,
5252
credentials_file: Optional[str] = None,
5353
scopes: Optional[Sequence[str]] = None,
5454
quota_project_id: Optional[str] = None,

packages/google-maps-routing/google/maps/routing_v2/services/routes/transports/grpc.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ def __init__(
4646
self,
4747
*,
4848
host: str = "routes.googleapis.com",
49-
credentials: ga_credentials.Credentials = None,
50-
credentials_file: str = None,
51-
scopes: Sequence[str] = None,
52-
channel: grpc.Channel = None,
53-
api_mtls_endpoint: str = None,
54-
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
55-
ssl_channel_credentials: grpc.ChannelCredentials = None,
56-
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
49+
credentials: Optional[ga_credentials.Credentials] = None,
50+
credentials_file: Optional[str] = None,
51+
scopes: Optional[Sequence[str]] = None,
52+
channel: Optional[grpc.Channel] = None,
53+
api_mtls_endpoint: Optional[str] = None,
54+
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
55+
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
56+
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
5757
quota_project_id: Optional[str] = None,
5858
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
5959
always_use_jwt_access: Optional[bool] = False,
@@ -180,8 +180,8 @@ def __init__(
180180
def create_channel(
181181
cls,
182182
host: str = "routes.googleapis.com",
183-
credentials: ga_credentials.Credentials = None,
184-
credentials_file: str = None,
183+
credentials: Optional[ga_credentials.Credentials] = None,
184+
credentials_file: Optional[str] = None,
185185
scopes: Optional[Sequence[str]] = None,
186186
quota_project_id: Optional[str] = None,
187187
**kwargs,

packages/google-maps-routing/google/maps/routing_v2/services/routes/transports/grpc_asyncio.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class RoutesGrpcAsyncIOTransport(RoutesTransport):
4848
def create_channel(
4949
cls,
5050
host: str = "routes.googleapis.com",
51-
credentials: ga_credentials.Credentials = None,
51+
credentials: Optional[ga_credentials.Credentials] = None,
5252
credentials_file: Optional[str] = None,
5353
scopes: Optional[Sequence[str]] = None,
5454
quota_project_id: Optional[str] = None,
@@ -91,15 +91,15 @@ def __init__(
9191
self,
9292
*,
9393
host: str = "routes.googleapis.com",
94-
credentials: ga_credentials.Credentials = None,
94+
credentials: Optional[ga_credentials.Credentials] = None,
9595
credentials_file: Optional[str] = None,
9696
scopes: Optional[Sequence[str]] = None,
97-
channel: aio.Channel = None,
98-
api_mtls_endpoint: str = None,
99-
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
100-
ssl_channel_credentials: grpc.ChannelCredentials = None,
101-
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
102-
quota_project_id=None,
97+
channel: Optional[aio.Channel] = None,
98+
api_mtls_endpoint: Optional[str] = None,
99+
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
100+
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
101+
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
102+
quota_project_id: Optional[str] = None,
103103
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
104104
always_use_jwt_access: Optional[bool] = False,
105105
api_audience: Optional[str] = None,

packages/google-maps-routing/google/maps/routing_v2/types/fallback_info.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from typing import MutableMapping, MutableSequence
17+
1618
import proto # type: ignore
1719

1820
__protobuf__ = proto.module(
@@ -57,12 +59,12 @@ class FallbackInfo(proto.Message):
5759
triggered and the fallback response is returned.
5860
"""
5961

60-
routing_mode = proto.Field(
62+
routing_mode: "FallbackRoutingMode" = proto.Field(
6163
proto.ENUM,
6264
number=1,
6365
enum="FallbackRoutingMode",
6466
)
65-
reason = proto.Field(
67+
reason: "FallbackReason" = proto.Field(
6668
proto.ENUM,
6769
number=2,
6870
enum="FallbackReason",

packages/google-maps-routing/google/maps/routing_v2/types/location.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from typing import MutableMapping, MutableSequence
17+
1618
from google.protobuf import wrappers_pb2 # type: ignore
1719
from google.type import latlng_pb2 # type: ignore
1820
import proto # type: ignore
@@ -41,12 +43,12 @@ class Location(proto.Message):
4143
field only for ``DRIVE`` and ``TWO_WHEELER`` travel modes.
4244
"""
4345

44-
lat_lng = proto.Field(
46+
lat_lng: latlng_pb2.LatLng = proto.Field(
4547
proto.MESSAGE,
4648
number=1,
4749
message=latlng_pb2.LatLng,
4850
)
49-
heading = proto.Field(
51+
heading: wrappers_pb2.Int32Value = proto.Field(
5052
proto.MESSAGE,
5153
number=2,
5254
message=wrappers_pb2.Int32Value,

packages/google-maps-routing/google/maps/routing_v2/types/maneuver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from typing import MutableMapping, MutableSequence
17+
1618
import proto # type: ignore
1719

1820
__protobuf__ = proto.module(

packages/google-maps-routing/google/maps/routing_v2/types/navigation_instruction.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from typing import MutableMapping, MutableSequence
17+
1618
import proto # type: ignore
1719

1820
from google.maps.routing_v2.types import maneuver as gmr_maneuver
@@ -39,12 +41,12 @@ class NavigationInstruction(proto.Message):
3941
Instructions for navigating this step.
4042
"""
4143

42-
maneuver = proto.Field(
44+
maneuver: gmr_maneuver.Maneuver = proto.Field(
4345
proto.ENUM,
4446
number=1,
4547
enum=gmr_maneuver.Maneuver,
4648
)
47-
instructions = proto.Field(
49+
instructions: str = proto.Field(
4850
proto.STRING,
4951
number=2,
5052
)

packages/google-maps-routing/google/maps/routing_v2/types/polyline.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from typing import MutableMapping, MutableSequence
17+
1618
from google.protobuf import struct_pb2 # type: ignore
1719
import proto # type: ignore
1820

@@ -64,12 +66,12 @@ class Polyline(proto.Message):
6466
This field is a member of `oneof`_ ``polyline_type``.
6567
"""
6668

67-
encoded_polyline = proto.Field(
69+
encoded_polyline: str = proto.Field(
6870
proto.STRING,
6971
number=1,
7072
oneof="polyline_type",
7173
)
72-
geo_json_linestring = proto.Field(
74+
geo_json_linestring: struct_pb2.Struct = proto.Field(
7375
proto.MESSAGE,
7476
number=2,
7577
oneof="polyline_type",

0 commit comments

Comments
 (0)