Skip to content

Commit

Permalink
fix: use require() to load JSON protos (#442)
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 937f27a commit f9f768d
Show file tree
Hide file tree
Showing 9 changed files with 3,224 additions and 3,242 deletions.
1,228 changes: 614 additions & 614 deletions packages/google-cloud-oslogin/protos/protos.d.ts

Large diffs are not rendered by default.

4,756 changes: 2,378 additions & 2,378 deletions packages/google-cloud-oslogin/protos/protos.js

Large diffs are not rendered by default.

408 changes: 204 additions & 204 deletions packages/google-cloud-oslogin/protos/protos.json

Large diffs are not rendered by default.

18 changes: 2 additions & 16 deletions packages/google-cloud-oslogin/src/v1/os_login_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax';
import * as path from 'path';

import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
/**
* Client JSON configuration object, loaded from
* `src/v1/os_login_service_client_config.json`.
Expand Down Expand Up @@ -139,22 +140,7 @@ export class OsLoginServiceClient {
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,27 +21,33 @@
},
"methods": {
"DeletePosixAccount": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"DeleteSshPublicKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetLoginProfile": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetSshPublicKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"ImportSshPublicKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"UpdateSshPublicKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[
"../../protos/google/cloud/oslogin/common/common.proto",
"../../protos/google/cloud/oslogin/v1/oslogin.proto"
]
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax';
import * as path from 'path';

import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
/**
* Client JSON configuration object, loaded from
* `src/v1beta/os_login_service_client_config.json`.
Expand Down Expand Up @@ -139,22 +140,7 @@ export class OsLoginServiceClient {
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,27 +21,33 @@
},
"methods": {
"DeletePosixAccount": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"DeleteSshPublicKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetLoginProfile": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetSshPublicKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"ImportSshPublicKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"UpdateSshPublicKey": {
"retry_codes_name": "non_idempotent",
"timeout_millis": 10000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[
"../../protos/google/cloud/oslogin/common/common.proto",
"../../protos/google/cloud/oslogin/v1beta/oslogin.proto"
]

0 comments on commit f9f768d

Please sign in to comment.