@@ -10,8 +10,8 @@ from google.api_core import grpc_helpers # type: ignore
1010from google.api_core import operations_v1 # type: ignore
1111{% endif %}
1212from google.api_core import gapic_v1 # type: ignore
13- from google import auth # type: ignore
14- from google.auth import credentials # type: ignore
13+ import google.auth # type: ignore
14+ from google.auth import credentials as ga_credentials # type: ignore
1515from google.auth.transport.grpc import SslCredentials # type: ignore
1616
1717import grpc # type: ignore
@@ -39,7 +39,7 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
3939 """
4040 def __init__(self, *,
4141 host: str{% if service .host %} = '{{ service.host }}'{% endif %} ,
42- credentials: credentials .Credentials = None,
42+ credentials: ga_credentials .Credentials = None,
4343 credentials_file: str = None,
4444 scopes: Sequence[str] = None,
4545 channel: grpc.Channel = None,
@@ -105,7 +105,7 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
105105 host = api_mtls_endpoint if ":" in api_mtls_endpoint else api_mtls_endpoint + ":443"
106106
107107 if credentials is None:
108- credentials, _ = auth.default(scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id)
108+ credentials, _ = google. auth.default(scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id)
109109
110110 # Create SSL credentials with client_cert_source or application
111111 # default SSL credentials.
@@ -135,7 +135,7 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
135135 host = host if ":" in host else host + ":443"
136136
137137 if credentials is None:
138- credentials, _ = auth.default(scopes=self.AUTH_SCOPES)
138+ credentials, _ = google. auth.default(scopes=self.AUTH_SCOPES)
139139
140140 # create a new channel. The provided one is ignored.
141141 self._grpc_channel = type(self).create_channel(
@@ -162,7 +162,7 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
162162 @classmethod
163163 def create_channel(cls,
164164 host: str{% if service .host %} = '{{ service.host }}'{% endif %} ,
165- credentials: credentials .Credentials = None,
165+ credentials: ga_credentials .Credentials = None,
166166 scopes: Optional[Sequence[str]] = None,
167167 **kwargs) -> grpc.Channel:
168168 """Create and return a gRPC channel object.
@@ -217,10 +217,10 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
217217 def {{ method.name|snake_case }}(self) -> Callable[
218218 [{{ method.input.ident }}],
219219 {{ method.output.ident }}]:
220- r"""Return a callable for the {{ ' ' }}
221- {{ (method.name|snake_case).replace('_',' ')|wrap(
222- width=70, offset=40, indent=8) }}
223- {{ ' ' }} method over gRPC.
220+ r"""Return a callable for the{{ ' ' }}
221+ {{- (method.name|snake_case).replace('_',' ')|wrap(
222+ width=70, offset=40, indent=8) - }}
223+ {{ ' ' }}method over gRPC.
224224
225225 {{ method.meta.doc|rst(width=72, indent=8) }}
226226
0 commit comments