16
16
from collections import OrderedDict
17
17
import functools
18
18
import re
19
- from typing import Dict , Optional , Sequence , Tuple , Type , Union
19
+ from typing import Dict , Mapping , Optional , Sequence , Tuple , Type , Union
20
20
import pkg_resources
21
21
22
22
from google .api_core .client_options import ClientOptions
@@ -229,7 +229,6 @@ async def list_insights(
229
229
recommender.*.list IAM permission for the specified insight
230
230
type.
231
231
232
-
233
232
.. code-block:: python
234
233
235
234
from google.cloud import recommender_v1
@@ -316,8 +315,7 @@ def sample_list_insights():
316
315
maximum = 60.0 ,
317
316
multiplier = 1.3 ,
318
317
predicate = retries .if_exception_type (
319
- core_exceptions .DeadlineExceeded ,
320
- core_exceptions .ServiceUnavailable ,
318
+ core_exceptions .GoogleAPICallError ,
321
319
),
322
320
deadline = 60.0 ,
323
321
),
@@ -363,7 +361,6 @@ async def get_insight(
363
361
r"""Gets the requested insight. Requires the recommender.*.get IAM
364
362
permission for the specified insight type.
365
363
366
-
367
364
.. code-block:: python
368
365
369
366
from google.cloud import recommender_v1
@@ -431,8 +428,7 @@ def sample_get_insight():
431
428
maximum = 60.0 ,
432
429
multiplier = 1.3 ,
433
430
predicate = retries .if_exception_type (
434
- core_exceptions .DeadlineExceeded ,
435
- core_exceptions .ServiceUnavailable ,
431
+ core_exceptions .GoogleAPICallError ,
436
432
),
437
433
deadline = 60.0 ,
438
434
),
@@ -462,9 +458,7 @@ async def mark_insight_accepted(
462
458
request : Union [recommender_service .MarkInsightAcceptedRequest , dict ] = None ,
463
459
* ,
464
460
name : str = None ,
465
- state_metadata : Sequence [
466
- recommender_service .MarkInsightAcceptedRequest .StateMetadataEntry
467
- ] = None ,
461
+ state_metadata : Mapping [str , str ] = None ,
468
462
etag : str = None ,
469
463
retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
470
464
timeout : float = None ,
@@ -479,7 +473,6 @@ async def mark_insight_accepted(
479
473
Requires the recommender.*.update IAM permission for the
480
474
specified insight.
481
475
482
-
483
476
.. code-block:: python
484
477
485
478
from google.cloud import recommender_v1
@@ -509,7 +502,7 @@ def sample_mark_insight_accepted():
509
502
This corresponds to the ``name`` field
510
503
on the ``request`` instance; if ``request`` is provided, this
511
504
should not be set.
512
- state_metadata (:class:`Sequence[google.cloud.recommender_v1.types.MarkInsightAcceptedRequest.StateMetadataEntry ]`):
505
+ state_metadata (:class:`Mapping[str, str ]`):
513
506
Optional. State properties user wish to include with
514
507
this state. Full replace of the current state_metadata.
515
508
@@ -598,7 +591,6 @@ async def list_recommendations(
598
591
the recommender.*.list IAM permission for the specified
599
592
recommender.
600
593
601
-
602
594
.. code-block:: python
603
595
604
596
from google.cloud import recommender_v1
@@ -713,8 +705,7 @@ def sample_list_recommendations():
713
705
maximum = 60.0 ,
714
706
multiplier = 1.3 ,
715
707
predicate = retries .if_exception_type (
716
- core_exceptions .DeadlineExceeded ,
717
- core_exceptions .ServiceUnavailable ,
708
+ core_exceptions .GoogleAPICallError ,
718
709
),
719
710
deadline = 60.0 ,
720
711
),
@@ -760,7 +751,6 @@ async def get_recommendation(
760
751
r"""Gets the requested recommendation. Requires the
761
752
recommender.*.get IAM permission for the specified recommender.
762
753
763
-
764
754
.. code-block:: python
765
755
766
756
from google.cloud import recommender_v1
@@ -829,8 +819,7 @@ def sample_get_recommendation():
829
819
maximum = 60.0 ,
830
820
multiplier = 1.3 ,
831
821
predicate = retries .if_exception_type (
832
- core_exceptions .DeadlineExceeded ,
833
- core_exceptions .ServiceUnavailable ,
822
+ core_exceptions .GoogleAPICallError ,
834
823
),
835
824
deadline = 60.0 ,
836
825
),
@@ -862,9 +851,7 @@ async def mark_recommendation_claimed(
862
851
] = None ,
863
852
* ,
864
853
name : str = None ,
865
- state_metadata : Sequence [
866
- recommender_service .MarkRecommendationClaimedRequest .StateMetadataEntry
867
- ] = None ,
854
+ state_metadata : Mapping [str , str ] = None ,
868
855
etag : str = None ,
869
856
retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
870
857
timeout : float = None ,
@@ -882,7 +869,6 @@ async def mark_recommendation_claimed(
882
869
Requires the recommender.*.update IAM permission for the
883
870
specified recommender.
884
871
885
-
886
872
.. code-block:: python
887
873
888
874
from google.cloud import recommender_v1
@@ -912,7 +898,7 @@ def sample_mark_recommendation_claimed():
912
898
This corresponds to the ``name`` field
913
899
on the ``request`` instance; if ``request`` is provided, this
914
900
should not be set.
915
- state_metadata (:class:`Sequence[google.cloud.recommender_v1.types.MarkRecommendationClaimedRequest.StateMetadataEntry ]`):
901
+ state_metadata (:class:`Mapping[str, str ]`):
916
902
State properties to include with this state. Overwrites
917
903
any existing ``state_metadata``. Keys must match the
918
904
regex ``/^[a-z0-9][a-z0-9_.-]{0,62}$/``. Values must
@@ -997,9 +983,7 @@ async def mark_recommendation_succeeded(
997
983
] = None ,
998
984
* ,
999
985
name : str = None ,
1000
- state_metadata : Sequence [
1001
- recommender_service .MarkRecommendationSucceededRequest .StateMetadataEntry
1002
- ] = None ,
986
+ state_metadata : Mapping [str , str ] = None ,
1003
987
etag : str = None ,
1004
988
retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
1005
989
timeout : float = None ,
@@ -1017,7 +1001,6 @@ async def mark_recommendation_succeeded(
1017
1001
Requires the recommender.*.update IAM permission for the
1018
1002
specified recommender.
1019
1003
1020
-
1021
1004
.. code-block:: python
1022
1005
1023
1006
from google.cloud import recommender_v1
@@ -1047,7 +1030,7 @@ def sample_mark_recommendation_succeeded():
1047
1030
This corresponds to the ``name`` field
1048
1031
on the ``request`` instance; if ``request`` is provided, this
1049
1032
should not be set.
1050
- state_metadata (:class:`Sequence[google.cloud.recommender_v1.types.MarkRecommendationSucceededRequest.StateMetadataEntry ]`):
1033
+ state_metadata (:class:`Mapping[str, str ]`):
1051
1034
State properties to include with this state. Overwrites
1052
1035
any existing ``state_metadata``. Keys must match the
1053
1036
regex ``/^[a-z0-9][a-z0-9_.-]{0,62}$/``. Values must
@@ -1132,9 +1115,7 @@ async def mark_recommendation_failed(
1132
1115
] = None ,
1133
1116
* ,
1134
1117
name : str = None ,
1135
- state_metadata : Sequence [
1136
- recommender_service .MarkRecommendationFailedRequest .StateMetadataEntry
1137
- ] = None ,
1118
+ state_metadata : Mapping [str , str ] = None ,
1138
1119
etag : str = None ,
1139
1120
retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
1140
1121
timeout : float = None ,
@@ -1152,7 +1133,6 @@ async def mark_recommendation_failed(
1152
1133
Requires the recommender.*.update IAM permission for the
1153
1134
specified recommender.
1154
1135
1155
-
1156
1136
.. code-block:: python
1157
1137
1158
1138
from google.cloud import recommender_v1
@@ -1182,7 +1162,7 @@ def sample_mark_recommendation_failed():
1182
1162
This corresponds to the ``name`` field
1183
1163
on the ``request`` instance; if ``request`` is provided, this
1184
1164
should not be set.
1185
- state_metadata (:class:`Sequence[google.cloud.recommender_v1.types.MarkRecommendationFailedRequest.StateMetadataEntry ]`):
1165
+ state_metadata (:class:`Mapping[str, str ]`):
1186
1166
State properties to include with this state. Overwrites
1187
1167
any existing ``state_metadata``. Keys must match the
1188
1168
regex ``/^[a-z0-9][a-z0-9_.-]{0,62}$/``. Values must
0 commit comments