-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use gapic-generator-python 0.65.1 (#277)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 441524537 Source-Link: googleapis/googleapis@2a27391 Source-Link: googleapis/googleapis-gen@ab6756a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWI2NzU2YTQ4Yzg5YjViY2I5ZmI3MzQ0M2NiOGU1NWQ1NzRmNDY0MyJ9 feat: AuditConfig for IAM v1 fix(deps): require grpc-google-iam-v1 >=0.12.4
- Loading branch information
1 parent
3d8a32c
commit a649a12
Showing
15 changed files
with
592 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
from collections import OrderedDict | ||
import functools | ||
import re | ||
from typing import Dict, Optional, Sequence, Tuple, Type, Union | ||
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union | ||
import pkg_resources | ||
|
||
from google.api_core.client_options import ClientOptions | ||
|
@@ -253,17 +253,17 @@ async def set_iam_policy( | |
``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for | ||
occurrences. | ||
.. code-block:: python | ||
from google.cloud.devtools import containeranalysis_v1 | ||
from google.iam.v1 import iam_policy_pb2 # type: ignore | ||
def sample_set_iam_policy(): | ||
# Create a client | ||
client = containeranalysis_v1.ContainerAnalysisClient() | ||
# Initialize request argument(s) | ||
request = containeranalysis_v1.SetIamPolicyRequest( | ||
request = iam_policy_pb2.SetIamPolicyRequest( | ||
resource="resource_value", | ||
) | ||
|
@@ -294,21 +294,26 @@ def sample_set_iam_policy(): | |
Returns: | ||
google.iam.v1.policy_pb2.Policy: | ||
Defines an Identity and Access Management (IAM) policy. It is used to | ||
specify access control policies for Cloud Platform | ||
resources. | ||
An Identity and Access Management (IAM) policy, which specifies access | ||
controls for Google Cloud resources. | ||
A Policy is a collection of bindings. A binding binds | ||
one or more members to a single role. Members can be | ||
user accounts, service accounts, Google groups, and | ||
domains (such as G Suite). A role is a named list of | ||
permissions (defined by IAM or configured by users). | ||
A binding can optionally specify a condition, which | ||
is a logic expression that further constrains the | ||
role binding based on attributes about the request | ||
and/or target resource. | ||
**JSON Example** | ||
one or more members, or principals, to a single role. | ||
Principals can be user accounts, service accounts, | ||
Google groups, and domains (such as G Suite). A role | ||
is a named list of permissions; each role can be an | ||
IAM predefined role or a user-created custom role. | ||
For some types of Google Cloud resources, a binding | ||
can also specify a condition, which is a logical | ||
expression that allows access to a resource only if | ||
the expression evaluates to true. A condition can add | ||
constraints based on attributes of the request, the | ||
resource, or both. To learn which resources support | ||
conditions in their IAM policies, see the [IAM | ||
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). | ||
**JSON example:** | ||
{ | ||
"bindings": [ | ||
|
@@ -323,17 +328,17 @@ def sample_set_iam_policy(): | |
}, { "role": | ||
"roles/resourcemanager.organizationViewer", | ||
"members": ["user:[email protected]"], | ||
"members": [ "user:[email protected]" ], | ||
"condition": { "title": "expirable access", | ||
"description": "Does not grant access after | ||
Sep 2020", "expression": "request.time < | ||
timestamp('2020-10-01T00:00:00.000Z')", } } | ||
] | ||
], "etag": "BwWWja0YfJA=", "version": 3 | ||
} | ||
**YAML Example** | ||
**YAML example:** | ||
bindings: - members: - user:\ [email protected] - | ||
group:\ [email protected] - domain:google.com - | ||
|
@@ -344,11 +349,12 @@ def sample_set_iam_policy(): | |
condition: title: expirable access description: | ||
Does not grant access after Sep 2020 expression: | ||
request.time < | ||
timestamp('2020-10-01T00:00:00.000Z') | ||
timestamp('2020-10-01T00:00:00.000Z') etag: | ||
BwWWja0YfJA= version: 3 | ||
For a description of IAM and its features, see the | ||
[IAM developer's | ||
guide](\ https://cloud.google.com/iam/docs). | ||
[IAM | ||
documentation](\ https://cloud.google.com/iam/docs/). | ||
""" | ||
# Create or coerce a protobuf request object. | ||
|
@@ -414,17 +420,17 @@ async def get_iam_policy( | |
``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for | ||
occurrences. | ||
.. code-block:: python | ||
from google.cloud.devtools import containeranalysis_v1 | ||
from google.iam.v1 import iam_policy_pb2 # type: ignore | ||
def sample_get_iam_policy(): | ||
# Create a client | ||
client = containeranalysis_v1.ContainerAnalysisClient() | ||
# Initialize request argument(s) | ||
request = containeranalysis_v1.GetIamPolicyRequest( | ||
request = iam_policy_pb2.GetIamPolicyRequest( | ||
resource="resource_value", | ||
) | ||
|
@@ -455,21 +461,26 @@ def sample_get_iam_policy(): | |
Returns: | ||
google.iam.v1.policy_pb2.Policy: | ||
Defines an Identity and Access Management (IAM) policy. It is used to | ||
specify access control policies for Cloud Platform | ||
resources. | ||
An Identity and Access Management (IAM) policy, which specifies access | ||
controls for Google Cloud resources. | ||
A Policy is a collection of bindings. A binding binds | ||
one or more members to a single role. Members can be | ||
user accounts, service accounts, Google groups, and | ||
domains (such as G Suite). A role is a named list of | ||
permissions (defined by IAM or configured by users). | ||
A binding can optionally specify a condition, which | ||
is a logic expression that further constrains the | ||
role binding based on attributes about the request | ||
and/or target resource. | ||
**JSON Example** | ||
one or more members, or principals, to a single role. | ||
Principals can be user accounts, service accounts, | ||
Google groups, and domains (such as G Suite). A role | ||
is a named list of permissions; each role can be an | ||
IAM predefined role or a user-created custom role. | ||
For some types of Google Cloud resources, a binding | ||
can also specify a condition, which is a logical | ||
expression that allows access to a resource only if | ||
the expression evaluates to true. A condition can add | ||
constraints based on attributes of the request, the | ||
resource, or both. To learn which resources support | ||
conditions in their IAM policies, see the [IAM | ||
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). | ||
**JSON example:** | ||
{ | ||
"bindings": [ | ||
|
@@ -484,17 +495,17 @@ def sample_get_iam_policy(): | |
}, { "role": | ||
"roles/resourcemanager.organizationViewer", | ||
"members": ["user:[email protected]"], | ||
"members": [ "user:[email protected]" ], | ||
"condition": { "title": "expirable access", | ||
"description": "Does not grant access after | ||
Sep 2020", "expression": "request.time < | ||
timestamp('2020-10-01T00:00:00.000Z')", } } | ||
] | ||
], "etag": "BwWWja0YfJA=", "version": 3 | ||
} | ||
**YAML Example** | ||
**YAML example:** | ||
bindings: - members: - user:\ [email protected] - | ||
group:\ [email protected] - domain:google.com - | ||
|
@@ -505,11 +516,12 @@ def sample_get_iam_policy(): | |
condition: title: expirable access description: | ||
Does not grant access after Sep 2020 expression: | ||
request.time < | ||
timestamp('2020-10-01T00:00:00.000Z') | ||
timestamp('2020-10-01T00:00:00.000Z') etag: | ||
BwWWja0YfJA= version: 3 | ||
For a description of IAM and its features, see the | ||
[IAM developer's | ||
guide](\ https://cloud.google.com/iam/docs). | ||
[IAM | ||
documentation](\ https://cloud.google.com/iam/docs/). | ||
""" | ||
# Create or coerce a protobuf request object. | ||
|
@@ -575,17 +587,17 @@ async def test_iam_permissions( | |
``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for | ||
occurrences. | ||
.. code-block:: python | ||
from google.cloud.devtools import containeranalysis_v1 | ||
from google.iam.v1 import iam_policy_pb2 # type: ignore | ||
def sample_test_iam_permissions(): | ||
# Create a client | ||
client = containeranalysis_v1.ContainerAnalysisClient() | ||
# Initialize request argument(s) | ||
request = containeranalysis_v1.TestIamPermissionsRequest( | ||
request = iam_policy_pb2.TestIamPermissionsRequest( | ||
resource="resource_value", | ||
permissions=['permissions_value_1', 'permissions_value_2'], | ||
) | ||
|
@@ -688,7 +700,6 @@ async def get_vulnerability_occurrences_summary( | |
r"""Gets a summary of the number and severity of | ||
occurrences. | ||
.. code-block:: python | ||
from google.cloud.devtools import containeranalysis_v1 | ||
|
Oops, something went wrong.