An interface for managing Identity and Access Management (IAM) policy bindings. v3
Package
@google-cloud/iamConstructors
(constructor)(opts, gaxInstance)
constructor
(
opts
?:
ClientOptions
,
gaxInstance
?:
typeof
gax
|
typeof
gax
.
fallback
);
Construct an instance of PolicyBindingsClient.
opts
ClientOptions
gaxInstance
typeof gax
| typeof fallback
: loaded instance of google-gax
. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new PolicyBindingsClient({fallback: true}, gax); ```
Properties
apiEndpoint
get
apiEndpoint
()
:
string
;
The DNS address for this API service.
apiEndpoint
static
get
apiEndpoint
()
:
string
;
The DNS address for this API service - same as servicePath.
auth
auth
:
gax
.
GoogleAuth
;
descriptors
descriptors
:
Descriptors
;
innerApiCalls
innerApiCalls
:
{
[
name
:
string
]
:
Function
;
};
locationsClient
locationsClient
:
LocationsClient
;
operationsClient
operationsClient
:
gax
.
OperationsClient
;
pathTemplates
pathTemplates
:
{
[
name
:
string
]
:
gax
.
PathTemplate
;
};
policyBindingsStub
policyBindingsStub
?:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
port
static
get
port
()
:
number
;
The port for this API service.
scopes
static
get
scopes
()
:
string
[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static
get
servicePath
()
:
string
;
The DNS address for this API service.
universeDomain
get
universeDomain
()
:
string
;
warn
warn
:
(
code
:
string
,
message
:
string
,
warnType
?:
string
)
=
>
void
;
Methods
cancelOperation(request, optionsOrCallback, callback)
cancelOperation
(
request
:
protos
.
google
.
longrunning
.
CancelOperationRequest
,
optionsOrCallback
?:
gax
.
CallOptions
|
Callback<protos
.
google
.
longrunning
.
CancelOperationRequest
,
protos
.
google
.
protobuf
.
Empty
,
{}
|
undefined
|
null
> ,
callback
?:
Callback<protos
.
google
.
longrunning
.
CancelOperationRequest
,
protos
.
google
.
protobuf
.
Empty
,
{}
|
undefined
|
null
> )
:
Promise<protos
.
google
.
protobuf
.
Empty
> ;
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED
.
request
optionsOrCallback
CallOptions
| Callback
< protos.google.longrunning.CancelOperationRequest
, protos.google.protobuf.Empty
, {} | undefined | null>
callback
Callback
< protos.google.longrunning.CancelOperationRequest
, protos.google.protobuf.Empty
, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
const
client
=
longrunning
.
operationsClient
();
await
client
.
cancelOperation
({
name
:
''
});
checkCreatePolicyBindingProgress(name)
checkCreatePolicyBindingProgress
(
name
:
string
)
:
Promise<LROperation<protos
.
google
.
iam
.
v3
.
PolicyBinding
,
protos
.
google
.
iam
.
v3
.
OperationMetadata
>> ;
Check the status of the long running operation returned by createPolicyBinding()
.
name
string
The operation name that will be passed.
Promise
< LROperation
< protos.google.iam.v3.PolicyBinding
, protos.google.iam.v3.OperationMetadata
>>
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource where this policy binding will be created.
* The binding parent is the closest Resource Manager resource (project,
* folder or organization) to the binding target.
* Format:
* * `projects/{project_id}/locations/{location}`
* * `projects/{project_number}/locations/{location}`
* * `folders/{folder_id}/locations/{location}`
* * `organizations/{organization_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. The ID to use for the policy binding, which will become the final
* component of the policy binding's resource name.
* This value must start with a lowercase letter followed by up to 62
* lowercase letters, numbers, hyphens, or dots. Pattern,
* /[a-z][a-z0-9-\.]{2,62}/.
*/
// const policyBindingId = 'abc123'
/**
* Required. The policy binding to create.
*/
// const policyBinding = {}
/**
* Optional. If set, validate the request and preview the creation, but do not
* actually post it.
*/
// const validateOnly = true
// Imports the Iam library
const
{
PolicyBindingsClient
}
=
require
(
' @google-cloud/iam
'
).
v3
;
// Instantiates a client
const
iamClient
=
new
PolicyBindingsClient
();
async
function
callCreatePolicyBinding
()
{
// Construct request
const
request
=
{
parent
,
policyBindingId
,
policyBinding
,
};
// Run request
const
[
operation
]
=
await
iamClient
.
createPolicyBinding
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callCreatePolicyBinding
();
checkDeletePolicyBindingProgress(name)
checkDeletePolicyBindingProgress
(
name
:
string
)
:
Promise<LROperation<protos
.
google
.
protobuf
.
Empty
,
protos
.
google
.
iam
.
v3
.
OperationMetadata
>> ;
Check the status of the long running operation returned by deletePolicyBinding()
.
name
string
The operation name that will be passed.
Promise
< LROperation
< protos.google.protobuf.Empty
, protos.google.iam.v3.OperationMetadata
>>
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the policy binding to delete.
* Format:
* * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
* * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
* * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
* * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
*/
// const name = 'abc123'
/**
* Optional. The etag of the policy binding.
* If this is provided, it must match the server's etag.
*/
// const etag = 'abc123'
/**
* Optional. If set, validate the request and preview the deletion, but do not
* actually post it.
*/
// const validateOnly = true
// Imports the Iam library
const
{
PolicyBindingsClient
}
=
require
(
' @google-cloud/iam
'
).
v3
;
// Instantiates a client
const
iamClient
=
new
PolicyBindingsClient
();
async
function
callDeletePolicyBinding
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
[
operation
]
=
await
iamClient
.
deletePolicyBinding
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callDeletePolicyBinding
();
checkUpdatePolicyBindingProgress(name)
checkUpdatePolicyBindingProgress
(
name
:
string
)
:
Promise<LROperation<protos
.
google
.
iam
.
v3
.
PolicyBinding
,
protos
.
google
.
iam
.
v3
.
OperationMetadata
>> ;
Check the status of the long running operation returned by updatePolicyBinding()
.
name
string
The operation name that will be passed.
Promise
< LROperation
< protos.google.iam.v3.PolicyBinding
, protos.google.iam.v3.OperationMetadata
>>
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The policy binding to update.
* The policy binding's `name` field is used to identify the policy binding to
* update.
*/
// const policyBinding = {}
/**
* Optional. If set, validate the request and preview the update, but do not
* actually post it.
*/
// const validateOnly = true
/**
* Optional. The list of fields to update
*/
// const updateMask = {}
// Imports the Iam library
const
{
PolicyBindingsClient
}
=
require
(
' @google-cloud/iam
'
).
v3
;
// Instantiates a client
const
iamClient
=
new
PolicyBindingsClient
();
async
function
callUpdatePolicyBinding
()
{
// Construct request
const
request
=
{
policyBinding
,
};
// Run request
const
[
operation
]
=
await
iamClient
.
updatePolicyBinding
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callUpdatePolicyBinding
();
close()
close
()
:
Promise<void>
;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Promise
<void>
{Promise} A promise that resolves when the client is closed.
createPolicyBinding(request, options)
createPolicyBinding
(
request
?:
protos
.
google
.
iam
.
v3
.
ICreatePolicyBindingRequest
,
options
?:
CallOptions
)
:
Promise
< [
LROperation<protos
.
google
.
iam
.
v3
.
IPolicyBinding
,
protos
.
google
.
iam
.
v3
.
IOperationMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
undefined
,
{}
|
undefined
]>;
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
request
options
Promise
<[ LROperation
< protos.google.iam.v3.IPolicyBinding
, protos.google.iam.v3.IOperationMetadata
>, protos.google.longrunning.IOperation
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise()
method returns a promise you can await
for. Please see the documentation
for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource where this policy binding will be created.
* The binding parent is the closest Resource Manager resource (project,
* folder or organization) to the binding target.
* Format:
* * `projects/{project_id}/locations/{location}`
* * `projects/{project_number}/locations/{location}`
* * `folders/{folder_id}/locations/{location}`
* * `organizations/{organization_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. The ID to use for the policy binding, which will become the final
* component of the policy binding's resource name.
* This value must start with a lowercase letter followed by up to 62
* lowercase letters, numbers, hyphens, or dots. Pattern,
* /[a-z][a-z0-9-\.]{2,62}/.
*/
// const policyBindingId = 'abc123'
/**
* Required. The policy binding to create.
*/
// const policyBinding = {}
/**
* Optional. If set, validate the request and preview the creation, but do not
* actually post it.
*/
// const validateOnly = true
// Imports the Iam library
const
{
PolicyBindingsClient
}
=
require
(
' @google-cloud/iam
'
).
v3
;
// Instantiates a client
const
iamClient
=
new
PolicyBindingsClient
();
async
function
callCreatePolicyBinding
()
{
// Construct request
const
request
=
{
parent
,
policyBindingId
,
policyBinding
,
};
// Run request
const
[
operation
]
=
await
iamClient
.
createPolicyBinding
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callCreatePolicyBinding
();
createPolicyBinding(request, options, callback)
createPolicyBinding
(
request
:
protos
.
google
.
iam
.
v3
.
ICreatePolicyBindingRequest
,
options
:
CallOptions
,
callback
:
Callback<LROperation<protos
.
google
.
iam
.
v3
.
IPolicyBinding
,
protos
.
google
.
iam
.
v3
.
IOperationMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< LROperation
< protos.google.iam.v3.IPolicyBinding
, protos.google.iam.v3.IOperationMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
createPolicyBinding(request, callback)
createPolicyBinding
(
request
:
protos
.
google
.
iam
.
v3
.
ICreatePolicyBindingRequest
,
callback
:
Callback<LROperation<protos
.
google
.
iam
.
v3
.
IPolicyBinding
,
protos
.
google
.
iam
.
v3
.
IOperationMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< LROperation
< protos.google.iam.v3.IPolicyBinding
, protos.google.iam.v3.IOperationMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
deleteOperation(request, optionsOrCallback, callback)
deleteOperation
(
request
:
protos
.
google
.
longrunning
.
DeleteOperationRequest
,
optionsOrCallback
?:
gax
.
CallOptions
|
Callback<protos
.
google
.
protobuf
.
Empty
,
protos
.
google
.
longrunning
.
DeleteOperationRequest
,
{}
|
null
|
undefined
> ,
callback
?:
Callback<protos
.
google
.
protobuf
.
Empty
,
protos
.
google
.
longrunning
.
DeleteOperationRequest
,
{}
|
null
|
undefined
> )
:
Promise<protos
.
google
.
protobuf
.
Empty
> ;
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
.
request
optionsOrCallback
CallOptions
| Callback
< protos.google.protobuf.Empty
, protos.google.longrunning.DeleteOperationRequest
, {} | null | undefined>
callback
Callback
< protos.google.protobuf.Empty
, protos.google.longrunning.DeleteOperationRequest
, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
const
client
=
longrunning
.
operationsClient
();
await
client
.
deleteOperation
({
name
:
''
});
deletePolicyBinding(request, options)
deletePolicyBinding
(
request
?:
protos
.
google
.
iam
.
v3
.
IDeletePolicyBindingRequest
,
options
?:
CallOptions
)
:
Promise
< [
LROperation<protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
iam
.
v3
.
IOperationMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
undefined
,
{}
|
undefined
]>;
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
request
options
Promise
<[ LROperation
< protos.google.protobuf.IEmpty
, protos.google.iam.v3.IOperationMetadata
>, protos.google.longrunning.IOperation
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise()
method returns a promise you can await
for. Please see the documentation
for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the policy binding to delete.
* Format:
* * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
* * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
* * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
* * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
*/
// const name = 'abc123'
/**
* Optional. The etag of the policy binding.
* If this is provided, it must match the server's etag.
*/
// const etag = 'abc123'
/**
* Optional. If set, validate the request and preview the deletion, but do not
* actually post it.
*/
// const validateOnly = true
// Imports the Iam library
const
{
PolicyBindingsClient
}
=
require
(
' @google-cloud/iam
'
).
v3
;
// Instantiates a client
const
iamClient
=
new
PolicyBindingsClient
();
async
function
callDeletePolicyBinding
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
[
operation
]
=
await
iamClient
.
deletePolicyBinding
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callDeletePolicyBinding
();
deletePolicyBinding(request, options, callback)
deletePolicyBinding
(
request
:
protos
.
google
.
iam
.
v3
.
IDeletePolicyBindingRequest
,
options
:
CallOptions
,
callback
:
Callback<LROperation<protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
iam
.
v3
.
IOperationMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< LROperation
< protos.google.protobuf.IEmpty
, protos.google.iam.v3.IOperationMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
deletePolicyBinding(request, callback)
deletePolicyBinding
(
request
:
protos
.
google
.
iam
.
v3
.
IDeletePolicyBindingRequest
,
callback
:
Callback<LROperation<protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
iam
.
v3
.
IOperationMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< LROperation
< protos.google.protobuf.IEmpty
, protos.google.iam.v3.IOperationMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
folderLocationPolicyBindingPath(folder, location, policyBinding)
folderLocationPolicyBindingPath
(
folder
:
string
,
location
:
string
,
policyBinding
:
string
)
:
string
;
Return a fully-qualified folderLocationPolicyBinding resource name string.
folder
string
location
string
policyBinding
string
string
{string} Resource name string.
getLocation(request, options, callback)
getLocation
(
request
:
LocationProtos
.
google
.
cloud
.
location
.
IGetLocationRequest
,
options
?:
gax
.
CallOptions
|
Callback<LocationProtos
.
google
.
cloud
.
location
.
ILocation
,
LocationProtos
.
google
.
cloud
.
location
.
IGetLocationRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> ,
callback
?:
Callback<LocationProtos
.
google
.
cloud
.
location
.
ILocation
,
LocationProtos
.
google
.
cloud
.
location
.
IGetLocationRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
Promise<LocationProtos
.
google
.
cloud
.
location
.
ILocation
> ;
Gets information about a location.
request
LocationProtos.google.cloud.location.IGetLocationRequest
The request object that will be sent.
options
CallOptions
| Callback
< google.cloud.location.ILocation
, google.cloud.location.IGetLocationRequest
| null | undefined, {} | null | undefined>
Call options. See CallOptions for more details.
callback
Callback
< google.cloud.location.ILocation
, google.cloud.location.IGetLocationRequest
| null | undefined, {} | null | undefined>
Promise
< google.cloud.location.ILocation
>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.
const
[
response
]
=
await
client
.
getLocation
(
request
);
getOperation(request, optionsOrCallback, callback)
getOperation
(
request
:
protos
.
google
.
longrunning
.
GetOperationRequest
,
optionsOrCallback
?:
gax
.
CallOptions
|
Callback<protos
.
google
.
longrunning
.
Operation
,
protos
.
google
.
longrunning
.
GetOperationRequest
,
{}
|
null
|
undefined
> ,
callback
?:
Callback<protos
.
google
.
longrunning
.
Operation
,
protos
.
google
.
longrunning
.
GetOperationRequest
,
{}
|
null
|
undefined
> )
:
Promise
< [
protos
.
google
.
longrunning
.
Operation
]>;
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
request
optionsOrCallback
CallOptions
| Callback
< protos.google.longrunning.Operation
, protos.google.longrunning.GetOperationRequest
, {} | null | undefined>
callback
Callback
< protos.google.longrunning.Operation
, protos.google.longrunning.GetOperationRequest
, {} | null | undefined>
The function which will be called with the result of the API call.
The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.
const
client
=
longrunning
.
operationsClient
();
const
name
=
''
;
const
[
response
]
=
await
client
.
getOperation
({
name
});
// doThingsWith(response)
getPolicyBinding(request, options)
getPolicyBinding
(
request
?:
protos
.
google
.
iam
.
v3
.
IGetPolicyBindingRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
iam
.
v3
.
IPolicyBinding
,
protos
.
google
.
iam
.
v3
.
IGetPolicyBindingRequest
|
undefined
,
{}
|
undefined
]>;
Gets a policy binding.
request
options
Promise
<[ protos.google.iam.v3.IPolicyBinding
, protos.google.iam.v3.IGetPolicyBindingRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the policy binding to retrieve.
* Format:
* * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
* * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
* * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
* * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
*/
// const name = 'abc123'
// Imports the Iam library
const
{
PolicyBindingsClient
}
=
require
(
' @google-cloud/iam
'
).
v3
;
// Instantiates a client
const
iamClient
=
new
PolicyBindingsClient
();
async
function
callGetPolicyBinding
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
iamClient
.
getPolicyBinding
(
request
);
console
.
log
(
response
);
}
callGetPolicyBinding
();
getPolicyBinding(request, options, callback)
getPolicyBinding
(
request
:
protos
.
google
.
iam
.
v3
.
IGetPolicyBindingRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
iam
.
v3
.
IPolicyBinding
,
protos
.
google
.
iam
.
v3
.
IGetPolicyBindingRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.iam.v3.IPolicyBinding
, protos.google.iam.v3.IGetPolicyBindingRequest
| null | undefined, {} | null | undefined>
void
getPolicyBinding(request, callback)
getPolicyBinding
(
request
:
protos
.
google
.
iam
.
v3
.
IGetPolicyBindingRequest
,
callback
:
Callback<protos
.
google
.
iam
.
v3
.
IPolicyBinding
,
protos
.
google
.
iam
.
v3
.
IGetPolicyBindingRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.iam.v3.IPolicyBinding
, protos.google.iam.v3.IGetPolicyBindingRequest
| null | undefined, {} | null | undefined>
void
getProjectId()
getProjectId
()
:
Promise<string>
;
Promise
<string>
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
callback
Callback
<string, undefined, undefined>
void
initialize()
initialize
()
:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Promise
<{
[name: string]: Function
;
}>
{Promise} A promise that resolves to an authenticated service stub.
listLocationsAsync(request, options)
listLocationsAsync
(
request
:
LocationProtos
.
google
.
cloud
.
location
.
IListLocationsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<LocationProtos
.
google
.
cloud
.
location
.
ILocation
> ;
Lists information about the supported locations for this service. Returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent.
options
AsyncIterable
< google.cloud.location.ILocation
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.
const
iterable
=
client
.
listLocationsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
// process response
}
listOperationsAsync(request, options)
listOperationsAsync
(
request
:
protos
.
google
.
longrunning
.
ListOperationsRequest
,
options
?:
gax
.
CallOptions
)
:
AsyncIterable<protos
.
google
.
longrunning
.
IOperation
> ;
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED
. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
request
options
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
AsyncIterable
< protos.google.longrunning.IOperation
>
{Object} An iterable Object that conforms to iteration protocols .
const
client
=
longrunning
.
operationsClient
();
for
await
(
const
response
of
client
.
listOperationsAsync
(
request
));
// doThingsWith(response)
listPolicyBindings(request, options)
listPolicyBindings
(
request
?:
protos
.
google
.
iam
.
v3
.
IListPolicyBindingsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
iam
.
v3
.
IPolicyBinding
[],
protos
.
google
.
iam
.
v3
.
IListPolicyBindingsRequest
|
null
,
protos
.
google
.
iam
.
v3
.
IListPolicyBindingsResponse
]>;
Lists policy bindings.
request
options
Promise
<[ protos.google.iam.v3.IPolicyBinding
[], protos.google.iam.v3.IListPolicyBindingsRequest
| null, protos.google.iam.v3.IListPolicyBindingsResponse
]>
{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listPolicyBindingsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
listPolicyBindings(request, options, callback)
listPolicyBindings
(
request
:
protos
.
google
.
iam
.
v3
.
IListPolicyBindingsRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
iam
.
v3
.
IListPolicyBindingsRequest
,
protos
.
google
.
iam
.
v3
.
IListPolicyBindingsResponse
|
null
|
undefined
,
protos
.
google
.
iam
.
v3
.
IPolicyBinding
> )
:
void
;
request
options
CallOptions
callback
PaginationCallback
< protos.google.iam.v3.IListPolicyBindingsRequest
, protos.google.iam.v3.IListPolicyBindingsResponse
| null | undefined, protos.google.iam.v3.IPolicyBinding
>
void
listPolicyBindings(request, callback)
listPolicyBindings
(
request
:
protos
.
google
.
iam
.
v3
.
IListPolicyBindingsRequest
,
callback
:
PaginationCallback<protos
.
google
.
iam
.
v3
.
IListPolicyBindingsRequest
,
protos
.
google
.
iam
.
v3
.
IListPolicyBindingsResponse
|
null
|
undefined
,
protos
.
google
.
iam
.
v3
.
IPolicyBinding
> )
:
void
;
request
callback
PaginationCallback
< protos.google.iam.v3.IListPolicyBindingsRequest
, protos.google.iam.v3.IListPolicyBindingsResponse
| null | undefined, protos.google.iam.v3.IPolicyBinding
>
void
listPolicyBindingsAsync(request, options)
listPolicyBindingsAsync
(
request
?:
protos
.
google
.
iam
.
v3
.
IListPolicyBindingsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
iam
.
v3
.
IPolicyBinding
> ;
Equivalent to listPolicyBindings
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
options
AsyncIterable
< protos.google.iam.v3.IPolicyBinding
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource, which owns the collection of policy
* bindings.
* Format:
* * `projects/{project_id}/locations/{location}`
* * `projects/{project_number}/locations/{location}`
* * `folders/{folder_id}/locations/{location}`
* * `organizations/{organization_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of policy bindings to return. The service may
* return fewer than this value.
* If unspecified, at most 50 policy bindings will be returned.
* The maximum value is 1000; values above 1000 will be coerced to 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListPolicyBindings` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListPolicyBindings` must
* match the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Optional. An expression for filtering the results of the request. Filter
* rules are case insensitive. Some eligible fields for filtering are:
* + `target`
* + `policy`
* Some examples of filter queries:
* * `target:ex*`: The binding target's name starts with "ex".
* * `target:example`: The binding target's name is `example`.
* * `policy:example`: The binding policy's name is `example`.
*/
// const filter = 'abc123'
// Imports the Iam library
const
{
PolicyBindingsClient
}
=
require
(
' @google-cloud/iam
'
).
v3
;
// Instantiates a client
const
iamClient
=
new
PolicyBindingsClient
();
async
function
callListPolicyBindings
()
{
// Construct request
const
request
=
{
parent
,
};
// Run request
const
iterable
=
iamClient
.
listPolicyBindingsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
console
.
log
(
response
);
}
}
callListPolicyBindings
();
listPolicyBindingsStream(request, options)
listPolicyBindingsStream
(
request
?:
protos
.
google
.
iam
.
v3
.
IListPolicyBindingsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to listPolicyBindings
, but returns a NodeJS Stream object.
request
options
Transform
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listPolicyBindingsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
matchFolderFromFolderLocationPolicyBindingName(folderLocationPolicyBindingName)
matchFolderFromFolderLocationPolicyBindingName
(
folderLocationPolicyBindingName
:
string
)
:
string
|
number
;
Parse the folder from FolderLocationPolicyBinding resource.
folderLocationPolicyBindingName
string
A fully-qualified path representing folder_location_policy_binding resource.
string | number
{string} A string representing the folder.
matchLocationFromFolderLocationPolicyBindingName(folderLocationPolicyBindingName)
matchLocationFromFolderLocationPolicyBindingName
(
folderLocationPolicyBindingName
:
string
)
:
string
|
number
;
Parse the location from FolderLocationPolicyBinding resource.
folderLocationPolicyBindingName
string
A fully-qualified path representing folder_location_policy_binding resource.
string | number
{string} A string representing the location.
matchLocationFromOrganizationLocationName(organizationLocationName)
matchLocationFromOrganizationLocationName
(
organizationLocationName
:
string
)
:
string
|
number
;
Parse the location from OrganizationLocation resource.
organizationLocationName
string
A fully-qualified path representing OrganizationLocation resource.
string | number
{string} A string representing the location.
matchLocationFromOrganizationLocationPolicyBindingName(organizationLocationPolicyBindingName)
matchLocationFromOrganizationLocationPolicyBindingName
(
organizationLocationPolicyBindingName
:
string
)
:
string
|
number
;
Parse the location from OrganizationLocationPolicyBinding resource.
organizationLocationPolicyBindingName
string
A fully-qualified path representing organization_location_policy_binding resource.
string | number
{string} A string representing the location.
matchLocationFromPrincipalAccessBoundaryPolicyName(principalAccessBoundaryPolicyName)
matchLocationFromPrincipalAccessBoundaryPolicyName
(
principalAccessBoundaryPolicyName
:
string
)
:
string
|
number
;
Parse the location from PrincipalAccessBoundaryPolicy resource.
principalAccessBoundaryPolicyName
string
A fully-qualified path representing PrincipalAccessBoundaryPolicy resource.
string | number
{string} A string representing the location.
matchLocationFromProjectLocationPolicyBindingName(projectLocationPolicyBindingName)
matchLocationFromProjectLocationPolicyBindingName
(
projectLocationPolicyBindingName
:
string
)
:
string
|
number
;
Parse the location from ProjectLocationPolicyBinding resource.
projectLocationPolicyBindingName
string
A fully-qualified path representing project_location_policy_binding resource.
string | number
{string} A string representing the location.
matchOrganizationFromOrganizationLocationName(organizationLocationName)
matchOrganizationFromOrganizationLocationName
(
organizationLocationName
:
string
)
:
string
|
number
;
Parse the organization from OrganizationLocation resource.
organizationLocationName
string
A fully-qualified path representing OrganizationLocation resource.
string | number
{string} A string representing the organization.
matchOrganizationFromOrganizationLocationPolicyBindingName(organizationLocationPolicyBindingName)
matchOrganizationFromOrganizationLocationPolicyBindingName
(
organizationLocationPolicyBindingName
:
string
)
:
string
|
number
;
Parse the organization from OrganizationLocationPolicyBinding resource.
organizationLocationPolicyBindingName
string
A fully-qualified path representing organization_location_policy_binding resource.
string | number
{string} A string representing the organization.
matchOrganizationFromOrganizationName(organizationName)
matchOrganizationFromOrganizationName
(
organizationName
:
string
)
:
string
|
number
;
Parse the organization from Organization resource.
organizationName
string
A fully-qualified path representing Organization resource.
string | number
{string} A string representing the organization.
matchOrganizationFromPrincipalAccessBoundaryPolicyName(principalAccessBoundaryPolicyName)
matchOrganizationFromPrincipalAccessBoundaryPolicyName
(
principalAccessBoundaryPolicyName
:
string
)
:
string
|
number
;
Parse the organization from PrincipalAccessBoundaryPolicy resource.
principalAccessBoundaryPolicyName
string
A fully-qualified path representing PrincipalAccessBoundaryPolicy resource.
string | number
{string} A string representing the organization.
matchPolicyBindingFromFolderLocationPolicyBindingName(folderLocationPolicyBindingName)
matchPolicyBindingFromFolderLocationPolicyBindingName
(
folderLocationPolicyBindingName
:
string
)
:
string
|
number
;
Parse the policy_binding from FolderLocationPolicyBinding resource.
folderLocationPolicyBindingName
string
A fully-qualified path representing folder_location_policy_binding resource.
string | number
{string} A string representing the policy_binding.
matchPolicyBindingFromOrganizationLocationPolicyBindingName(organizationLocationPolicyBindingName)
matchPolicyBindingFromOrganizationLocationPolicyBindingName
(
organizationLocationPolicyBindingName
:
string
)
:
string
|
number
;
Parse the policy_binding from OrganizationLocationPolicyBinding resource.
organizationLocationPolicyBindingName
string
A fully-qualified path representing organization_location_policy_binding resource.
string | number
{string} A string representing the policy_binding.
matchPolicyBindingFromProjectLocationPolicyBindingName(projectLocationPolicyBindingName)
matchPolicyBindingFromProjectLocationPolicyBindingName
(
projectLocationPolicyBindingName
:
string
)
:
string
|
number
;
Parse the policy_binding from ProjectLocationPolicyBinding resource.
projectLocationPolicyBindingName
string
A fully-qualified path representing project_location_policy_binding resource.
string | number
{string} A string representing the policy_binding.
matchPrincipalAccessBoundaryPolicyFromPrincipalAccessBoundaryPolicyName(principalAccessBoundaryPolicyName)
matchPrincipalAccessBoundaryPolicyFromPrincipalAccessBoundaryPolicyName
(
principalAccessBoundaryPolicyName
:
string
)
:
string
|
number
;
Parse the principal_access_boundary_policy from PrincipalAccessBoundaryPolicy resource.
principalAccessBoundaryPolicyName
string
A fully-qualified path representing PrincipalAccessBoundaryPolicy resource.
string | number
{string} A string representing the principal_access_boundary_policy.
matchProjectFromProjectLocationPolicyBindingName(projectLocationPolicyBindingName)
matchProjectFromProjectLocationPolicyBindingName
(
projectLocationPolicyBindingName
:
string
)
:
string
|
number
;
Parse the project from ProjectLocationPolicyBinding resource.
projectLocationPolicyBindingName
string
A fully-qualified path representing project_location_policy_binding resource.
string | number
{string} A string representing the project.
organizationLocationPath(organization, location)
organizationLocationPath
(
organization
:
string
,
location
:
string
)
:
string
;
Return a fully-qualified organizationLocation resource name string.
organization
string
location
string
string
{string} Resource name string.
organizationLocationPolicyBindingPath(organization, location, policyBinding)
organizationLocationPolicyBindingPath
(
organization
:
string
,
location
:
string
,
policyBinding
:
string
)
:
string
;
Return a fully-qualified organizationLocationPolicyBinding resource name string.
organization
string
location
string
policyBinding
string
string
{string} Resource name string.
organizationPath(organization)
organizationPath
(
organization
:
string
)
:
string
;
Return a fully-qualified organization resource name string.
organization
string
string
{string} Resource name string.
principalAccessBoundaryPolicyPath(organization, location, principalAccessBoundaryPolicy)
principalAccessBoundaryPolicyPath
(
organization
:
string
,
location
:
string
,
principalAccessBoundaryPolicy
:
string
)
:
string
;
Return a fully-qualified principalAccessBoundaryPolicy resource name string.
organization
string
location
string
principalAccessBoundaryPolicy
string
string
{string} Resource name string.
projectLocationPolicyBindingPath(project, location, policyBinding)
projectLocationPolicyBindingPath
(
project
:
string
,
location
:
string
,
policyBinding
:
string
)
:
string
;
Return a fully-qualified projectLocationPolicyBinding resource name string.
project
string
location
string
policyBinding
string
string
{string} Resource name string.
searchTargetPolicyBindings(request, options)
searchTargetPolicyBindings
(
request
?:
protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
iam
.
v3
.
IPolicyBinding
[],
protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsRequest
|
null
,
protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsResponse
]>;
Search policy bindings by target. Returns all policy binding objects bound directly to target.
request
options
Promise
<[ protos.google.iam.v3.IPolicyBinding
[], protos.google.iam.v3.ISearchTargetPolicyBindingsRequest
| null, protos.google.iam.v3.ISearchTargetPolicyBindingsResponse
]>
{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using searchTargetPolicyBindingsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
searchTargetPolicyBindings(request, options, callback)
searchTargetPolicyBindings
(
request
:
protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsRequest
,
protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsResponse
|
null
|
undefined
,
protos
.
google
.
iam
.
v3
.
IPolicyBinding
> )
:
void
;
options
CallOptions
callback
PaginationCallback
< protos.google.iam.v3.ISearchTargetPolicyBindingsRequest
, protos.google.iam.v3.ISearchTargetPolicyBindingsResponse
| null | undefined, protos.google.iam.v3.IPolicyBinding
>
void
searchTargetPolicyBindings(request, callback)
searchTargetPolicyBindings
(
request
:
protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsRequest
,
callback
:
PaginationCallback<protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsRequest
,
protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsResponse
|
null
|
undefined
,
protos
.
google
.
iam
.
v3
.
IPolicyBinding
> )
:
void
;
callback
PaginationCallback
< protos.google.iam.v3.ISearchTargetPolicyBindingsRequest
, protos.google.iam.v3.ISearchTargetPolicyBindingsResponse
| null | undefined, protos.google.iam.v3.IPolicyBinding
>
void
searchTargetPolicyBindingsAsync(request, options)
searchTargetPolicyBindingsAsync
(
request
?:
protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
iam
.
v3
.
IPolicyBinding
> ;
Equivalent to searchTargetPolicyBindings
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
options
AsyncIterable
< protos.google.iam.v3.IPolicyBinding
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The target resource, which is bound to the policy in the binding.
* Format:
* * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
* * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
* * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
* * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
* * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
* * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
*/
// const target = 'abc123'
/**
* Optional. The maximum number of policy bindings to return. The service may
* return fewer than this value.
* If unspecified, at most 50 policy bindings will be returned.
* The maximum value is 1000; values above 1000 will be coerced to 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous
* `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
* subsequent page.
* When paginating, all other parameters provided to
* `SearchTargetPolicyBindingsRequest` must match the call that provided the
* page token.
*/
// const pageToken = 'abc123'
/**
* Required. The parent resource where this search will be performed. This
* should be the nearest Resource Manager resource (project, folder, or
* organization) to the target.
* Format:
* * `projects/{project_id}/locations/{location}`
* * `projects/{project_number}/locations/{location}`
* * `folders/{folder_id}/locations/{location}`
* * `organizations/{organization_id}/locations/{location}`
*/
// const parent = 'abc123'
// Imports the Iam library
const
{
PolicyBindingsClient
}
=
require
(
' @google-cloud/iam
'
).
v3
;
// Instantiates a client
const
iamClient
=
new
PolicyBindingsClient
();
async
function
callSearchTargetPolicyBindings
()
{
// Construct request
const
request
=
{
target
,
parent
,
};
// Run request
const
iterable
=
iamClient
.
searchTargetPolicyBindingsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
console
.
log
(
response
);
}
}
callSearchTargetPolicyBindings
();
searchTargetPolicyBindingsStream(request, options)
searchTargetPolicyBindingsStream
(
request
?:
protos
.
google
.
iam
.
v3
.
ISearchTargetPolicyBindingsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to searchTargetPolicyBindings
, but returns a NodeJS Stream object.
request
options
Transform
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using searchTargetPolicyBindingsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
updatePolicyBinding(request, options)
updatePolicyBinding
(
request
?:
protos
.
google
.
iam
.
v3
.
IUpdatePolicyBindingRequest
,
options
?:
CallOptions
)
:
Promise
< [
LROperation<protos
.
google
.
iam
.
v3
.
IPolicyBinding
,
protos
.
google
.
iam
.
v3
.
IOperationMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
undefined
,
{}
|
undefined
]>;
Updates a policy binding and returns a long-running operation. Callers will need the IAM permissions on the policy and target in the binding to update, and the IAM permission to remove the existing policy from the binding. Target is immutable and cannot be updated. Once the binding is updated, the new policy is applied to the target.
request
options
Promise
<[ LROperation
< protos.google.iam.v3.IPolicyBinding
, protos.google.iam.v3.IOperationMetadata
>, protos.google.longrunning.IOperation
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise()
method returns a promise you can await
for. Please see the documentation
for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The policy binding to update.
* The policy binding's `name` field is used to identify the policy binding to
* update.
*/
// const policyBinding = {}
/**
* Optional. If set, validate the request and preview the update, but do not
* actually post it.
*/
// const validateOnly = true
/**
* Optional. The list of fields to update
*/
// const updateMask = {}
// Imports the Iam library
const
{
PolicyBindingsClient
}
=
require
(
' @google-cloud/iam
'
).
v3
;
// Instantiates a client
const
iamClient
=
new
PolicyBindingsClient
();
async
function
callUpdatePolicyBinding
()
{
// Construct request
const
request
=
{
policyBinding
,
};
// Run request
const
[
operation
]
=
await
iamClient
.
updatePolicyBinding
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callUpdatePolicyBinding
();
updatePolicyBinding(request, options, callback)
updatePolicyBinding
(
request
:
protos
.
google
.
iam
.
v3
.
IUpdatePolicyBindingRequest
,
options
:
CallOptions
,
callback
:
Callback<LROperation<protos
.
google
.
iam
.
v3
.
IPolicyBinding
,
protos
.
google
.
iam
.
v3
.
IOperationMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< LROperation
< protos.google.iam.v3.IPolicyBinding
, protos.google.iam.v3.IOperationMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
updatePolicyBinding(request, callback)
updatePolicyBinding
(
request
:
protos
.
google
.
iam
.
v3
.
IUpdatePolicyBindingRequest
,
callback
:
Callback<LROperation<protos
.
google
.
iam
.
v3
.
IPolicyBinding
,
protos
.
google
.
iam
.
v3
.
IOperationMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< LROperation
< protos.google.iam.v3.IPolicyBinding
, protos.google.iam.v3.IOperationMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void