1919from typing import Dict , Sequence , Tuple , Type , Union
2020import pkg_resources
2121
22- import google .api_core .client_options as ClientOptions # type: ignore
22+ from google .api_core .client_options import ClientOptions # type: ignore
2323from google .api_core import exceptions as core_exceptions # type: ignore
2424from google .api_core import gapic_v1 # type: ignore
2525from google .api_core import retry as retries # type: ignore
2626from google .auth import credentials as ga_credentials # type: ignore
2727from google .oauth2 import service_account # type: ignore
2828
29+ OptionalRetry = Union [retries .Retry , object ]
30+
2931from google .cloud .billing_v1 .services .cloud_billing import pagers
3032from google .cloud .billing_v1 .types import cloud_billing
3133from google .iam .v1 import iam_policy_pb2 # type: ignore
@@ -161,10 +163,10 @@ def __init__(
161163
162164 async def get_billing_account (
163165 self ,
164- request : cloud_billing .GetBillingAccountRequest = None ,
166+ request : Union [ cloud_billing .GetBillingAccountRequest , dict ] = None ,
165167 * ,
166168 name : str = None ,
167- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
169+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
168170 timeout : float = None ,
169171 metadata : Sequence [Tuple [str , str ]] = (),
170172 ) -> cloud_billing .BillingAccount :
@@ -173,7 +175,7 @@ async def get_billing_account(
173175 account <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
174176
175177 Args:
176- request (:class:` google.cloud.billing_v1.types.GetBillingAccountRequest` ):
178+ request (Union[ google.cloud.billing_v1.types.GetBillingAccountRequest, dict] ):
177179 The request object. Request message for
178180 `GetBillingAccount`.
179181 name (:class:`str`):
@@ -246,9 +248,9 @@ async def get_billing_account(
246248
247249 async def list_billing_accounts (
248250 self ,
249- request : cloud_billing .ListBillingAccountsRequest = None ,
251+ request : Union [ cloud_billing .ListBillingAccountsRequest , dict ] = None ,
250252 * ,
251- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
253+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
252254 timeout : float = None ,
253255 metadata : Sequence [Tuple [str , str ]] = (),
254256 ) -> pagers .ListBillingAccountsAsyncPager :
@@ -257,7 +259,7 @@ async def list_billing_accounts(
257259 `view <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
258260
259261 Args:
260- request (:class:` google.cloud.billing_v1.types.ListBillingAccountsRequest` ):
262+ request (Union[ google.cloud.billing_v1.types.ListBillingAccountsRequest, dict] ):
261263 The request object. Request message for
262264 `ListBillingAccounts`.
263265 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -309,11 +311,11 @@ async def list_billing_accounts(
309311
310312 async def update_billing_account (
311313 self ,
312- request : cloud_billing .UpdateBillingAccountRequest = None ,
314+ request : Union [ cloud_billing .UpdateBillingAccountRequest , dict ] = None ,
313315 * ,
314316 name : str = None ,
315317 account : cloud_billing .BillingAccount = None ,
316- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
318+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
317319 timeout : float = None ,
318320 metadata : Sequence [Tuple [str , str ]] = (),
319321 ) -> cloud_billing .BillingAccount :
@@ -325,7 +327,7 @@ async def update_billing_account(
325327 of the billing account.
326328
327329 Args:
328- request (:class:` google.cloud.billing_v1.types.UpdateBillingAccountRequest` ):
330+ request (Union[ google.cloud.billing_v1.types.UpdateBillingAccountRequest, dict] ):
329331 The request object. Request message for
330332 `UpdateBillingAccount`.
331333 name (:class:`str`):
@@ -407,10 +409,10 @@ async def update_billing_account(
407409
408410 async def create_billing_account (
409411 self ,
410- request : cloud_billing .CreateBillingAccountRequest = None ,
412+ request : Union [ cloud_billing .CreateBillingAccountRequest , dict ] = None ,
411413 * ,
412414 billing_account : cloud_billing .BillingAccount = None ,
413- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
415+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
414416 timeout : float = None ,
415417 metadata : Sequence [Tuple [str , str ]] = (),
416418 ) -> cloud_billing .BillingAccount :
@@ -426,7 +428,7 @@ async def create_billing_account(
426428 been provisioned as a reseller account.
427429
428430 Args:
429- request (:class:` google.cloud.billing_v1.types.CreateBillingAccountRequest` ):
431+ request (Union[ google.cloud.billing_v1.types.CreateBillingAccountRequest, dict] ):
430432 The request object. Request message for
431433 `CreateBillingAccount`.
432434 billing_account (:class:`google.cloud.billing_v1.types.BillingAccount`):
@@ -486,10 +488,10 @@ async def create_billing_account(
486488
487489 async def list_project_billing_info (
488490 self ,
489- request : cloud_billing .ListProjectBillingInfoRequest = None ,
491+ request : Union [ cloud_billing .ListProjectBillingInfoRequest , dict ] = None ,
490492 * ,
491493 name : str = None ,
492- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
494+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
493495 timeout : float = None ,
494496 metadata : Sequence [Tuple [str , str ]] = (),
495497 ) -> pagers .ListProjectBillingInfoAsyncPager :
@@ -500,7 +502,7 @@ async def list_project_billing_info(
500502 `viewers <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
501503
502504 Args:
503- request (:class:` google.cloud.billing_v1.types.ListProjectBillingInfoRequest` ):
505+ request (Union[ google.cloud.billing_v1.types.ListProjectBillingInfoRequest, dict] ):
504506 The request object. Request message for
505507 `ListProjectBillingInfo`.
506508 name (:class:`str`):
@@ -580,10 +582,10 @@ async def list_project_billing_info(
580582
581583 async def get_project_billing_info (
582584 self ,
583- request : cloud_billing .GetProjectBillingInfoRequest = None ,
585+ request : Union [ cloud_billing .GetProjectBillingInfoRequest , dict ] = None ,
584586 * ,
585587 name : str = None ,
586- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
588+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
587589 timeout : float = None ,
588590 metadata : Sequence [Tuple [str , str ]] = (),
589591 ) -> cloud_billing .ProjectBillingInfo :
@@ -592,7 +594,7 @@ async def get_project_billing_info(
592594 project <https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo>`__.
593595
594596 Args:
595- request (:class:` google.cloud.billing_v1.types.GetProjectBillingInfoRequest` ):
597+ request (Union[ google.cloud.billing_v1.types.GetProjectBillingInfoRequest, dict] ):
596598 The request object. Request message for
597599 `GetProjectBillingInfo`.
598600 name (:class:`str`):
@@ -667,11 +669,11 @@ async def get_project_billing_info(
667669
668670 async def update_project_billing_info (
669671 self ,
670- request : cloud_billing .UpdateProjectBillingInfoRequest = None ,
672+ request : Union [ cloud_billing .UpdateProjectBillingInfoRequest , dict ] = None ,
671673 * ,
672674 name : str = None ,
673675 project_billing_info : cloud_billing .ProjectBillingInfo = None ,
674- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
676+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
675677 timeout : float = None ,
676678 metadata : Sequence [Tuple [str , str ]] = (),
677679 ) -> cloud_billing .ProjectBillingInfo :
@@ -713,7 +715,7 @@ async def update_project_billing_info(
713715 account.
714716
715717 Args:
716- request (:class:` google.cloud.billing_v1.types.UpdateProjectBillingInfoRequest` ):
718+ request (Union[ google.cloud.billing_v1.types.UpdateProjectBillingInfoRequest, dict] ):
717719 The request object. Request message for
718720 `UpdateProjectBillingInfo`.
719721 name (:class:`str`):
@@ -798,10 +800,10 @@ async def update_project_billing_info(
798800
799801 async def get_iam_policy (
800802 self ,
801- request : iam_policy_pb2 .GetIamPolicyRequest = None ,
803+ request : Union [ iam_policy_pb2 .GetIamPolicyRequest , dict ] = None ,
802804 * ,
803805 resource : str = None ,
804- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
806+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
805807 timeout : float = None ,
806808 metadata : Sequence [Tuple [str , str ]] = (),
807809 ) -> policy_pb2 .Policy :
@@ -811,7 +813,7 @@ async def get_iam_policy(
811813 `viewers <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
812814
813815 Args:
814- request (:class:` google.iam.v1.iam_policy_pb2.GetIamPolicyRequest` ):
816+ request (Union[ google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict] ):
815817 The request object. Request message for `GetIamPolicy`
816818 method.
817819 resource (:class:`str`):
@@ -937,10 +939,10 @@ async def get_iam_policy(
937939
938940 async def set_iam_policy (
939941 self ,
940- request : iam_policy_pb2 .SetIamPolicyRequest = None ,
942+ request : Union [ iam_policy_pb2 .SetIamPolicyRequest , dict ] = None ,
941943 * ,
942944 resource : str = None ,
943- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
945+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
944946 timeout : float = None ,
945947 metadata : Sequence [Tuple [str , str ]] = (),
946948 ) -> policy_pb2 .Policy :
@@ -951,7 +953,7 @@ async def set_iam_policy(
951953 `administrators <https://cloud.google.com/billing/docs/how-to/billing-access>`__.
952954
953955 Args:
954- request (:class:` google.iam.v1.iam_policy_pb2.SetIamPolicyRequest` ):
956+ request (Union[ google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict] ):
955957 The request object. Request message for `SetIamPolicy`
956958 method.
957959 resource (:class:`str`):
@@ -1077,11 +1079,11 @@ async def set_iam_policy(
10771079
10781080 async def test_iam_permissions (
10791081 self ,
1080- request : iam_policy_pb2 .TestIamPermissionsRequest = None ,
1082+ request : Union [ iam_policy_pb2 .TestIamPermissionsRequest , dict ] = None ,
10811083 * ,
10821084 resource : str = None ,
10831085 permissions : Sequence [str ] = None ,
1084- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
1086+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
10851087 timeout : float = None ,
10861088 metadata : Sequence [Tuple [str , str ]] = (),
10871089 ) -> iam_policy_pb2 .TestIamPermissionsResponse :
@@ -1092,7 +1094,7 @@ async def test_iam_permissions(
10921094 resource.
10931095
10941096 Args:
1095- request (:class:` google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest` ):
1097+ request (Union[ google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict] ):
10961098 The request object. Request message for
10971099 `TestIamPermissions` method.
10981100 resource (:class:`str`):
0 commit comments