Skip to content

Commit d426e64

Browse files
yoshi-automationtseaver
authored andcommitted
Add 'options_' argument to clients' 'get_iam_policy'; pin black version (via synth). (googleapis#8655)
1 parent 664a095 commit d426e64

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

iot/google/cloud/iot_v1/gapic/device_manager_client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from google.cloud.iot_v1.proto import device_manager_pb2_grpc
3939
from google.cloud.iot_v1.proto import resources_pb2
4040
from google.iam.v1 import iam_policy_pb2
41+
from google.iam.v1 import options_pb2
4142
from google.iam.v1 import policy_pb2
4243
from google.protobuf import empty_pb2
4344
from google.protobuf import field_mask_pb2
@@ -1410,6 +1411,7 @@ def set_iam_policy(
14101411
def get_iam_policy(
14111412
self,
14121413
resource,
1414+
options_=None,
14131415
retry=google.api_core.gapic_v1.method.DEFAULT,
14141416
timeout=google.api_core.gapic_v1.method.DEFAULT,
14151417
metadata=None,
@@ -1431,6 +1433,11 @@ def get_iam_policy(
14311433
Args:
14321434
resource (str): REQUIRED: The resource for which the policy is being requested.
14331435
See the operation documentation for the appropriate value for this field.
1436+
options_ (Union[dict, ~google.cloud.iot_v1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to
1437+
``GetIamPolicy``. This field is only used by Cloud IAM.
1438+
1439+
If a dict is provided, it must be of the same form as the protobuf
1440+
message :class:`~google.cloud.iot_v1.types.GetPolicyOptions`
14341441
retry (Optional[google.api_core.retry.Retry]): A retry object used
14351442
to retry requests. If ``None`` is specified, requests will not
14361443
be retried.
@@ -1461,7 +1468,9 @@ def get_iam_policy(
14611468
client_info=self._client_info,
14621469
)
14631470

1464-
request = iam_policy_pb2.GetIamPolicyRequest(resource=resource)
1471+
request = iam_policy_pb2.GetIamPolicyRequest(
1472+
resource=resource, options=options_
1473+
)
14651474
if metadata is None:
14661475
metadata = []
14671476
metadata = list(metadata)

iot/google/cloud/iot_v1/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from google.cloud.iot_v1.proto import device_manager_pb2
2424
from google.cloud.iot_v1.proto import resources_pb2
2525
from google.iam.v1 import iam_policy_pb2
26+
from google.iam.v1 import options_pb2
2627
from google.iam.v1 import policy_pb2
2728
from google.protobuf import any_pb2
2829
from google.protobuf import empty_pb2
@@ -34,6 +35,7 @@
3435

3536
_shared_modules = [
3637
iam_policy_pb2,
38+
options_pb2,
3739
policy_pb2,
3840
any_pb2,
3941
empty_pb2,

iot/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

iot/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:25:43.889463Z",
2+
"updateTime": "2019-07-12T12:24:41.528205Z",
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)