@@ -23,6 +23,7 @@ import {
2323 CallOptions ,
2424 Descriptors ,
2525 ClientOptions ,
26+ GrpcClientOptions ,
2627 LROperation ,
2728 PaginationCallback ,
2829 GaxCall ,
@@ -73,7 +74,7 @@ export class TagBindingsClient {
7374 *
7475 * @param {object } [options] - The configuration object.
7576 * The options accepted by the constructor are described in detail
76- * in [this document](https://github.com/googleapis/gax-nodejs/blob/master /client-libraries.md#creating-the-client-instance).
77+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main /client-libraries.md#creating-the-client-instance).
7778 * The common options are:
7879 * @param {object } [options.credentials] - Credentials object.
7980 * @param {string } [options.credentials.client_email]
@@ -96,11 +97,10 @@ export class TagBindingsClient {
9697 * API remote host.
9798 * @param {gax.ClientConfig } [options.clientConfig] - Client configuration override.
9899 * Follows the structure of {@link gapicConfig}.
99- * @param {boolean } [options.fallback] - Use HTTP fallback mode.
100- * In fallback mode, a special browser-compatible transport implementation is used
101- * instead of gRPC transport. In browser context (if the `window` object is defined)
102- * the fallback mode is enabled automatically; set `options.fallback` to `false`
103- * if you need to override this behavior.
100+ * @param {boolean | "rest" } [options.fallback] - Use HTTP fallback mode.
101+ * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
102+ * For more information, please check the
103+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
104104 */
105105 constructor ( opts ?: ClientOptions ) {
106106 // Ensure that options include all the required fields.
@@ -195,16 +195,24 @@ export class TagBindingsClient {
195195 } ;
196196
197197 const protoFilesRoot = this . _gaxModule . protobuf . Root . fromJSON ( jsonProtos ) ;
198-
199198 // This API contains "long-running operations", which return a
200199 // an Operation object that allows for tracking of the operation,
201200 // rather than holding a request open.
202-
201+ const lroOptions : GrpcClientOptions = {
202+ auth : this . auth ,
203+ grpc : 'grpc' in this . _gaxGrpc ? this . _gaxGrpc . grpc : undefined ,
204+ } ;
205+ if ( opts . fallback === 'rest' ) {
206+ lroOptions . protoJson = protoFilesRoot ;
207+ lroOptions . httpRules = [
208+ {
209+ selector : 'google.longrunning.Operations.GetOperation' ,
210+ get : '/v3/{name=operations/**}' ,
211+ } ,
212+ ] ;
213+ }
203214 this . operationsClient = this . _gaxModule
204- . lro ( {
205- auth : this . auth ,
206- grpc : 'grpc' in this . _gaxGrpc ? this . _gaxGrpc . grpc : undefined ,
207- } )
215+ . lro ( lroOptions )
208216 . operationsClient ( opts ) ;
209217 const createTagBindingResponse = protoFilesRoot . lookup (
210218 '.google.cloud.resourcemanager.v3.TagBinding'
0 commit comments