Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 784539c

Browse files
chore: use gapic-generator-python 0.65.1 (#173)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 441524537 Source-Link: googleapis/googleapis@2a27391 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab6756a48c89b5bcb9fb73443cb8e55d574f4643 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWI2NzU2YTQ4Yzg5YjViY2I5ZmI3MzQ0M2NiOGU1NWQ1NzRmNDY0MyJ9 feat: AuditConfig for IAM v1 fix(deps): require grpc-google-iam-v1 >=0.12.4
1 parent 20210d6 commit 784539c

16 files changed

+1082
-239
lines changed

google/cloud/functions_v1/services/cloud_functions_service/async_client.py

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from collections import OrderedDict
1717
import functools
1818
import re
19-
from typing import Dict, Optional, Sequence, Tuple, Type, Union
19+
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

2222
from google.api_core.client_options import ClientOptions
@@ -236,7 +236,6 @@ async def list_functions(
236236
r"""Returns a list of functions that belong to the
237237
requested project.
238238
239-
240239
.. code-block:: python
241240
242241
from google.cloud import functions_v1
@@ -333,7 +332,6 @@ async def get_function(
333332
r"""Returns a function with the given name from the
334333
requested project.
335334
336-
337335
.. code-block:: python
338336
339337
from google.cloud import functions_v1
@@ -445,7 +443,6 @@ async def create_function(
445443
already exists in the specified project, the long running
446444
operation will return ``ALREADY_EXISTS`` error.
447445
448-
449446
.. code-block:: python
450447
451448
from google.cloud import functions_v1
@@ -696,7 +693,6 @@ async def delete_function(
696693
trigger, the trigger will be updated to remove this
697694
function.
698695
699-
700696
.. code-block:: python
701697
702698
from google.cloud import functions_v1
@@ -831,7 +827,6 @@ async def call_function(
831827
information on the actual limits, refer to `Rate
832828
Limits <https://cloud.google.com/functions/quotas#rate_limits>`__.
833829
834-
835830
.. code-block:: python
836831
837832
from google.cloud import functions_v1
@@ -961,7 +956,6 @@ async def generate_upload_url(
961956
962957
- ``Authorization: Bearer YOUR_TOKEN``
963958
964-
965959
.. code-block:: python
966960
967961
from google.cloud import functions_v1
@@ -1037,7 +1031,6 @@ async def generate_download_url(
10371031
For more information about the signed URL usage see:
10381032
https://cloud.google.com/storage/docs/access-control/signed-urls
10391033
1040-
10411034
.. code-block:: python
10421035
10431036
from google.cloud import functions_v1
@@ -1109,17 +1102,17 @@ async def set_iam_policy(
11091102
r"""Sets the IAM access control policy on the specified
11101103
function. Replaces any existing policy.
11111104
1112-
11131105
.. code-block:: python
11141106
11151107
from google.cloud import functions_v1
1108+
from google.iam.v1 import iam_policy_pb2 # type: ignore
11161109
11171110
def sample_set_iam_policy():
11181111
# Create a client
11191112
client = functions_v1.CloudFunctionsServiceClient()
11201113
11211114
# Initialize request argument(s)
1122-
request = functions_v1.SetIamPolicyRequest(
1115+
request = iam_policy_pb2.SetIamPolicyRequest(
11231116
resource="resource_value",
11241117
)
11251118
@@ -1141,21 +1134,26 @@ def sample_set_iam_policy():
11411134
11421135
Returns:
11431136
google.iam.v1.policy_pb2.Policy:
1144-
Defines an Identity and Access Management (IAM) policy. It is used to
1145-
specify access control policies for Cloud Platform
1146-
resources.
1137+
An Identity and Access Management (IAM) policy, which specifies access
1138+
controls for Google Cloud resources.
11471139
11481140
A Policy is a collection of bindings. A binding binds
1149-
one or more members to a single role. Members can be
1150-
user accounts, service accounts, Google groups, and
1151-
domains (such as G Suite). A role is a named list of
1152-
permissions (defined by IAM or configured by users).
1153-
A binding can optionally specify a condition, which
1154-
is a logic expression that further constrains the
1155-
role binding based on attributes about the request
1156-
and/or target resource.
1157-
1158-
**JSON Example**
1141+
one or more members, or principals, to a single role.
1142+
Principals can be user accounts, service accounts,
1143+
Google groups, and domains (such as G Suite). A role
1144+
is a named list of permissions; each role can be an
1145+
IAM predefined role or a user-created custom role.
1146+
1147+
For some types of Google Cloud resources, a binding
1148+
can also specify a condition, which is a logical
1149+
expression that allows access to a resource only if
1150+
the expression evaluates to true. A condition can add
1151+
constraints based on attributes of the request, the
1152+
resource, or both. To learn which resources support
1153+
conditions in their IAM policies, see the [IAM
1154+
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
1155+
1156+
**JSON example:**
11591157
11601158
{
11611159
"bindings": [
@@ -1170,17 +1168,17 @@ def sample_set_iam_policy():
11701168
11711169
}, { "role":
11721170
"roles/resourcemanager.organizationViewer",
1173-
"members": ["user:[email protected]"],
1171+
"members": [ "user:[email protected]" ],
11741172
"condition": { "title": "expirable access",
11751173
"description": "Does not grant access after
11761174
Sep 2020", "expression": "request.time <
11771175
timestamp('2020-10-01T00:00:00.000Z')", } }
11781176
1179-
]
1177+
], "etag": "BwWWja0YfJA=", "version": 3
11801178
11811179
}
11821180
1183-
**YAML Example**
1181+
**YAML example:**
11841182
11851183
bindings: - members: - user:\ [email protected] -
11861184
group:\ [email protected] - domain:google.com -
@@ -1191,11 +1189,12 @@ def sample_set_iam_policy():
11911189
condition: title: expirable access description:
11921190
Does not grant access after Sep 2020 expression:
11931191
request.time <
1194-
timestamp('2020-10-01T00:00:00.000Z')
1192+
timestamp('2020-10-01T00:00:00.000Z') etag:
1193+
BwWWja0YfJA= version: 3
11951194
11961195
For a description of IAM and its features, see the
1197-
[IAM developer's
1198-
guide](\ https://cloud.google.com/iam/docs).
1196+
[IAM
1197+
documentation](\ https://cloud.google.com/iam/docs/).
11991198
12001199
"""
12011200
# Create or coerce a protobuf request object.
@@ -1241,17 +1240,17 @@ async def get_iam_policy(
12411240
Returns an empty policy if the function exists and does
12421241
not have a policy set.
12431242
1244-
12451243
.. code-block:: python
12461244
12471245
from google.cloud import functions_v1
1246+
from google.iam.v1 import iam_policy_pb2 # type: ignore
12481247
12491248
def sample_get_iam_policy():
12501249
# Create a client
12511250
client = functions_v1.CloudFunctionsServiceClient()
12521251
12531252
# Initialize request argument(s)
1254-
request = functions_v1.GetIamPolicyRequest(
1253+
request = iam_policy_pb2.GetIamPolicyRequest(
12551254
resource="resource_value",
12561255
)
12571256
@@ -1273,21 +1272,26 @@ def sample_get_iam_policy():
12731272
12741273
Returns:
12751274
google.iam.v1.policy_pb2.Policy:
1276-
Defines an Identity and Access Management (IAM) policy. It is used to
1277-
specify access control policies for Cloud Platform
1278-
resources.
1275+
An Identity and Access Management (IAM) policy, which specifies access
1276+
controls for Google Cloud resources.
12791277
12801278
A Policy is a collection of bindings. A binding binds
1281-
one or more members to a single role. Members can be
1282-
user accounts, service accounts, Google groups, and
1283-
domains (such as G Suite). A role is a named list of
1284-
permissions (defined by IAM or configured by users).
1285-
A binding can optionally specify a condition, which
1286-
is a logic expression that further constrains the
1287-
role binding based on attributes about the request
1288-
and/or target resource.
1289-
1290-
**JSON Example**
1279+
one or more members, or principals, to a single role.
1280+
Principals can be user accounts, service accounts,
1281+
Google groups, and domains (such as G Suite). A role
1282+
is a named list of permissions; each role can be an
1283+
IAM predefined role or a user-created custom role.
1284+
1285+
For some types of Google Cloud resources, a binding
1286+
can also specify a condition, which is a logical
1287+
expression that allows access to a resource only if
1288+
the expression evaluates to true. A condition can add
1289+
constraints based on attributes of the request, the
1290+
resource, or both. To learn which resources support
1291+
conditions in their IAM policies, see the [IAM
1292+
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
1293+
1294+
**JSON example:**
12911295
12921296
{
12931297
"bindings": [
@@ -1302,17 +1306,17 @@ def sample_get_iam_policy():
13021306
13031307
}, { "role":
13041308
"roles/resourcemanager.organizationViewer",
1305-
"members": ["user:[email protected]"],
1309+
"members": [ "user:[email protected]" ],
13061310
"condition": { "title": "expirable access",
13071311
"description": "Does not grant access after
13081312
Sep 2020", "expression": "request.time <
13091313
timestamp('2020-10-01T00:00:00.000Z')", } }
13101314
1311-
]
1315+
], "etag": "BwWWja0YfJA=", "version": 3
13121316
13131317
}
13141318
1315-
**YAML Example**
1319+
**YAML example:**
13161320
13171321
bindings: - members: - user:\ [email protected] -
13181322
group:\ [email protected] - domain:google.com -
@@ -1323,11 +1327,12 @@ def sample_get_iam_policy():
13231327
condition: title: expirable access description:
13241328
Does not grant access after Sep 2020 expression:
13251329
request.time <
1326-
timestamp('2020-10-01T00:00:00.000Z')
1330+
timestamp('2020-10-01T00:00:00.000Z') etag:
1331+
BwWWja0YfJA= version: 3
13271332
13281333
For a description of IAM and its features, see the
1329-
[IAM developer's
1330-
guide](\ https://cloud.google.com/iam/docs).
1334+
[IAM
1335+
documentation](\ https://cloud.google.com/iam/docs/).
13311336
13321337
"""
13331338
# Create or coerce a protobuf request object.
@@ -1373,17 +1378,17 @@ async def test_iam_permissions(
13731378
policy for a function. If the function does not exist, this will
13741379
return an empty set of permissions, not a NOT_FOUND error.
13751380
1376-
13771381
.. code-block:: python
13781382
13791383
from google.cloud import functions_v1
1384+
from google.iam.v1 import iam_policy_pb2 # type: ignore
13801385
13811386
def sample_test_iam_permissions():
13821387
# Create a client
13831388
client = functions_v1.CloudFunctionsServiceClient()
13841389
13851390
# Initialize request argument(s)
1386-
request = functions_v1.TestIamPermissionsRequest(
1391+
request = iam_policy_pb2.TestIamPermissionsRequest(
13871392
resource="resource_value",
13881393
permissions=['permissions_value_1', 'permissions_value_2'],
13891394
)

0 commit comments

Comments
 (0)