File tree Expand file tree Collapse file tree
packages/google-cloud-bigquery-reservation/src/v1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import * as path from 'path';
3131import { Transform } from 'stream' ;
3232import { RequestType } from 'google-gax/build/src/apitypes' ;
3333import * as protos from '../../protos/protos' ;
34+ import jsonProtos = require( '../../protos/protos.json' ) ;
3435/**
3536 * Client JSON configuration object, loaded from
3637 * `src/v1/reservation_service_client_config.json`.
@@ -159,22 +160,7 @@ export class ReservationServiceClient {
159160 clientHeader . push ( `${ opts . libName } /${ opts . libVersion } ` ) ;
160161 }
161162 // Load the applicable protos.
162- // For Node.js, pass the path to JSON proto file.
163- // For browsers, pass the JSON content.
164-
165- const nodejsProtoPath = path . join (
166- __dirname ,
167- '..' ,
168- '..' ,
169- 'protos' ,
170- 'protos.json'
171- ) ;
172- this . _protos = this . _gaxGrpc . loadProto (
173- opts . fallback
174- ? // eslint-disable-next-line @typescript-eslint/no-var-requires
175- require ( '../../protos/protos.json' )
176- : nodejsProtoPath
177- ) ;
163+ this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ;
178164
179165 // This API contains "path templates"; forward-slash-separated
180166 // identifiers to uniquely identify resources within the API.
You can’t perform that action at this time.
0 commit comments