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 .api_core import operation # type: ignore
30
32
from google .api_core import operation_async # type: ignore
31
33
from google .cloud .functions_v1 .services .cloud_functions_service import pagers
@@ -178,17 +180,17 @@ def __init__(
178
180
179
181
async def list_functions (
180
182
self ,
181
- request : functions .ListFunctionsRequest = None ,
183
+ request : Union [ functions .ListFunctionsRequest , dict ] = None ,
182
184
* ,
183
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
185
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
184
186
timeout : float = None ,
185
187
metadata : Sequence [Tuple [str , str ]] = (),
186
188
) -> pagers .ListFunctionsAsyncPager :
187
189
r"""Returns a list of functions that belong to the
188
190
requested project.
189
191
190
192
Args:
191
- request (:class:` google.cloud.functions_v1.types.ListFunctionsRequest` ):
193
+ request (Union[ google.cloud.functions_v1.types.ListFunctionsRequest, dict] ):
192
194
The request object. Request for the `ListFunctions`
193
195
method.
194
196
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -246,18 +248,18 @@ async def list_functions(
246
248
247
249
async def get_function (
248
250
self ,
249
- request : functions .GetFunctionRequest = None ,
251
+ request : Union [ functions .GetFunctionRequest , dict ] = None ,
250
252
* ,
251
253
name : str = None ,
252
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
254
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
253
255
timeout : float = None ,
254
256
metadata : Sequence [Tuple [str , str ]] = (),
255
257
) -> functions .CloudFunction :
256
258
r"""Returns a function with the given name from the
257
259
requested project.
258
260
259
261
Args:
260
- request (:class:` google.cloud.functions_v1.types.GetFunctionRequest` ):
262
+ request (Union[ google.cloud.functions_v1.types.GetFunctionRequest, dict] ):
261
263
The request object. Request for the `GetFunction`
262
264
method.
263
265
name (:class:`str`):
@@ -330,11 +332,11 @@ async def get_function(
330
332
331
333
async def create_function (
332
334
self ,
333
- request : functions .CreateFunctionRequest = None ,
335
+ request : Union [ functions .CreateFunctionRequest , dict ] = None ,
334
336
* ,
335
337
location : str = None ,
336
338
function : functions .CloudFunction = None ,
337
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
339
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
338
340
timeout : float = None ,
339
341
metadata : Sequence [Tuple [str , str ]] = (),
340
342
) -> operation_async .AsyncOperation :
@@ -343,7 +345,7 @@ async def create_function(
343
345
operation will return ``ALREADY_EXISTS`` error.
344
346
345
347
Args:
346
- request (:class:` google.cloud.functions_v1.types.CreateFunctionRequest` ):
348
+ request (Union[ google.cloud.functions_v1.types.CreateFunctionRequest, dict] ):
347
349
The request object. Request for the `CreateFunction`
348
350
method.
349
351
location (:class:`str`):
@@ -423,17 +425,17 @@ async def create_function(
423
425
424
426
async def update_function (
425
427
self ,
426
- request : functions .UpdateFunctionRequest = None ,
428
+ request : Union [ functions .UpdateFunctionRequest , dict ] = None ,
427
429
* ,
428
430
function : functions .CloudFunction = None ,
429
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
431
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
430
432
timeout : float = None ,
431
433
metadata : Sequence [Tuple [str , str ]] = (),
432
434
) -> operation_async .AsyncOperation :
433
435
r"""Updates existing function.
434
436
435
437
Args:
436
- request (:class:` google.cloud.functions_v1.types.UpdateFunctionRequest` ):
438
+ request (Union[ google.cloud.functions_v1.types.UpdateFunctionRequest, dict] ):
437
439
The request object. Request for the `UpdateFunction`
438
440
method.
439
441
function (:class:`google.cloud.functions_v1.types.CloudFunction`):
@@ -517,10 +519,10 @@ async def update_function(
517
519
518
520
async def delete_function (
519
521
self ,
520
- request : functions .DeleteFunctionRequest = None ,
522
+ request : Union [ functions .DeleteFunctionRequest , dict ] = None ,
521
523
* ,
522
524
name : str = None ,
523
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
525
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
524
526
timeout : float = None ,
525
527
metadata : Sequence [Tuple [str , str ]] = (),
526
528
) -> operation_async .AsyncOperation :
@@ -530,7 +532,7 @@ async def delete_function(
530
532
function.
531
533
532
534
Args:
533
- request (:class:` google.cloud.functions_v1.types.DeleteFunctionRequest` ):
535
+ request (Union[ google.cloud.functions_v1.types.DeleteFunctionRequest, dict] ):
534
536
The request object. Request for the `DeleteFunction`
535
537
method.
536
538
name (:class:`str`):
@@ -622,11 +624,11 @@ async def delete_function(
622
624
623
625
async def call_function (
624
626
self ,
625
- request : functions .CallFunctionRequest = None ,
627
+ request : Union [ functions .CallFunctionRequest , dict ] = None ,
626
628
* ,
627
629
name : str = None ,
628
630
data : str = None ,
629
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
631
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
630
632
timeout : float = None ,
631
633
metadata : Sequence [Tuple [str , str ]] = (),
632
634
) -> functions .CallFunctionResponse :
@@ -636,7 +638,7 @@ async def call_function(
636
638
Limits <https://cloud.google.com/functions/quotas#rate_limits>`__.
637
639
638
640
Args:
639
- request (:class:` google.cloud.functions_v1.types.CallFunctionRequest` ):
641
+ request (Union[ google.cloud.functions_v1.types.CallFunctionRequest, dict] ):
640
642
The request object. Request for the `CallFunction`
641
643
method.
642
644
name (:class:`str`):
@@ -704,9 +706,9 @@ async def call_function(
704
706
705
707
async def generate_upload_url (
706
708
self ,
707
- request : functions .GenerateUploadUrlRequest = None ,
709
+ request : Union [ functions .GenerateUploadUrlRequest , dict ] = None ,
708
710
* ,
709
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
711
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
710
712
timeout : float = None ,
711
713
metadata : Sequence [Tuple [str , str ]] = (),
712
714
) -> functions .GenerateUploadUrlResponse :
@@ -740,7 +742,7 @@ async def generate_upload_url(
740
742
- ``Authorization: Bearer YOUR_TOKEN``
741
743
742
744
Args:
743
- request (:class:` google.cloud.functions_v1.types.GenerateUploadUrlRequest` ):
745
+ request (Union[ google.cloud.functions_v1.types.GenerateUploadUrlRequest, dict] ):
744
746
The request object. Request of `GenerateSourceUploadUrl`
745
747
method.
746
748
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -778,9 +780,9 @@ async def generate_upload_url(
778
780
779
781
async def generate_download_url (
780
782
self ,
781
- request : functions .GenerateDownloadUrlRequest = None ,
783
+ request : Union [ functions .GenerateDownloadUrlRequest , dict ] = None ,
782
784
* ,
783
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
785
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
784
786
timeout : float = None ,
785
787
metadata : Sequence [Tuple [str , str ]] = (),
786
788
) -> functions .GenerateDownloadUrlResponse :
@@ -793,7 +795,7 @@ async def generate_download_url(
793
795
control/signed-urls
794
796
795
797
Args:
796
- request (:class:` google.cloud.functions_v1.types.GenerateDownloadUrlRequest` ):
798
+ request (Union[ google.cloud.functions_v1.types.GenerateDownloadUrlRequest, dict] ):
797
799
The request object. Request of `GenerateDownloadUrl`
798
800
method.
799
801
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -831,17 +833,17 @@ async def generate_download_url(
831
833
832
834
async def set_iam_policy (
833
835
self ,
834
- request : iam_policy_pb2 .SetIamPolicyRequest = None ,
836
+ request : Union [ iam_policy_pb2 .SetIamPolicyRequest , dict ] = None ,
835
837
* ,
836
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
838
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
837
839
timeout : float = None ,
838
840
metadata : Sequence [Tuple [str , str ]] = (),
839
841
) -> policy_pb2 .Policy :
840
842
r"""Sets the IAM access control policy on the specified
841
843
function. Replaces any existing policy.
842
844
843
845
Args:
844
- request (:class:` google.iam.v1.iam_policy_pb2.SetIamPolicyRequest` ):
846
+ request (Union[ google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict] ):
845
847
The request object. Request message for `SetIamPolicy`
846
848
method.
847
849
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -937,9 +939,9 @@ async def set_iam_policy(
937
939
938
940
async def get_iam_policy (
939
941
self ,
940
- request : iam_policy_pb2 .GetIamPolicyRequest = None ,
942
+ request : Union [ iam_policy_pb2 .GetIamPolicyRequest , dict ] = None ,
941
943
* ,
942
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
944
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
943
945
timeout : float = None ,
944
946
metadata : Sequence [Tuple [str , str ]] = (),
945
947
) -> policy_pb2 .Policy :
@@ -948,7 +950,7 @@ async def get_iam_policy(
948
950
not have a policy set.
949
951
950
952
Args:
951
- request (:class:` google.iam.v1.iam_policy_pb2.GetIamPolicyRequest` ):
953
+ request (Union[ google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict] ):
952
954
The request object. Request message for `GetIamPolicy`
953
955
method.
954
956
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -1044,9 +1046,9 @@ async def get_iam_policy(
1044
1046
1045
1047
async def test_iam_permissions (
1046
1048
self ,
1047
- request : iam_policy_pb2 .TestIamPermissionsRequest = None ,
1049
+ request : Union [ iam_policy_pb2 .TestIamPermissionsRequest , dict ] = None ,
1048
1050
* ,
1049
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
1051
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
1050
1052
timeout : float = None ,
1051
1053
metadata : Sequence [Tuple [str , str ]] = (),
1052
1054
) -> iam_policy_pb2 .TestIamPermissionsResponse :
@@ -1055,7 +1057,7 @@ async def test_iam_permissions(
1055
1057
return an empty set of permissions, not a NOT_FOUND error.
1056
1058
1057
1059
Args:
1058
- request (:class:` google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest` ):
1060
+ request (Union[ google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict] ):
1059
1061
The request object. Request message for
1060
1062
`TestIamPermissions` method.
1061
1063
retry (google.api_core.retry.Retry): Designation of what errors, if any,
0 commit comments