File tree Expand file tree Collapse file tree
packages/google-cloud-orgpolicy/src/v2 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/v2/org_policy_client_config.json`.
@@ -164,22 +165,7 @@ export class OrgPolicyClient {
164165 clientHeader . push ( `${ opts . libName } /${ opts . libVersion } ` ) ;
165166 }
166167 // Load the applicable protos.
167- // For Node.js, pass the path to JSON proto file.
168- // For browsers, pass the JSON content.
169-
170- const nodejsProtoPath = path . join (
171- __dirname ,
172- '..' ,
173- '..' ,
174- 'protos' ,
175- 'protos.json'
176- ) ;
177- this . _protos = this . _gaxGrpc . loadProto (
178- opts . fallback
179- ? // eslint-disable-next-line @typescript-eslint/no-var-requires
180- require ( '../../protos/protos.json' )
181- : nodejsProtoPath
182- ) ;
168+ this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ;
183169
184170 // This API contains "path templates"; forward-slash-separated
185171 // identifiers to uniquely identify resources within the API.
You can’t perform that action at this time.
0 commit comments