Skip to content

Commit

Permalink
feat: add permissions to testIamPermissions call (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Nov 15, 2019
1 parent 54ccafb commit 74b491e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
9 changes: 7 additions & 2 deletions packages/google-cloud-iot/src/v1/device_manager_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ class DeviceManagerClient {
* @param {string} request.resource
* REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
* @param {string[]} [request.permissions]
* @param {string[]} request.permissions
* The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
Expand All @@ -1469,7 +1469,12 @@ class DeviceManagerClient {
* });
*
* const resource = '';
* client.testIamPermissions({resource: resource})
* const permissions = [];
* const request = {
* resource: resource,
* permissions: permissions,
* };
* client.testIamPermissions(request)
* .then(responses => {
* const response = responses[0];
* // doThingsWith(response)
Expand Down
11 changes: 6 additions & 5 deletions packages/google-cloud-iot/src/v1/doc/google/iam/v1/doc_policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@
*
* Operations affecting conditional bindings must specify version 3. This can
* be either setting a conditional policy, modifying a conditional binding,
* or removing a conditional binding from the stored conditional policy.
* or removing a binding (conditional or unconditional) from the stored
* conditional policy.
* Operations on non-conditional policies may specify any valid value or
* leave the field unset.
*
* If no etag is provided in the call to `setIamPolicy`, any version
* compliance checks on the incoming and/or stored policy is skipped.
* If no etag is provided in the call to `setIamPolicy`, version compliance
* checks against the stored policy is skipped.
*
* @property {Object[]} bindings
* Associates a list of `members` to a `role`. Optionally may specify a
Expand All @@ -107,8 +108,8 @@
*
* If no `etag` is provided in the call to `setIamPolicy`, then the existing
* policy is overwritten. Due to blind-set semantics of an etag-less policy,
* 'setIamPolicy' will not fail even if either of incoming or stored policy
* does not meet the version requirements.
* 'setIamPolicy' will not fail even if the incoming policy version does not
* meet the requirements for modifying the stored policy.
*
* @typedef Policy
* @memberof google.iam.v1
Expand Down
10 changes: 5 additions & 5 deletions packages/google-cloud-iot/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-11-06T12:15:12.407798Z",
"updateTime": "2019-11-14T12:17:35.275146Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.41.0",
"dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9"
"version": "0.41.1",
"dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "5691fcb7c1a926b52577aa1834f31d9c50efda54",
"internalRef": "278731899"
"sha": "4f747bda9b099b4426f495985680d16d0227fa5f",
"internalRef": "280394936"
}
},
{
Expand Down
4 changes: 4 additions & 0 deletions packages/google-cloud-iot/test/gapic-v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,10 @@ describe('DeviceManagerClient', () => {

// Mock request
const resource = 'resource-341064690';
const permissions = [];
const request = {
resource: resource,
permissions: permissions,
};

// Mock response
Expand All @@ -1110,8 +1112,10 @@ describe('DeviceManagerClient', () => {

// Mock request
const resource = 'resource-341064690';
const permissions = [];
const request = {
resource: resource,
permissions: permissions,
};

// Mock Grpc layer
Expand Down

0 comments on commit 74b491e

Please sign in to comment.