Skip to content

Commit 751a79c

Browse files
yoshi-automationtseaver
authored andcommitted
Add 'options_' argument to clients' 'get_iam_policy'; pin black version (via synth). (googleapis#8659)
1 parent 52fab33 commit 751a79c

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed

spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from google.cloud.spanner_admin_database_v1.proto import spanner_database_admin_pb2
4242
from google.cloud.spanner_admin_database_v1.proto import spanner_database_admin_pb2_grpc
4343
from google.iam.v1 import iam_policy_pb2
44+
from google.iam.v1 import options_pb2
4445
from google.iam.v1 import policy_pb2
4546
from google.longrunning import operations_pb2
4647
from google.protobuf import empty_pb2
@@ -836,6 +837,7 @@ def set_iam_policy(
836837
def get_iam_policy(
837838
self,
838839
resource,
840+
options_=None,
839841
retry=google.api_core.gapic_v1.method.DEFAULT,
840842
timeout=google.api_core.gapic_v1.method.DEFAULT,
841843
metadata=None,
@@ -859,6 +861,11 @@ def get_iam_policy(
859861
Args:
860862
resource (str): REQUIRED: The resource for which the policy is being requested.
861863
See the operation documentation for the appropriate value for this field.
864+
options_ (Union[dict, ~google.cloud.spanner_admin_database_v1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to
865+
``GetIamPolicy``. This field is only used by Cloud IAM.
866+
867+
If a dict is provided, it must be of the same form as the protobuf
868+
message :class:`~google.cloud.spanner_admin_database_v1.types.GetPolicyOptions`
862869
retry (Optional[google.api_core.retry.Retry]): A retry object used
863870
to retry requests. If ``None`` is specified, requests will not
864871
be retried.
@@ -889,7 +896,9 @@ def get_iam_policy(
889896
client_info=self._client_info,
890897
)
891898

892-
request = iam_policy_pb2.GetIamPolicyRequest(resource=resource)
899+
request = iam_policy_pb2.GetIamPolicyRequest(
900+
resource=resource, options=options_
901+
)
893902
if metadata is None:
894903
metadata = []
895904
metadata = list(metadata)

spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from google.cloud.spanner_admin_instance_v1.proto import spanner_instance_admin_pb2
4242
from google.cloud.spanner_admin_instance_v1.proto import spanner_instance_admin_pb2_grpc
4343
from google.iam.v1 import iam_policy_pb2
44+
from google.iam.v1 import options_pb2
4445
from google.iam.v1 import policy_pb2
4546
from google.longrunning import operations_pb2
4647
from google.protobuf import empty_pb2
@@ -1047,6 +1048,7 @@ def set_iam_policy(
10471048
def get_iam_policy(
10481049
self,
10491050
resource,
1051+
options_=None,
10501052
retry=google.api_core.gapic_v1.method.DEFAULT,
10511053
timeout=google.api_core.gapic_v1.method.DEFAULT,
10521054
metadata=None,
@@ -1070,6 +1072,11 @@ def get_iam_policy(
10701072
Args:
10711073
resource (str): REQUIRED: The resource for which the policy is being requested.
10721074
See the operation documentation for the appropriate value for this field.
1075+
options_ (Union[dict, ~google.cloud.spanner_admin_instance_v1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to
1076+
``GetIamPolicy``. This field is only used by Cloud IAM.
1077+
1078+
If a dict is provided, it must be of the same form as the protobuf
1079+
message :class:`~google.cloud.spanner_admin_instance_v1.types.GetPolicyOptions`
10731080
retry (Optional[google.api_core.retry.Retry]): A retry object used
10741081
to retry requests. If ``None`` is specified, requests will not
10751082
be retried.
@@ -1100,7 +1107,9 @@ def get_iam_policy(
11001107
client_info=self._client_info,
11011108
)
11021109

1103-
request = iam_policy_pb2.GetIamPolicyRequest(resource=resource)
1110+
request = iam_policy_pb2.GetIamPolicyRequest(
1111+
resource=resource, options=options_
1112+
)
11041113
if metadata is None:
11051114
metadata = []
11061115
metadata = list(metadata)

spanner/noxfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

2626
LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core"))
27-
27+
BLACK_VERSION = "black==19.3b0"
2828
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
2929

3030
if os.path.exists("samples"):
@@ -38,7 +38,7 @@ def lint(session):
3838
Returns a failure if the linters find linting errors or sufficiently
3939
serious code quality issues.
4040
"""
41-
session.install("flake8", "black", *LOCAL_DEPS)
41+
session.install("flake8", BLACK_VERSION, *LOCAL_DEPS)
4242
session.run("black", "--check", *BLACK_PATHS)
4343
session.run("flake8", "google", "tests")
4444

@@ -53,7 +53,7 @@ def blacken(session):
5353
That run uses an image that doesn't have 3.6 installed. Before updating this
5454
check the state of the `gcp_ubuntu_config` we use for that Kokoro run.
5555
"""
56-
session.install("black")
56+
session.install(BLACK_VERSION)
5757
session.run("black", *BLACK_PATHS)
5858

5959

spanner/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-06-28T12:34:35.657138Z",
2+
"updateTime": "2019-07-12T12:34:36.971841Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.29.2",
8-
"dockerImage": "googleapis/artman@sha256:45263333b058a4b3c26a8b7680a2710f43eae3d250f791a6cb66423991dcb2df"
7+
"version": "0.29.4",
8+
"dockerImage": "googleapis/artman@sha256:63f21e83cb92680b7001dc381069e962c9e6dee314fd8365ac554c07c89221fb"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "84c8ad4e52f8eec8f08a60636cfa597b86969b5c",
16-
"internalRef": "255474859"
15+
"sha": "47bd0c2ba33c28dd624a65dad382e02bb61d1618",
16+
"internalRef": "257690259"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)