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

Commit ab48a2a

Browse files
chore: use gapic-generator-python 0.65.1 (#175)
- [ ] 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 docs: fix type in docstring for map fields
1 parent 6a205de commit ab48a2a

File tree

46 files changed

+3682
-576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3682
-576
lines changed

google/cloud/servicedirectory_v1/services/lookup_service/async_client.py

Lines changed: 1 addition & 2 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
@@ -216,7 +216,6 @@ async def resolve_service(
216216
and its associated endpoints. Resolving a service is not
217217
considered an active developer method.
218218
219-
220219
.. code-block:: python
221220
222221
from google.cloud import servicedirectory_v1

google/cloud/servicedirectory_v1/services/lookup_service/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from collections import OrderedDict
1717
import os
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 import client_options as client_options_lib
@@ -464,7 +464,6 @@ def resolve_service(
464464
and its associated endpoints. Resolving a service is not
465465
considered an active developer method.
466466
467-
468467
.. code-block:: python
469468
470469
from google.cloud import servicedirectory_v1

google/cloud/servicedirectory_v1/services/lookup_service/transports/base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def __init__(
8080
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
8181
be used for service account credentials.
8282
"""
83+
8384
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
8485
if ":" not in host:
8586
host += ":443"
@@ -148,5 +149,9 @@ def resolve_service(
148149
]:
149150
raise NotImplementedError()
150151

152+
@property
153+
def kind(self) -> str:
154+
raise NotImplementedError()
155+
151156

152157
__all__ = ("LookupServiceTransport",)

google/cloud/servicedirectory_v1/services/lookup_service/transports/grpc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,5 +260,9 @@ def resolve_service(
260260
def close(self):
261261
self.grpc_channel.close()
262262

263+
@property
264+
def kind(self) -> str:
265+
return "grpc"
266+
263267

264268
__all__ = ("LookupServiceGrpcTransport",)

google/cloud/servicedirectory_v1/services/registration_service/async_client.py

Lines changed: 57 additions & 47 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
@@ -680,7 +680,6 @@ async def delete_namespace(
680680
r"""Deletes a namespace. This also deletes all services
681681
and endpoints in the namespace.
682682
683-
684683
.. code-block:: python
685684
686685
from google.cloud import servicedirectory_v1
@@ -1204,7 +1203,6 @@ async def delete_service(
12041203
r"""Deletes a service. This also deletes all endpoints
12051204
associated with the service.
12061205
1207-
12081206
.. code-block:: python
12091207
12101208
from google.cloud import servicedirectory_v1
@@ -1806,17 +1804,17 @@ async def get_iam_policy(
18061804
r"""Gets the IAM Policy for a resource (namespace or
18071805
service only).
18081806
1809-
18101807
.. code-block:: python
18111808
18121809
from google.cloud import servicedirectory_v1
1810+
from google.iam.v1 import iam_policy_pb2 # type: ignore
18131811
18141812
def sample_get_iam_policy():
18151813
# Create a client
18161814
client = servicedirectory_v1.RegistrationServiceClient()
18171815
18181816
# Initialize request argument(s)
1819-
request = servicedirectory_v1.GetIamPolicyRequest(
1817+
request = iam_policy_pb2.GetIamPolicyRequest(
18201818
resource="resource_value",
18211819
)
18221820
@@ -1838,21 +1836,26 @@ def sample_get_iam_policy():
18381836
18391837
Returns:
18401838
google.iam.v1.policy_pb2.Policy:
1841-
Defines an Identity and Access Management (IAM) policy. It is used to
1842-
specify access control policies for Cloud Platform
1843-
resources.
1839+
An Identity and Access Management (IAM) policy, which specifies access
1840+
controls for Google Cloud resources.
18441841
18451842
A Policy is a collection of bindings. A binding binds
1846-
one or more members to a single role. Members can be
1847-
user accounts, service accounts, Google groups, and
1848-
domains (such as G Suite). A role is a named list of
1849-
permissions (defined by IAM or configured by users).
1850-
A binding can optionally specify a condition, which
1851-
is a logic expression that further constrains the
1852-
role binding based on attributes about the request
1853-
and/or target resource.
1854-
1855-
**JSON Example**
1843+
one or more members, or principals, to a single role.
1844+
Principals can be user accounts, service accounts,
1845+
Google groups, and domains (such as G Suite). A role
1846+
is a named list of permissions; each role can be an
1847+
IAM predefined role or a user-created custom role.
1848+
1849+
For some types of Google Cloud resources, a binding
1850+
can also specify a condition, which is a logical
1851+
expression that allows access to a resource only if
1852+
the expression evaluates to true. A condition can add
1853+
constraints based on attributes of the request, the
1854+
resource, or both. To learn which resources support
1855+
conditions in their IAM policies, see the [IAM
1856+
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
1857+
1858+
**JSON example:**
18561859
18571860
{
18581861
"bindings": [
@@ -1867,17 +1870,17 @@ def sample_get_iam_policy():
18671870
18681871
}, { "role":
18691872
"roles/resourcemanager.organizationViewer",
1870-
"members": ["user:eve@example.com"],
1873+
"members": [ "user:eve@example.com" ],
18711874
"condition": { "title": "expirable access",
18721875
"description": "Does not grant access after
18731876
Sep 2020", "expression": "request.time <
18741877
timestamp('2020-10-01T00:00:00.000Z')", } }
18751878
1876-
]
1879+
], "etag": "BwWWja0YfJA=", "version": 3
18771880
18781881
}
18791882
1880-
**YAML Example**
1883+
**YAML example:**
18811884
18821885
bindings: - members: - user:\ mike@example.com -
18831886
group:\ admins@example.com - domain:google.com -
@@ -1888,11 +1891,12 @@ def sample_get_iam_policy():
18881891
condition: title: expirable access description:
18891892
Does not grant access after Sep 2020 expression:
18901893
request.time <
1891-
timestamp('2020-10-01T00:00:00.000Z')
1894+
timestamp('2020-10-01T00:00:00.000Z') etag:
1895+
BwWWja0YfJA= version: 3
18921896
18931897
For a description of IAM and its features, see the
1894-
[IAM developer's
1895-
guide](\ https://cloud.google.com/iam/docs).
1898+
[IAM
1899+
documentation](\ https://cloud.google.com/iam/docs/).
18961900
18971901
"""
18981902
# Create or coerce a protobuf request object.
@@ -1937,17 +1941,17 @@ async def set_iam_policy(
19371941
r"""Sets the IAM Policy for a resource (namespace or
19381942
service only).
19391943
1940-
19411944
.. code-block:: python
19421945
19431946
from google.cloud import servicedirectory_v1
1947+
from google.iam.v1 import iam_policy_pb2 # type: ignore
19441948
19451949
def sample_set_iam_policy():
19461950
# Create a client
19471951
client = servicedirectory_v1.RegistrationServiceClient()
19481952
19491953
# Initialize request argument(s)
1950-
request = servicedirectory_v1.SetIamPolicyRequest(
1954+
request = iam_policy_pb2.SetIamPolicyRequest(
19511955
resource="resource_value",
19521956
)
19531957
@@ -1969,21 +1973,26 @@ def sample_set_iam_policy():
19691973
19701974
Returns:
19711975
google.iam.v1.policy_pb2.Policy:
1972-
Defines an Identity and Access Management (IAM) policy. It is used to
1973-
specify access control policies for Cloud Platform
1974-
resources.
1976+
An Identity and Access Management (IAM) policy, which specifies access
1977+
controls for Google Cloud resources.
19751978
19761979
A Policy is a collection of bindings. A binding binds
1977-
one or more members to a single role. Members can be
1978-
user accounts, service accounts, Google groups, and
1979-
domains (such as G Suite). A role is a named list of
1980-
permissions (defined by IAM or configured by users).
1981-
A binding can optionally specify a condition, which
1982-
is a logic expression that further constrains the
1983-
role binding based on attributes about the request
1984-
and/or target resource.
1985-
1986-
**JSON Example**
1980+
one or more members, or principals, to a single role.
1981+
Principals can be user accounts, service accounts,
1982+
Google groups, and domains (such as G Suite). A role
1983+
is a named list of permissions; each role can be an
1984+
IAM predefined role or a user-created custom role.
1985+
1986+
For some types of Google Cloud resources, a binding
1987+
can also specify a condition, which is a logical
1988+
expression that allows access to a resource only if
1989+
the expression evaluates to true. A condition can add
1990+
constraints based on attributes of the request, the
1991+
resource, or both. To learn which resources support
1992+
conditions in their IAM policies, see the [IAM
1993+
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
1994+
1995+
**JSON example:**
19871996
19881997
{
19891998
"bindings": [
@@ -1998,17 +2007,17 @@ def sample_set_iam_policy():
19982007
19992008
}, { "role":
20002009
"roles/resourcemanager.organizationViewer",
2001-
"members": ["user:eve@example.com"],
2010+
"members": [ "user:eve@example.com" ],
20022011
"condition": { "title": "expirable access",
20032012
"description": "Does not grant access after
20042013
Sep 2020", "expression": "request.time <
20052014
timestamp('2020-10-01T00:00:00.000Z')", } }
20062015
2007-
]
2016+
], "etag": "BwWWja0YfJA=", "version": 3
20082017
20092018
}
20102019
2011-
**YAML Example**
2020+
**YAML example:**
20122021
20132022
bindings: - members: - user:\ mike@example.com -
20142023
group:\ admins@example.com - domain:google.com -
@@ -2019,11 +2028,12 @@ def sample_set_iam_policy():
20192028
condition: title: expirable access description:
20202029
Does not grant access after Sep 2020 expression:
20212030
request.time <
2022-
timestamp('2020-10-01T00:00:00.000Z')
2031+
timestamp('2020-10-01T00:00:00.000Z') etag:
2032+
BwWWja0YfJA= version: 3
20232033
20242034
For a description of IAM and its features, see the
2025-
[IAM developer's
2026-
guide](\ https://cloud.google.com/iam/docs).
2035+
[IAM
2036+
documentation](\ https://cloud.google.com/iam/docs/).
20272037
20282038
"""
20292039
# Create or coerce a protobuf request object.
@@ -2068,17 +2078,17 @@ async def test_iam_permissions(
20682078
r"""Tests IAM permissions for a resource (namespace or
20692079
service only).
20702080
2071-
20722081
.. code-block:: python
20732082
20742083
from google.cloud import servicedirectory_v1
2084+
from google.iam.v1 import iam_policy_pb2 # type: ignore
20752085
20762086
def sample_test_iam_permissions():
20772087
# Create a client
20782088
client = servicedirectory_v1.RegistrationServiceClient()
20792089
20802090
# Initialize request argument(s)
2081-
request = servicedirectory_v1.TestIamPermissionsRequest(
2091+
request = iam_policy_pb2.TestIamPermissionsRequest(
20822092
resource="resource_value",
20832093
permissions=['permissions_value_1', 'permissions_value_2'],
20842094
)

0 commit comments

Comments
 (0)