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 .api_core import operation # type: ignore
3032from google .api_core import operation_async # type: ignore
3133from google .cloud .functions_v1 .services .cloud_functions_service import pagers
@@ -178,17 +180,17 @@ def __init__(
178180
179181 async def list_functions (
180182 self ,
181- request : functions .ListFunctionsRequest = None ,
183+ request : Union [ functions .ListFunctionsRequest , dict ] = None ,
182184 * ,
183- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
185+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
184186 timeout : float = None ,
185187 metadata : Sequence [Tuple [str , str ]] = (),
186188 ) -> pagers .ListFunctionsAsyncPager :
187189 r"""Returns a list of functions that belong to the
188190 requested project.
189191
190192 Args:
191- request (:class:` google.cloud.functions_v1.types.ListFunctionsRequest` ):
193+ request (Union[ google.cloud.functions_v1.types.ListFunctionsRequest, dict] ):
192194 The request object. Request for the `ListFunctions`
193195 method.
194196 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -246,18 +248,18 @@ async def list_functions(
246248
247249 async def get_function (
248250 self ,
249- request : functions .GetFunctionRequest = None ,
251+ request : Union [ functions .GetFunctionRequest , dict ] = None ,
250252 * ,
251253 name : str = None ,
252- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
254+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
253255 timeout : float = None ,
254256 metadata : Sequence [Tuple [str , str ]] = (),
255257 ) -> functions .CloudFunction :
256258 r"""Returns a function with the given name from the
257259 requested project.
258260
259261 Args:
260- request (:class:` google.cloud.functions_v1.types.GetFunctionRequest` ):
262+ request (Union[ google.cloud.functions_v1.types.GetFunctionRequest, dict] ):
261263 The request object. Request for the `GetFunction`
262264 method.
263265 name (:class:`str`):
@@ -330,11 +332,11 @@ async def get_function(
330332
331333 async def create_function (
332334 self ,
333- request : functions .CreateFunctionRequest = None ,
335+ request : Union [ functions .CreateFunctionRequest , dict ] = None ,
334336 * ,
335337 location : str = None ,
336338 function : functions .CloudFunction = None ,
337- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
339+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
338340 timeout : float = None ,
339341 metadata : Sequence [Tuple [str , str ]] = (),
340342 ) -> operation_async .AsyncOperation :
@@ -343,7 +345,7 @@ async def create_function(
343345 operation will return ``ALREADY_EXISTS`` error.
344346
345347 Args:
346- request (:class:` google.cloud.functions_v1.types.CreateFunctionRequest` ):
348+ request (Union[ google.cloud.functions_v1.types.CreateFunctionRequest, dict] ):
347349 The request object. Request for the `CreateFunction`
348350 method.
349351 location (:class:`str`):
@@ -423,17 +425,17 @@ async def create_function(
423425
424426 async def update_function (
425427 self ,
426- request : functions .UpdateFunctionRequest = None ,
428+ request : Union [ functions .UpdateFunctionRequest , dict ] = None ,
427429 * ,
428430 function : functions .CloudFunction = None ,
429- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
431+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
430432 timeout : float = None ,
431433 metadata : Sequence [Tuple [str , str ]] = (),
432434 ) -> operation_async .AsyncOperation :
433435 r"""Updates existing function.
434436
435437 Args:
436- request (:class:` google.cloud.functions_v1.types.UpdateFunctionRequest` ):
438+ request (Union[ google.cloud.functions_v1.types.UpdateFunctionRequest, dict] ):
437439 The request object. Request for the `UpdateFunction`
438440 method.
439441 function (:class:`google.cloud.functions_v1.types.CloudFunction`):
@@ -517,10 +519,10 @@ async def update_function(
517519
518520 async def delete_function (
519521 self ,
520- request : functions .DeleteFunctionRequest = None ,
522+ request : Union [ functions .DeleteFunctionRequest , dict ] = None ,
521523 * ,
522524 name : str = None ,
523- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
525+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
524526 timeout : float = None ,
525527 metadata : Sequence [Tuple [str , str ]] = (),
526528 ) -> operation_async .AsyncOperation :
@@ -530,7 +532,7 @@ async def delete_function(
530532 function.
531533
532534 Args:
533- request (:class:` google.cloud.functions_v1.types.DeleteFunctionRequest` ):
535+ request (Union[ google.cloud.functions_v1.types.DeleteFunctionRequest, dict] ):
534536 The request object. Request for the `DeleteFunction`
535537 method.
536538 name (:class:`str`):
@@ -622,11 +624,11 @@ async def delete_function(
622624
623625 async def call_function (
624626 self ,
625- request : functions .CallFunctionRequest = None ,
627+ request : Union [ functions .CallFunctionRequest , dict ] = None ,
626628 * ,
627629 name : str = None ,
628630 data : str = None ,
629- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
631+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
630632 timeout : float = None ,
631633 metadata : Sequence [Tuple [str , str ]] = (),
632634 ) -> functions .CallFunctionResponse :
@@ -636,7 +638,7 @@ async def call_function(
636638 Limits <https://cloud.google.com/functions/quotas#rate_limits>`__.
637639
638640 Args:
639- request (:class:` google.cloud.functions_v1.types.CallFunctionRequest` ):
641+ request (Union[ google.cloud.functions_v1.types.CallFunctionRequest, dict] ):
640642 The request object. Request for the `CallFunction`
641643 method.
642644 name (:class:`str`):
@@ -704,9 +706,9 @@ async def call_function(
704706
705707 async def generate_upload_url (
706708 self ,
707- request : functions .GenerateUploadUrlRequest = None ,
709+ request : Union [ functions .GenerateUploadUrlRequest , dict ] = None ,
708710 * ,
709- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
711+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
710712 timeout : float = None ,
711713 metadata : Sequence [Tuple [str , str ]] = (),
712714 ) -> functions .GenerateUploadUrlResponse :
@@ -740,7 +742,7 @@ async def generate_upload_url(
740742 - ``Authorization: Bearer YOUR_TOKEN``
741743
742744 Args:
743- request (:class:` google.cloud.functions_v1.types.GenerateUploadUrlRequest` ):
745+ request (Union[ google.cloud.functions_v1.types.GenerateUploadUrlRequest, dict] ):
744746 The request object. Request of `GenerateSourceUploadUrl`
745747 method.
746748 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -778,9 +780,9 @@ async def generate_upload_url(
778780
779781 async def generate_download_url (
780782 self ,
781- request : functions .GenerateDownloadUrlRequest = None ,
783+ request : Union [ functions .GenerateDownloadUrlRequest , dict ] = None ,
782784 * ,
783- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
785+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
784786 timeout : float = None ,
785787 metadata : Sequence [Tuple [str , str ]] = (),
786788 ) -> functions .GenerateDownloadUrlResponse :
@@ -793,7 +795,7 @@ async def generate_download_url(
793795 control/signed-urls
794796
795797 Args:
796- request (:class:` google.cloud.functions_v1.types.GenerateDownloadUrlRequest` ):
798+ request (Union[ google.cloud.functions_v1.types.GenerateDownloadUrlRequest, dict] ):
797799 The request object. Request of `GenerateDownloadUrl`
798800 method.
799801 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -831,17 +833,17 @@ async def generate_download_url(
831833
832834 async def set_iam_policy (
833835 self ,
834- request : iam_policy_pb2 .SetIamPolicyRequest = None ,
836+ request : Union [ iam_policy_pb2 .SetIamPolicyRequest , dict ] = None ,
835837 * ,
836- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
838+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
837839 timeout : float = None ,
838840 metadata : Sequence [Tuple [str , str ]] = (),
839841 ) -> policy_pb2 .Policy :
840842 r"""Sets the IAM access control policy on the specified
841843 function. Replaces any existing policy.
842844
843845 Args:
844- request (:class:` google.iam.v1.iam_policy_pb2.SetIamPolicyRequest` ):
846+ request (Union[ google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict] ):
845847 The request object. Request message for `SetIamPolicy`
846848 method.
847849 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -937,9 +939,9 @@ async def set_iam_policy(
937939
938940 async def get_iam_policy (
939941 self ,
940- request : iam_policy_pb2 .GetIamPolicyRequest = None ,
942+ request : Union [ iam_policy_pb2 .GetIamPolicyRequest , dict ] = None ,
941943 * ,
942- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
944+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
943945 timeout : float = None ,
944946 metadata : Sequence [Tuple [str , str ]] = (),
945947 ) -> policy_pb2 .Policy :
@@ -948,7 +950,7 @@ async def get_iam_policy(
948950 not have a policy set.
949951
950952 Args:
951- request (:class:` google.iam.v1.iam_policy_pb2.GetIamPolicyRequest` ):
953+ request (Union[ google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict] ):
952954 The request object. Request message for `GetIamPolicy`
953955 method.
954956 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -1044,9 +1046,9 @@ async def get_iam_policy(
10441046
10451047 async def test_iam_permissions (
10461048 self ,
1047- request : iam_policy_pb2 .TestIamPermissionsRequest = None ,
1049+ request : Union [ iam_policy_pb2 .TestIamPermissionsRequest , dict ] = None ,
10481050 * ,
1049- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
1051+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
10501052 timeout : float = None ,
10511053 metadata : Sequence [Tuple [str , str ]] = (),
10521054 ) -> iam_policy_pb2 .TestIamPermissionsResponse :
@@ -1055,7 +1057,7 @@ async def test_iam_permissions(
10551057 return an empty set of permissions, not a NOT_FOUND error.
10561058
10571059 Args:
1058- request (:class:` google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest` ):
1060+ request (Union[ google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict] ):
10591061 The request object. Request message for
10601062 `TestIamPermissions` method.
10611063 retry (google.api_core.retry.Retry): Designation of what errors, if any,
0 commit comments