Skip to content

Commit

Permalink
fix: use require() to load JSON protos (#450)
Browse files Browse the repository at this point in the history
The library is regenerated with gapic-generator-typescript v1.3.1.

Committer: @alexander-fenster
PiperOrigin-RevId: 372468161

Source-Link: googleapis/googleapis@75880c3

Source-Link: googleapis/googleapis-gen@77b1804
  • Loading branch information
gcf-owl-bot[bot] authored May 11, 2021
1 parent 4179ef8 commit 373460f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 37 deletions.
18 changes: 2 additions & 16 deletions packages/google-cloud-kms/src/v1/key_management_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,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/v1/key_management_service_client_config.json`.
Expand Down Expand Up @@ -160,22 +161,7 @@ export class KeyManagementServiceClient {
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,95 +21,118 @@
},
"methods": {
"ListKeyRings": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"ListCryptoKeys": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"ListCryptoKeyVersions": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"ListImportJobs": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetKeyRing": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetCryptoKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetCryptoKeyVersion": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetPublicKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetImportJob": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"CreateKeyRing": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"CreateCryptoKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"CreateCryptoKeyVersion": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"ImportCryptoKeyVersion": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"CreateImportJob": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"UpdateCryptoKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"UpdateCryptoKeyVersion": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"Encrypt": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"Decrypt": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"AsymmetricSign": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"AsymmetricDecrypt": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"UpdateCryptoKeyPrimaryVersion": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"DestroyCryptoKeyVersion": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"RestoreCryptoKeyVersion": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
}
}
Expand Down

0 comments on commit 373460f

Please sign in to comment.