forked from googleapis/nodejs-pubsub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helperMethods.ts.tmpl
33 lines (32 loc) · 1.44 KB
/
helperMethods.ts.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* This part will be added into src/v1/key_management_service_client.ts by synth.py.
* KMS service requires IAM client for [setIamPolicy, getIamPolicy, testIamPerssion] methods.
* But we don't support it now in micro-generators for rerouting one service to another and mix them in.
* New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315]
*
* So this is manually written for providing methods to the KMS client.
* IamClient is created for KMS client in the constructor using src/helper.ts.
* [setIamPolicy, getIamPolicy, testIamPerssion] methods are created which is calling the corresponding methods from IamClient in `helper.ts`.
*/
getIamPolicy(
request: protos.google.iam.v1.GetIamPolicyRequest,
options: gax.CallOptions,
callback: protos.google.iam.v1.IAMPolicy.GetIamPolicyCallback
) {
return this._iamClient.getIamPolicy(request, options, callback);
}
setIamPolicy(
request: protos.google.iam.v1.SetIamPolicyRequest,
options: gax.CallOptions,
callback: protos.google.iam.v1.IAMPolicy.SetIamPolicyCallback
) {
return this._iamClient.setIamPolicy(request, options, callback);
}
testIamPermissions(
request: protos.google.iam.v1.TestIamPermissionsRequest,
options: gax.CallOptions,
callback?: protos.google.iam.v1.IAMPolicy.TestIamPermissionsCallback
) {
return this._iamClient.testIamPermissions(request, options, callback);
}
}