19
19
from typing import Dict , Sequence , Tuple , Type , Union
20
20
import pkg_resources
21
21
22
- import google .api_core .client_options as ClientOptions # type: ignore
22
+ from google .api_core .client_options import ClientOptions # type: ignore
23
23
from google .api_core import exceptions as core_exceptions # type: ignore
24
24
from google .api_core import gapic_v1 # type: ignore
25
25
from google .api_core import retry as retries # type: ignore
26
26
from google .auth import credentials as ga_credentials # type: ignore
27
27
from google .oauth2 import service_account # type: ignore
28
28
29
+ OptionalRetry = Union [retries .Retry , object ]
30
+
29
31
from google .cloud .billing_v1 .services .cloud_billing import pagers
30
32
from google .cloud .billing_v1 .types import cloud_billing
31
33
from google .iam .v1 import iam_policy_pb2 # type: ignore
@@ -161,10 +163,10 @@ def __init__(
161
163
162
164
async def get_billing_account (
163
165
self ,
164
- request : cloud_billing .GetBillingAccountRequest = None ,
166
+ request : Union [ cloud_billing .GetBillingAccountRequest , dict ] = None ,
165
167
* ,
166
168
name : str = None ,
167
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
169
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
168
170
timeout : float = None ,
169
171
metadata : Sequence [Tuple [str , str ]] = (),
170
172
) -> cloud_billing .BillingAccount :
@@ -173,7 +175,7 @@ async def get_billing_account(
173
175
account <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
174
176
175
177
Args:
176
- request (:class:` google.cloud.billing_v1.types.GetBillingAccountRequest` ):
178
+ request (Union[ google.cloud.billing_v1.types.GetBillingAccountRequest, dict] ):
177
179
The request object. Request message for
178
180
`GetBillingAccount`.
179
181
name (:class:`str`):
@@ -246,9 +248,9 @@ async def get_billing_account(
246
248
247
249
async def list_billing_accounts (
248
250
self ,
249
- request : cloud_billing .ListBillingAccountsRequest = None ,
251
+ request : Union [ cloud_billing .ListBillingAccountsRequest , dict ] = None ,
250
252
* ,
251
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
253
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
252
254
timeout : float = None ,
253
255
metadata : Sequence [Tuple [str , str ]] = (),
254
256
) -> pagers .ListBillingAccountsAsyncPager :
@@ -257,7 +259,7 @@ async def list_billing_accounts(
257
259
`view <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
258
260
259
261
Args:
260
- request (:class:` google.cloud.billing_v1.types.ListBillingAccountsRequest` ):
262
+ request (Union[ google.cloud.billing_v1.types.ListBillingAccountsRequest, dict] ):
261
263
The request object. Request message for
262
264
`ListBillingAccounts`.
263
265
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -309,11 +311,11 @@ async def list_billing_accounts(
309
311
310
312
async def update_billing_account (
311
313
self ,
312
- request : cloud_billing .UpdateBillingAccountRequest = None ,
314
+ request : Union [ cloud_billing .UpdateBillingAccountRequest , dict ] = None ,
313
315
* ,
314
316
name : str = None ,
315
317
account : cloud_billing .BillingAccount = None ,
316
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
318
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
317
319
timeout : float = None ,
318
320
metadata : Sequence [Tuple [str , str ]] = (),
319
321
) -> cloud_billing .BillingAccount :
@@ -325,7 +327,7 @@ async def update_billing_account(
325
327
of the billing account.
326
328
327
329
Args:
328
- request (:class:` google.cloud.billing_v1.types.UpdateBillingAccountRequest` ):
330
+ request (Union[ google.cloud.billing_v1.types.UpdateBillingAccountRequest, dict] ):
329
331
The request object. Request message for
330
332
`UpdateBillingAccount`.
331
333
name (:class:`str`):
@@ -407,10 +409,10 @@ async def update_billing_account(
407
409
408
410
async def create_billing_account (
409
411
self ,
410
- request : cloud_billing .CreateBillingAccountRequest = None ,
412
+ request : Union [ cloud_billing .CreateBillingAccountRequest , dict ] = None ,
411
413
* ,
412
414
billing_account : cloud_billing .BillingAccount = None ,
413
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
415
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
414
416
timeout : float = None ,
415
417
metadata : Sequence [Tuple [str , str ]] = (),
416
418
) -> cloud_billing .BillingAccount :
@@ -426,7 +428,7 @@ async def create_billing_account(
426
428
been provisioned as a reseller account.
427
429
428
430
Args:
429
- request (:class:` google.cloud.billing_v1.types.CreateBillingAccountRequest` ):
431
+ request (Union[ google.cloud.billing_v1.types.CreateBillingAccountRequest, dict] ):
430
432
The request object. Request message for
431
433
`CreateBillingAccount`.
432
434
billing_account (:class:`google.cloud.billing_v1.types.BillingAccount`):
@@ -486,10 +488,10 @@ async def create_billing_account(
486
488
487
489
async def list_project_billing_info (
488
490
self ,
489
- request : cloud_billing .ListProjectBillingInfoRequest = None ,
491
+ request : Union [ cloud_billing .ListProjectBillingInfoRequest , dict ] = None ,
490
492
* ,
491
493
name : str = None ,
492
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
494
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
493
495
timeout : float = None ,
494
496
metadata : Sequence [Tuple [str , str ]] = (),
495
497
) -> pagers .ListProjectBillingInfoAsyncPager :
@@ -500,7 +502,7 @@ async def list_project_billing_info(
500
502
`viewers <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
501
503
502
504
Args:
503
- request (:class:` google.cloud.billing_v1.types.ListProjectBillingInfoRequest` ):
505
+ request (Union[ google.cloud.billing_v1.types.ListProjectBillingInfoRequest, dict] ):
504
506
The request object. Request message for
505
507
`ListProjectBillingInfo`.
506
508
name (:class:`str`):
@@ -580,10 +582,10 @@ async def list_project_billing_info(
580
582
581
583
async def get_project_billing_info (
582
584
self ,
583
- request : cloud_billing .GetProjectBillingInfoRequest = None ,
585
+ request : Union [ cloud_billing .GetProjectBillingInfoRequest , dict ] = None ,
584
586
* ,
585
587
name : str = None ,
586
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
588
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
587
589
timeout : float = None ,
588
590
metadata : Sequence [Tuple [str , str ]] = (),
589
591
) -> cloud_billing .ProjectBillingInfo :
@@ -592,7 +594,7 @@ async def get_project_billing_info(
592
594
project <https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo>`__.
593
595
594
596
Args:
595
- request (:class:` google.cloud.billing_v1.types.GetProjectBillingInfoRequest` ):
597
+ request (Union[ google.cloud.billing_v1.types.GetProjectBillingInfoRequest, dict] ):
596
598
The request object. Request message for
597
599
`GetProjectBillingInfo`.
598
600
name (:class:`str`):
@@ -667,11 +669,11 @@ async def get_project_billing_info(
667
669
668
670
async def update_project_billing_info (
669
671
self ,
670
- request : cloud_billing .UpdateProjectBillingInfoRequest = None ,
672
+ request : Union [ cloud_billing .UpdateProjectBillingInfoRequest , dict ] = None ,
671
673
* ,
672
674
name : str = None ,
673
675
project_billing_info : cloud_billing .ProjectBillingInfo = None ,
674
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
676
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
675
677
timeout : float = None ,
676
678
metadata : Sequence [Tuple [str , str ]] = (),
677
679
) -> cloud_billing .ProjectBillingInfo :
@@ -713,7 +715,7 @@ async def update_project_billing_info(
713
715
account.
714
716
715
717
Args:
716
- request (:class:` google.cloud.billing_v1.types.UpdateProjectBillingInfoRequest` ):
718
+ request (Union[ google.cloud.billing_v1.types.UpdateProjectBillingInfoRequest, dict] ):
717
719
The request object. Request message for
718
720
`UpdateProjectBillingInfo`.
719
721
name (:class:`str`):
@@ -798,10 +800,10 @@ async def update_project_billing_info(
798
800
799
801
async def get_iam_policy (
800
802
self ,
801
- request : iam_policy_pb2 .GetIamPolicyRequest = None ,
803
+ request : Union [ iam_policy_pb2 .GetIamPolicyRequest , dict ] = None ,
802
804
* ,
803
805
resource : str = None ,
804
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
806
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
805
807
timeout : float = None ,
806
808
metadata : Sequence [Tuple [str , str ]] = (),
807
809
) -> policy_pb2 .Policy :
@@ -811,7 +813,7 @@ async def get_iam_policy(
811
813
`viewers <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
812
814
813
815
Args:
814
- request (:class:` google.iam.v1.iam_policy_pb2.GetIamPolicyRequest` ):
816
+ request (Union[ google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict] ):
815
817
The request object. Request message for `GetIamPolicy`
816
818
method.
817
819
resource (:class:`str`):
@@ -937,10 +939,10 @@ async def get_iam_policy(
937
939
938
940
async def set_iam_policy (
939
941
self ,
940
- request : iam_policy_pb2 .SetIamPolicyRequest = None ,
942
+ request : Union [ iam_policy_pb2 .SetIamPolicyRequest , dict ] = None ,
941
943
* ,
942
944
resource : str = None ,
943
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
945
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
944
946
timeout : float = None ,
945
947
metadata : Sequence [Tuple [str , str ]] = (),
946
948
) -> policy_pb2 .Policy :
@@ -951,7 +953,7 @@ async def set_iam_policy(
951
953
`administrators <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
952
954
953
955
Args:
954
- request (:class:` google.iam.v1.iam_policy_pb2.SetIamPolicyRequest` ):
956
+ request (Union[ google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict] ):
955
957
The request object. Request message for `SetIamPolicy`
956
958
method.
957
959
resource (:class:`str`):
@@ -1077,11 +1079,11 @@ async def set_iam_policy(
1077
1079
1078
1080
async def test_iam_permissions (
1079
1081
self ,
1080
- request : iam_policy_pb2 .TestIamPermissionsRequest = None ,
1082
+ request : Union [ iam_policy_pb2 .TestIamPermissionsRequest , dict ] = None ,
1081
1083
* ,
1082
1084
resource : str = None ,
1083
1085
permissions : Sequence [str ] = None ,
1084
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
1086
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
1085
1087
timeout : float = None ,
1086
1088
metadata : Sequence [Tuple [str , str ]] = (),
1087
1089
) -> iam_policy_pb2 .TestIamPermissionsResponse :
@@ -1092,7 +1094,7 @@ async def test_iam_permissions(
1092
1094
resource.
1093
1095
1094
1096
Args:
1095
- request (:class:` google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest` ):
1097
+ request (Union[ google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict] ):
1096
1098
The request object. Request message for
1097
1099
`TestIamPermissions` method.
1098
1100
resource (:class:`str`):
0 commit comments