Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
Awaitable,
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Expand Down Expand Up @@ -159,9 +161,9 @@ def transport(self) -> RoutesTransport:
def __init__(
self,
*,
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, RoutesTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_options: Optional[ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the routes client.
Expand Down Expand Up @@ -205,10 +207,10 @@ def __init__(

async def compute_routes(
self,
request: Union[routes_service.ComputeRoutesRequest, dict] = None,
request: Optional[Union[routes_service.ComputeRoutesRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> routes_service.ComputeRoutesResponse:
r"""Returns the primary route along with optional alternate routes,
Expand Down Expand Up @@ -275,7 +277,7 @@ async def sample_compute_routes():
print(response)

Args:
request (Union[google.maps.routing_v2.types.ComputeRoutesRequest, dict]):
request (Optional[Union[google.maps.routing_v2.types.ComputeRoutesRequest, dict]]):
The request object. ComputeRoutes request message.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down Expand Up @@ -311,10 +313,10 @@ async def sample_compute_routes():

def compute_route_matrix(
self,
request: Union[routes_service.ComputeRouteMatrixRequest, dict] = None,
request: Optional[Union[routes_service.ComputeRouteMatrixRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> Awaitable[AsyncIterable[routes_service.RouteMatrixElement]]:
r"""Takes in a list of origins and destinations and returns a stream
Expand Down Expand Up @@ -383,7 +385,7 @@ async def sample_compute_route_matrix():
print(response)

Args:
request (Union[google.maps.routing_v2.types.ComputeRouteMatrixRequest, dict]):
request (Optional[Union[google.maps.routing_v2.types.ComputeRouteMatrixRequest, dict]]):
The request object. ComputeRouteMatrix request message
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, Union, cast
from typing import (
Dict,
Iterable,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)

from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
Expand Down Expand Up @@ -58,7 +70,7 @@ class RoutesClientMeta(type):

def get_transport_class(
cls,
label: str = None,
label: Optional[str] = None,
) -> Type[RoutesTransport]:
"""Returns an appropriate transport class.

Expand Down Expand Up @@ -311,7 +323,7 @@ def __init__(
self,
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, RoutesTransport, None] = None,
transport: Optional[Union[str, RoutesTransport]] = None,
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
Expand Down Expand Up @@ -409,10 +421,10 @@ def __init__(

def compute_routes(
self,
request: Union[routes_service.ComputeRoutesRequest, dict] = None,
request: Optional[Union[routes_service.ComputeRoutesRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> routes_service.ComputeRoutesResponse:
r"""Returns the primary route along with optional alternate routes,
Expand Down Expand Up @@ -516,10 +528,10 @@ def sample_compute_routes():

def compute_route_matrix(
self,
request: Union[routes_service.ComputeRouteMatrixRequest, dict] = None,
request: Optional[Union[routes_service.ComputeRouteMatrixRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> Iterable[routes_service.RouteMatrixElement]:
r"""Takes in a list of origins and destinations and returns a stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
self,
*,
host: str = DEFAULT_HOST,
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def __init__(
self,
*,
host: str = "routes.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
scopes: Sequence[str] = None,
channel: grpc.Channel = None,
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
channel: Optional[grpc.Channel] = None,
api_mtls_endpoint: Optional[str] = None,
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
Expand Down Expand Up @@ -180,8 +180,8 @@ def __init__(
def create_channel(
cls,
host: str = "routes.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class RoutesGrpcAsyncIOTransport(RoutesTransport):
def create_channel(
cls,
host: str = "routes.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
Expand Down Expand Up @@ -91,15 +91,15 @@ def __init__(
self,
*,
host: str = "routes.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
channel: aio.Channel = None,
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
channel: Optional[aio.Channel] = None,
api_mtls_endpoint: Optional[str] = None,
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from typing import MutableMapping, MutableSequence

import proto # type: ignore

__protobuf__ = proto.module(
Expand Down Expand Up @@ -57,12 +59,12 @@ class FallbackInfo(proto.Message):
triggered and the fallback response is returned.
"""

routing_mode = proto.Field(
routing_mode: "FallbackRoutingMode" = proto.Field(
proto.ENUM,
number=1,
enum="FallbackRoutingMode",
)
reason = proto.Field(
reason: "FallbackReason" = proto.Field(
proto.ENUM,
number=2,
enum="FallbackReason",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from typing import MutableMapping, MutableSequence

from google.protobuf import wrappers_pb2 # type: ignore
from google.type import latlng_pb2 # type: ignore
import proto # type: ignore
Expand Down Expand Up @@ -41,12 +43,12 @@ class Location(proto.Message):
field only for ``DRIVE`` and ``TWO_WHEELER`` travel modes.
"""

lat_lng = proto.Field(
lat_lng: latlng_pb2.LatLng = proto.Field(
proto.MESSAGE,
number=1,
message=latlng_pb2.LatLng,
)
heading = proto.Field(
heading: wrappers_pb2.Int32Value = proto.Field(
proto.MESSAGE,
number=2,
message=wrappers_pb2.Int32Value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from typing import MutableMapping, MutableSequence

import proto # type: ignore

__protobuf__ = proto.module(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from typing import MutableMapping, MutableSequence

import proto # type: ignore

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

maneuver = proto.Field(
maneuver: gmr_maneuver.Maneuver = proto.Field(
proto.ENUM,
number=1,
enum=gmr_maneuver.Maneuver,
)
instructions = proto.Field(
instructions: str = proto.Field(
proto.STRING,
number=2,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from typing import MutableMapping, MutableSequence

from google.protobuf import struct_pb2 # type: ignore
import proto # type: ignore

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

encoded_polyline = proto.Field(
encoded_polyline: str = proto.Field(
proto.STRING,
number=1,
oneof="polyline_type",
)
geo_json_linestring = proto.Field(
geo_json_linestring: struct_pb2.Struct = proto.Field(
proto.MESSAGE,
number=2,
oneof="polyline_type",
Expand Down
Loading