diff --git a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts index 455a2cb..5ec4efe 100644 --- a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts +++ b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts @@ -31,6 +31,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1beta1/binauthz_management_service_v1_beta1_client_config.json`. @@ -152,22 +153,7 @@ export class BinauthzManagementServiceV1Beta1Client { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API.