Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit cc8a180

Browse files
feat: add from_service_account_info factory and fix sphinx identifiers (#66)
feat: add 'from_service_account_info' factory to clients fix: fix sphinx identifiers PiperOrigin-RevId: 350246057 Source-Author: Google APIs <[email protected]> Source-Date: Tue Jan 5 16:44:11 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: 520682435235d9c503983a360a2090025aa47cd1 Source-Link: googleapis/googleapis@5206824
1 parent 3476c0f commit cc8a180

File tree

16 files changed

+328
-243
lines changed

16 files changed

+328
-243
lines changed

.coveragerc

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
1-
# -*- coding: utf-8 -*-
2-
#
3-
# Copyright 2020 Google LLC
4-
#
5-
# Licensed under the Apache License, Version 2.0 (the "License");
6-
# you may not use this file except in compliance with the License.
7-
# You may obtain a copy of the License at
8-
#
9-
# https://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
17-
# Generated by synthtool. DO NOT EDIT!
181
[run]
192
branch = True
20-
omit =
21-
google/cloud/__init__.py
223

234
[report]
245
fail_under = 100
256
show_missing = True
26-
omit = google/cloud/language/__init__.py
7+
omit =
8+
google/cloud/language/__init__.py
279
exclude_lines =
2810
# Re-enable the standard pragma
2911
pragma: NO COVER

docs/language_v1/language_service.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
LanguageService
2+
---------------------------------
3+
4+
.. automodule:: google.cloud.language_v1.services.language_service
5+
:members:
6+
:inherited-members:

docs/language_v1/services.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Services for Google Cloud Language v1 API
22
=========================================
3+
.. toctree::
4+
:maxdepth: 2
35

4-
.. automodule:: google.cloud.language_v1.services.language_service
5-
:members:
6-
:inherited-members:
6+
language_service

docs/language_v1/types.rst

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Types for Google Cloud Language v1 API
33

44
.. automodule:: google.cloud.language_v1.types
55
:members:
6+
:undoc-members:
67
:show-inheritance:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
LanguageService
2+
---------------------------------
3+
4+
.. automodule:: google.cloud.language_v1beta2.services.language_service
5+
:members:
6+
:inherited-members:

docs/language_v1beta2/services.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Services for Google Cloud Language v1beta2 API
22
==============================================
3+
.. toctree::
4+
:maxdepth: 2
35

4-
.. automodule:: google.cloud.language_v1beta2.services.language_service
5-
:members:
6-
:inherited-members:
6+
language_service

docs/language_v1beta2/types.rst

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Types for Google Cloud Language v1beta2 API
33

44
.. automodule:: google.cloud.language_v1beta2.types
55
:members:
6+
:undoc-members:
67
:show-inheritance:

google/cloud/language_v1/services/language_service/async_client.py

+30-24
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class LanguageServiceAsyncClient:
7474
LanguageServiceClient.parse_common_location_path
7575
)
7676

77+
from_service_account_info = LanguageServiceClient.from_service_account_info
7778
from_service_account_file = LanguageServiceClient.from_service_account_file
7879
from_service_account_json = from_service_account_file
7980

@@ -151,17 +152,18 @@ async def analyze_sentiment(
151152
r"""Analyzes the sentiment of the provided text.
152153
153154
Args:
154-
request (:class:`~.language_service.AnalyzeSentimentRequest`):
155+
request (:class:`google.cloud.language_v1.types.AnalyzeSentimentRequest`):
155156
The request object. The sentiment analysis request
156157
message.
157-
document (:class:`~.language_service.Document`):
158+
document (:class:`google.cloud.language_v1.types.Document`):
158159
Input document.
159160
This corresponds to the ``document`` field
160161
on the ``request`` instance; if ``request`` is provided, this
161162
should not be set.
162-
encoding_type (:class:`~.language_service.EncodingType`):
163+
encoding_type (:class:`google.cloud.language_v1.types.EncodingType`):
163164
The encoding type used by the API to
164165
calculate sentence offsets.
166+
165167
This corresponds to the ``encoding_type`` field
166168
on the ``request`` instance; if ``request`` is provided, this
167169
should not be set.
@@ -173,7 +175,7 @@ async def analyze_sentiment(
173175
sent along with the request as metadata.
174176
175177
Returns:
176-
~.language_service.AnalyzeSentimentResponse:
178+
google.cloud.language_v1.types.AnalyzeSentimentResponse:
177179
The sentiment analysis response
178180
message.
179181
@@ -236,16 +238,17 @@ async def analyze_entities(
236238
properties.
237239
238240
Args:
239-
request (:class:`~.language_service.AnalyzeEntitiesRequest`):
241+
request (:class:`google.cloud.language_v1.types.AnalyzeEntitiesRequest`):
240242
The request object. The entity analysis request message.
241-
document (:class:`~.language_service.Document`):
243+
document (:class:`google.cloud.language_v1.types.Document`):
242244
Input document.
243245
This corresponds to the ``document`` field
244246
on the ``request`` instance; if ``request`` is provided, this
245247
should not be set.
246-
encoding_type (:class:`~.language_service.EncodingType`):
248+
encoding_type (:class:`google.cloud.language_v1.types.EncodingType`):
247249
The encoding type used by the API to
248250
calculate offsets.
251+
249252
This corresponds to the ``encoding_type`` field
250253
on the ``request`` instance; if ``request`` is provided, this
251254
should not be set.
@@ -257,7 +260,7 @@ async def analyze_entities(
257260
sent along with the request as metadata.
258261
259262
Returns:
260-
~.language_service.AnalyzeEntitiesResponse:
263+
google.cloud.language_v1.types.AnalyzeEntitiesResponse:
261264
The entity analysis response message.
262265
"""
263266
# Create or coerce a protobuf request object.
@@ -318,17 +321,18 @@ async def analyze_entity_sentiment(
318321
and its mentions.
319322
320323
Args:
321-
request (:class:`~.language_service.AnalyzeEntitySentimentRequest`):
324+
request (:class:`google.cloud.language_v1.types.AnalyzeEntitySentimentRequest`):
322325
The request object. The entity-level sentiment analysis
323326
request message.
324-
document (:class:`~.language_service.Document`):
327+
document (:class:`google.cloud.language_v1.types.Document`):
325328
Input document.
326329
This corresponds to the ``document`` field
327330
on the ``request`` instance; if ``request`` is provided, this
328331
should not be set.
329-
encoding_type (:class:`~.language_service.EncodingType`):
332+
encoding_type (:class:`google.cloud.language_v1.types.EncodingType`):
330333
The encoding type used by the API to
331334
calculate offsets.
335+
332336
This corresponds to the ``encoding_type`` field
333337
on the ``request`` instance; if ``request`` is provided, this
334338
should not be set.
@@ -340,7 +344,7 @@ async def analyze_entity_sentiment(
340344
sent along with the request as metadata.
341345
342346
Returns:
343-
~.language_service.AnalyzeEntitySentimentResponse:
347+
google.cloud.language_v1.types.AnalyzeEntitySentimentResponse:
344348
The entity-level sentiment analysis
345349
response message.
346350
@@ -402,16 +406,17 @@ async def analyze_syntax(
402406
tags, dependency trees, and other properties.
403407
404408
Args:
405-
request (:class:`~.language_service.AnalyzeSyntaxRequest`):
409+
request (:class:`google.cloud.language_v1.types.AnalyzeSyntaxRequest`):
406410
The request object. The syntax analysis request message.
407-
document (:class:`~.language_service.Document`):
411+
document (:class:`google.cloud.language_v1.types.Document`):
408412
Input document.
409413
This corresponds to the ``document`` field
410414
on the ``request`` instance; if ``request`` is provided, this
411415
should not be set.
412-
encoding_type (:class:`~.language_service.EncodingType`):
416+
encoding_type (:class:`google.cloud.language_v1.types.EncodingType`):
413417
The encoding type used by the API to
414418
calculate offsets.
419+
415420
This corresponds to the ``encoding_type`` field
416421
on the ``request`` instance; if ``request`` is provided, this
417422
should not be set.
@@ -423,7 +428,7 @@ async def analyze_syntax(
423428
sent along with the request as metadata.
424429
425430
Returns:
426-
~.language_service.AnalyzeSyntaxResponse:
431+
google.cloud.language_v1.types.AnalyzeSyntaxResponse:
427432
The syntax analysis response message.
428433
"""
429434
# Create or coerce a protobuf request object.
@@ -480,10 +485,10 @@ async def classify_text(
480485
r"""Classifies a document into categories.
481486
482487
Args:
483-
request (:class:`~.language_service.ClassifyTextRequest`):
488+
request (:class:`google.cloud.language_v1.types.ClassifyTextRequest`):
484489
The request object. The document classification request
485490
message.
486-
document (:class:`~.language_service.Document`):
491+
document (:class:`google.cloud.language_v1.types.Document`):
487492
Input document.
488493
This corresponds to the ``document`` field
489494
on the ``request`` instance; if ``request`` is provided, this
@@ -496,7 +501,7 @@ async def classify_text(
496501
sent along with the request as metadata.
497502
498503
Returns:
499-
~.language_service.ClassifyTextResponse:
504+
google.cloud.language_v1.types.ClassifyTextResponse:
500505
The document classification response
501506
message.
502507
@@ -557,23 +562,24 @@ async def annotate_text(
557562
analyzeSyntax provide in one call.
558563
559564
Args:
560-
request (:class:`~.language_service.AnnotateTextRequest`):
565+
request (:class:`google.cloud.language_v1.types.AnnotateTextRequest`):
561566
The request object. The request message for the text
562567
annotation API, which can perform multiple analysis
563568
types (sentiment, entities, and syntax) in one call.
564-
document (:class:`~.language_service.Document`):
569+
document (:class:`google.cloud.language_v1.types.Document`):
565570
Input document.
566571
This corresponds to the ``document`` field
567572
on the ``request`` instance; if ``request`` is provided, this
568573
should not be set.
569-
features (:class:`~.language_service.AnnotateTextRequest.Features`):
574+
features (:class:`google.cloud.language_v1.types.AnnotateTextRequest.Features`):
570575
The enabled features.
571576
This corresponds to the ``features`` field
572577
on the ``request`` instance; if ``request`` is provided, this
573578
should not be set.
574-
encoding_type (:class:`~.language_service.EncodingType`):
579+
encoding_type (:class:`google.cloud.language_v1.types.EncodingType`):
575580
The encoding type used by the API to
576581
calculate offsets.
582+
577583
This corresponds to the ``encoding_type`` field
578584
on the ``request`` instance; if ``request`` is provided, this
579585
should not be set.
@@ -585,7 +591,7 @@ async def annotate_text(
585591
sent along with the request as metadata.
586592
587593
Returns:
588-
~.language_service.AnnotateTextResponse:
594+
google.cloud.language_v1.types.AnnotateTextResponse:
589595
The text annotations response
590596
message.
591597

0 commit comments

Comments
 (0)