8000 docs: update docstrings to use absolute links (#355) · googleapis/google-cloud-python@2daaf49 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2daaf49

Browse files
docs: update docstrings to use absolute links (#355)
* fix: use full link in comment to fix JSDoc broken link Committer: @summer-ji-eng PiperOrigin-RevId: 440481666 Source-Link: googleapis/googleapis@6a21110 Source-Link: googleapis/googleapis-gen@e6e39af Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTZlMzlhZmYzM2I5MGE2M2ExOGU5MDgxZTQ4MGIwOGE0MWM1NDhhYyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent ebeb9ab commit 2daaf49

File tree

6 files changed

+167
-87
lines changed

6 files changed

+167
-87
lines changed

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ def sample_create_phrase_set():
251251
``us`` (US North America), and ``eu`` (Europe). If you
252252
are calling the ``speech.googleapis.com`` endpoint, use
253253
the ``global`` location. To specify a region, use a
254-
`regional endpoint </speech-to-text/docs/endpoints>`__
254+
`regional
255+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
255256
with matching ``us`` or ``eu`` location value.
256257
257258
This corresponds to the ``parent`` field
@@ -376,7 +377,8 @@ def sample_get_phrase_set():
376377
``us`` (US North America), and ``eu`` (Europe). If you
377378
are calling the ``speech.googleapis.com`` endpoint, use
378379
the ``global`` location. To specify a region, use a
379-
`regional endpoint </speech-to-text/docs/endpoints>`__
380+
`regional
381+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
380382
with matching ``us`` or ``eu`` location value.
381383
382384
This corresponds to the ``name`` field
@@ -482,7 +484,8 @@ def sample_list_phrase_set():
482484
``us`` (US North America), and ``eu`` (Europe). If you
483485
are calling the ``speech.googleapis.com`` endpoint, use
484486
the ``global`` location. To specify a region, use a
485-
`regional endpoint </speech-to-text/docs/endpoints>`__
487+
`regional
488+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
486489
with matching ``us`` or ``eu`` location value.
487490
488491
This corresponds to the ``parent`` field
@@ -600,7 +603,8 @@ def sample_update_phrase_set():
600603
``us`` (US North America), and ``eu`` (Europe). If you
601604
are calling the ``speech.googleapis.com`` endpoint, use
602605
the ``global`` location. To specify a region, use a
603-
`regional endpoint </speech-to-text/docs/endpoints>`__
606+
`regional
607+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
604608
with matching ``us`` or ``eu`` location value.
605609
606610
This corresponds to the ``phrase_set`` field
@@ -801,7 +805,8 @@ def sample_create_custom_class():
801805
``us`` (US North America), and ``eu`` (Europe). If you
802806
are calling the ``speech.googleapis.com`` endpoint, use
803807
the ``global`` location. To specify a region, use a
804-
`regional endpoint </speech-to-text/docs/endpoints>`__
808+
`regional
809+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
805810
with matching ``us`` or ``eu`` location value.
806811
807812
This corresponds to the ``parent`` field
@@ -1033,7 +1038,8 @@ def sample_list_custom_classes():
10331038
``us`` (US North America), and ``eu`` (Europe). If you
10341039
are calling the ``speech.googleapis.com`` endpoint, use
10351040
the ``global`` location. To specify a region, use a
1036-
`regional endpoint </speech-to-text/docs/endpoints>`__
1041+
`regional
1042+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
10371043
with matching ``us`` or ``eu`` location value.
10381044
10391045
This corresponds to the ``parent`` field
@@ -1151,7 +1157,8 @@ def sample_update_custom_class():
11511157
``us`` (US North America), and ``eu`` (Europe). If you
11521158
are calling the ``speech.googleapis.com`` endpoint, use
11531159
the ``global`` location. To specify a region, use a
1154-
`regional endpoint </speech-to-text/docs/endpoints>`__
1160+
`regional
1161+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
11551162
with matching ``us`` or ``eu`` location value.
11561163
11571164
This corresponds to the ``custom_class`` field
@@ -1266,7 +1273,8 @@ def sample_delete_custom_class():
12661273
``us`` (US North America), and ``eu`` (Europe). If you
12671274
are calling the ``speech.googleapis.com`` endpoint, use
12681275
the ``global`` location. To specify a region, use a
1269-
`regional endpoint </speech-to-text/docs/endpoints>`__
1276+
`regional
1277+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
12701278
with matching ``us`` or ``eu`` location value.
12711279
12721280
This corresponds to the ``name`` field

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/client.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ def sample_create_phrase_set():
499499
``us`` (US North America), and ``eu`` (Europe). If you
500500
are calling the ``speech.googleapis.com`` endpoint, use
501501
the ``global`` location. To specify a region, use a
502-
`regional endpoint </speech-to-text/docs/endpoints>`__
502+
`regional
503+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
503504
with matching ``us`` or ``eu`` location value.
504505
505506
This corresponds to the ``parent`` field
@@ -624,7 +625,8 @@ def sample_get_phrase_set():
624625
``us`` (US North America), and ``eu`` (Europe). If you
625626
are calling the ``speech.googleapis.com`` endpoint, use
626627
the ``global`` location. To specify a region, use a
627-
`regional endpoint </speech-to-text/docs/endpoints>`__
628+
`regional
629+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
628630
with matching ``us`` or ``eu`` location value.
629631
630632
This corresponds to the ``name`` field
@@ -730,7 +732,8 @@ def sample_list_phrase_set():
730732
``us`` (US North America), and ``eu`` (Europe). If you
731733
are calling the ``speech.googleapis.com`` endpoint, use
732734
the ``global`` location. To specify a region, use a
733-
`regional endpoint </speech-to-text/docs/endpoints>`__
735+
`regional
736+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
734737
with matching ``us`` or ``eu`` location value.
735738
736739
This corresponds to the ``parent`` field
@@ -848,7 +851,8 @@ def sample_update_phrase_set():
848851
``us`` (US North America), and ``eu`` (Europe). If you
849852
are calling the ``speech.googleapis.com`` endpoint, use
850853
the ``global`` location. To specify a region, use a
851-
`regional endpoint </speech-to-text/docs/endpoints>`__
854+
`regional
855+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
852856
with matching ``us`` or ``eu`` location value.
853857
854858
This corresponds to the ``phrase_set`` field
@@ -1049,7 +1053,8 @@ def sample_create_custom_class():
10491053
``us`` (US North America), and ``eu`` (Europe). If you
10501054
are calling the ``speech.googleapis.com`` endpoint, use
10511055
the ``global`` location. To specify a region, use a
1052-
`regional endpoint </speech-to-text/docs/endpoints>`__
1056+
`regional
1057+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
10531058
with matching ``us`` or ``eu`` location value.
10541059
10551060
This corresponds to the ``parent`` field
@@ -1281,7 +1286,8 @@ def sample_list_custom_classes():
12811286
``us`` (US North America), and ``eu`` (Europe). If you
12821287
are calling the ``speech.googleapis.com`` endpoint, use
12831288
the ``global`` location. To specify a region, use a
1284-
`regional endpoint </speech-to-text/docs/endpoints>`__
1289+
`regional
1290+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
12851291
with matching ``us`` or ``eu`` location value.
12861292
12871293
This corresponds to the ``parent`` field
@@ -1399,7 +1405,8 @@ def sample_update_custom_class():
13991405
``us`` (US North America), and ``eu`` (Europe). If you
14001406
are calling the ``speech.googleapis.com`` endpoint, use
14011407
the ``global`` location. To specify a region, use a
1402-
`regional endpoint </speech-to-text/docs/endpoints>`__
1408+
`regional
1409+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
14031410
with matching ``us`` or ``eu`` location value.
14041411
14051412
This corresponds to the ``custom_class`` field
@@ -1514,7 +1521,8 @@ def sample_delete_custom_class():
15141521
``us`` (US North America), and ``eu`` (Europe). If you
15151522
are calling the ``speech.googleapis.com`` endpoint, use
15161523
the ``global`` location. To specify a region, use a
1517-
`regional endpoint </speech-to-text/docs/endpoints>`__
1524+
`regional
1525+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
15181526
with matching ``us`` or ``eu`` location value.
15191527
15201528
This corresponds to the ``name`` field

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class CreatePhraseSetRequest(proto.Message):
5252
(US North America), and ``eu`` (Europe). If you are calling
5353
the ``speech.googleapis.com`` endpoint, use the ``global``
5454
location. To specify a region, use a `regional
55-
endpoint </speech-to-text/docs/endpoints>`__ with matching
56-
``us`` or ``eu`` location value.
55+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
56+
with matching ``us`` or ``eu`` location value.
5757
phrase_set_id (str):
5858
Required. The ID to use for the phrase set, which will
5959
become the final component of the phrase set's resource
@@ -96,8 +96,8 @@ class UpdatePhraseSetRequest(proto.Message):
9696
(US North America), and ``eu`` (Europe). If you are calling
9797
the ``speech.googleapis.com`` endpoint, use the ``global``
9898
location. To specify a region, use a `regional
99-
endpoint </speech-to-text/docs/endpoints>`__ with matching
100-
``us`` or ``eu`` location value.
99+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
100+
with matching ``us`` or ``eu`` location value.
101101
update_mask (google.protobuf.field_mask_pb2.FieldMask):
102102
The list of fields to be updated.
103103
"""
@@ -127,8 +127,8 @@ class GetPhraseSetRequest(proto.Message):
127127
(US North America), and ``eu`` (Europe). If you are calling
128128
the ``speech.googleapis.com`` endpoint, use the ``global``
129129
location. To specify a region, use a `regional
130-
endpoint </speech-to-text/docs/endpoints>`__ with matching
131-
``us`` or ``eu`` location value.
130+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
131+
with matching ``us`` or ``eu`` location value.
132132
"""
133133

134134
name = proto.Field(
@@ -151,8 +151,8 @@ class ListPhraseSetRequest(proto.Message):
151151
(US North America), and ``eu`` (Europe). If you are calling
152152
the ``speech.googleapis.com`` endpoint, use the ``global``
153153
location. To specify a region, use a `regional
154-
endpoint </speech-to-text/docs/endpoints>`__ with matching
155-
``us`` or ``eu`` location value.
154+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
155+
with matching ``us`` or ``eu`` location value.
156156
page_size (int):
157157
The maximum number of phrase sets to return.
158158
The service may return fewer than this value. If
@@ -239,8 +239,8 @@ class CreateCustomClassRequest(proto.Message):
239239
(US North America), and ``eu`` (Europe). If you are calling
240240
the ``speech.googleapis.com`` endpoint, use the ``global``
241241
location. To specify a region, use a `regional
242-
endpoint </speech-to-text/docs/endpoints>`__ with matching
243-
``us`` or ``eu`` location value.
242+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
243+
with matching ``us`` or ``eu`` location value.
244244
custom_class_id (str):
245245
Required. The ID to use for the custom class, which will
246246
become the final component of the custom class' resource
@@ -283,8 +283,8 @@ class UpdateCustomClassRequest(proto.Message):
283283
(US North America), and ``eu`` (Europe). If you are calling
284284
the ``speech.googleapis.com`` endpoint, use the ``global``
285285
location. To specify a region, use a `regional
286-
endpoint </speech-to-text/docs/endpoints>`__ with matching
287-
``us`` or ``eu`` location value.
286+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
287+
with matching ``us`` or ``eu`` location value.
288288
update_mask (google.protobuf.field_mask_pb2.FieldMask):
289289
The list of fields to be updated.
290290
"""
@@ -331,8 +331,8 @@ class ListCustomClassesRequest(proto.Message):
331331
(US North America), and ``eu`` (Europe). If you are calling
332332
the ``speech.googleapis.com`` endpoint, use the ``global``
333333
location. To specify a region, use a `regional
334-
endpoint </speech-to-text/docs/endpoints>`__ with matching
335-
``us`` or ``eu`` location value.
334+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
335+
with matching ``us`` or ``eu`` location value.
336336
page_size (int):
337337
The maximum number of custom classes to
338338
return. The service may return fewer than this
@@ -402,8 +402,8 @@ class DeleteCustomClassRequest(proto.Message):
402402
(US North America), and ``eu`` (Europe). If you are calling
403403
the ``speech.googleapis.com`` endpoint, use the ``global``
404404
location. To specify a region, use a `regional
405-
endpoint </speech-to-text/docs/endpoints>`__ with matching
406-
``us`` or ``eu`` location value.
405+
endpoint <https://cloud.google.com/speech-to-text/docs/endpoints>`__
406+
with matching ``us`` or ``eu`` location value.
407407
"""
408408

409409
name = proto.Field(

packages/google-cloud-python-speech/tests/unit/gapic/speech_v1/test_speech.py

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,24 @@ def test__get_default_mtls_endpoint():
8787

8888

8989
@pytest.mark.parametrize(
90-
"client_class",
90+
"client_class,transport_name",
9191
[
92-
SpeechClient,
93-
SpeechAsyncClient,
92+
(SpeechClient, "grpc"),
93+
(SpeechAsyncClient, "grpc_asyncio"),
9494
],
9595
)
96-
def test_speech_client_from_service_account_info(client_class):
96+
def test_speech_client_from_service_account_info(client_class, transport_name):
9797
creds = ga_credentials.AnonymousCredentials()
9898
with mock.patch.object(
9999
service_account.Credentials, "from_service_account_info"
100100
) as factory:
101101
factory.return_value = creds
102102
info = {"valid": True}
103-
client = client_class.from_service_account_info(info)
103+
client = client_class.from_service_account_info(info, transport=transport_name)
104104
assert client.transport._credentials == creds
105105
assert isinstance(client, client_class)
106106

107-
assert client.transport._host == "speech.googleapis.com:443"
107+
assert client.transport._host == ("speech.googleapis.com:443")
108108

109109

110110
@pytest.mark.parametrize(
@@ -131,27 +131,31 @@ def test_speech_client_service_account_always_use_jwt(transport_class, transport
131131

132132

133133
@pytest.mark.parametrize(
134-
"client_class",
134+
"client_class,transport_name",
135135
[
136-
SpeechClient,
137-
SpeechAsyncClient,
136+
(SpeechClient, "grpc"),
137+
(SpeechAsyncClient, "grpc_asyncio"),
138138
],
139139
)
140-
def test_speech_client_from_service_account_file(client_class):
140+
def test_speech_client_from_service_account_file(client_class, transport_name):
141141
creds = ga_credentials.AnonymousCredentials()
142142
with mock.patch.object(
143143
service_account.Credentials, "from_service_account_file"
144144
) as factory:
145145
factory.return_value = creds
146-
client = client_class.from_service_account_file("dummy/file/path.json")
146+
client = client_class.from_service_account_file(
147+
"dummy/file/path.json", transport=transport_name
148+
)
147149
assert client.transport._credentials == creds
148150
assert isinstance(client, client_class)
149151

150-
client = client_class.from_service_account_json("dummy/file/path.json")
152+
client = client_class.from_service_account_json(
153+
"dummy/file/path.json", transport=transport_name
154+
)
151155
assert client.transport._credentials == creds
152156
assert isinstance(client, client_class)
153157

154-
assert client.transport._host == "speech.googleapis.com:443"
158+
assert client.transport._host == ("speech.googleapis.com:443")
155159

156160

157161
def test_speech_client_get_transport_class():
@@ -1348,24 +1352,40 @@ def test_speech_grpc_transport_client_cert_source_for_mtls(transport_class):
13481352
)
13491353

13501354

1351-
def test_speech_host_no_port():
1355+
@pytest.mark.parametrize(
1356+
"transport_name",
1357+
[
1358+
"grpc",
1359+
"grpc_asyncio",
1360+
],
1361+
)
1362+
def test_speech_host_no_port(transport_name):
13521363
client = SpeechClient(
13531364
credentials=ga_credentials.AnonymousCredentials(),
13541365
client_options=client_options.ClientOptions(
13551366
api_endpoint="speech.googleapis.com"
13561367
),
1368+
transport=transport_name,
13571369
)
1358-
assert client.transport._host == "speech.googleapis.com:443"
1370+
assert client.transport._host == ("speech.googleapis.com:443")
13591371

13601372

1361-
def test_speech_host_with_port():
1373+
@pytest.mark.parametrize(
1374+
"transport_name",
1375+
[
1376+
"grpc",
1377+
"grpc_asyncio",
1378+
],
1379+
)
1380+
def test_speech_host_with_port(transport_name):
13621381
client = SpeechClient(
13631382
credentials=ga_credentials.AnonymousCredentials(),
13641383
client_options=client_options.ClientOptions(
13651384
api_endpoint="speech.googleapis.com:8000"
13661385
),
1386+
transport=transport_name,
13671387
)
1368-
assert client.transport._host == "speech.googleapis.com:8000"
1388+
assert client.transport._host == ("speech.googleapis.com:8000")
13691389

13701390

13711391
def test_speech_grpc_transport_channel():

0 commit comments

Comments
 (0)
0