From 350626e47ae672496236c3f760a1a544092284fe Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:37:51 -0400 Subject: [PATCH] feat: support regapic LRO PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 PiperOrigin-RevId: 458552034 Source-Link: https://github.com/googleapis/googleapis/commit/ae65014049c6eb195741d7efbd0b10bee3f83d4f Source-Link: https://github.com/googleapis/googleapis-gen/commit/b09ede435cce110446d4ab9f62a081b571d37e3f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjA5ZWRlNDM1Y2NlMTEwNDQ2ZDRhYjlmNjJhMDgxYjU3MWQzN2UzZiJ9 Co-authored-by: Owl Bot Co-authored-by: Benjamin E. Coe --- src/v1/autoscaling_policy_service_client.ts | 11 +- src/v1/batch_controller_client.ts | 137 ++++++++++++++++++-- src/v1/cluster_controller_client.ts | 137 ++++++++++++++++++-- src/v1/job_controller_client.ts | 137 ++++++++++++++++++-- src/v1/workflow_template_service_client.ts | 137 ++++++++++++++++++-- 5 files changed, 505 insertions(+), 54 deletions(-) diff --git a/src/v1/autoscaling_policy_service_client.ts b/src/v1/autoscaling_policy_service_client.ts index 0b386ebb..41dcc2f2 100644 --- a/src/v1/autoscaling_policy_service_client.ts +++ b/src/v1/autoscaling_policy_service_client.ts @@ -71,7 +71,7 @@ export class AutoscalingPolicyServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -94,11 +94,10 @@ export class AutoscalingPolicyServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. diff --git a/src/v1/batch_controller_client.ts b/src/v1/batch_controller_client.ts index 932ec02e..58fd550a 100644 --- a/src/v1/batch_controller_client.ts +++ b/src/v1/batch_controller_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class BatchControllerClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -95,11 +96,10 @@ export class BatchControllerClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -205,16 +205,129 @@ export class BatchControllerClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/regions/*/operations/*}:cancel', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/regions/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/regions/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/regions/*/operations}', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createBatchResponse = protoFilesRoot.lookup( '.google.cloud.dataproc.v1.Batch' diff --git a/src/v1/cluster_controller_client.ts b/src/v1/cluster_controller_client.ts index 55978ccb..c4ac7922 100644 --- a/src/v1/cluster_controller_client.ts +++ b/src/v1/cluster_controller_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -73,7 +74,7 @@ export class ClusterControllerClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -96,11 +97,10 @@ export class ClusterControllerClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -203,16 +203,129 @@ export class ClusterControllerClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/regions/*/operations/*}:cancel', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/regions/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/regions/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/regions/*/operations}', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createClusterResponse = protoFilesRoot.lookup( '.google.cloud.dataproc.v1.Cluster' diff --git a/src/v1/job_controller_client.ts b/src/v1/job_controller_client.ts index 6dcbf9f9..2aa0bf74 100644 --- a/src/v1/job_controller_client.ts +++ b/src/v1/job_controller_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class JobControllerClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -95,11 +96,10 @@ export class JobControllerClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -199,16 +199,129 @@ export class JobControllerClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/regions/*/operations/*}:cancel', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/regions/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/regions/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/regions/*/operations}', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const submitJobAsOperationResponse = protoFilesRoot.lookup( '.google.cloud.dataproc.v1.Job' diff --git a/src/v1/workflow_template_service_client.ts b/src/v1/workflow_template_service_client.ts index 6a56366a..23f6cca4 100644 --- a/src/v1/workflow_template_service_client.ts +++ b/src/v1/workflow_template_service_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -73,7 +74,7 @@ export class WorkflowTemplateServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -96,11 +97,10 @@ export class WorkflowTemplateServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -207,16 +207,129 @@ export class WorkflowTemplateServiceClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/regions/*/operations/*}:cancel', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/regions/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/regions/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/regions/*/operations}', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const instantiateWorkflowTemplateResponse = protoFilesRoot.lookup( '.google.protobuf.Empty'