Skip to content

Commit

Permalink
copy protos to build/
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhenliu-gg5 committed Sep 30, 2019
1 parent c179f97 commit 028eb20
Showing 1 changed file with 3 additions and 40 deletions.
43 changes: 3 additions & 40 deletions templates/typescript_gapic/src/$version/$service_client.ts.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as gax from 'google-gax';
import * as path from 'path';

import * as packageJson from '../../package.json';
import * as protos from '../../pbjs-genfiles/protos';
import * as protos from '../../protos/protos';
import * as gapicConfig from './echo_client_config.json';

const version = packageJson.version;
Expand Down Expand Up @@ -181,7 +181,8 @@ export class {{ service.name }}Client {
opts.fallback ?
// @ts-ignore
gaxProtos.lookupService('{{api.naming.protoPackage}}.{{ service.name }}') :
protos.{{api.naming.protoPackage}}.{{ service.name }},
// @ts-ignore
gaxProtos.{{api.naming.protoPackage}}.{{ service.name }},
opts);

const {{ service.name.toCamelCase() }}StubMethods =
Expand Down Expand Up @@ -356,42 +357,4 @@ export class {{ service.name }}Client {
}
{%- endif %}
{% endfor %}
{% for method in service.longRunning %}
{{ method.name.toCamelCase() }}(
request: protos{{ method.inputInterface }},
options?: gax.CallOptions):
Promise<[
protos{{ method.outputInterface }},
protos{{ method.inputInterface }}|undefined, {}|undefined
]>;
{{ method.name.toCamelCase() }}(
request: protos{{ method.inputInterface }},
options: gax.CallOptions,
callback: Callback<
protos{{ method.outputInterface }},
protos{{ method.inputInterface }}|undefined,
{}|undefined>): void;
{{ method.name.toCamelCase() }}(
request: protos{{ method.inputInterface }},
optionsOrCallback?: gax.CallOptions|Callback<
protos{{ method.outputInterface }},
protos{{ method.inputInterface }}|undefined, {}|undefined>,
callback?: Callback<
protos{{ method.outputInterface }},
protos{{ method.inputInterface }}|undefined,
{}|undefined>):
Promise<[
protos{{ method.outputInterface }},
protos{{ method.inputInterface }}|undefined, {}|undefined
]>|void {
request = request || {};
let options = optionsOrCallback;
if (typeof options === 'function' && callback === undefined) {
callback = options;
options = {};
}
options = options || {};
return this._innerApiCalls.{{ method.name.toCamelCase() }}(request, options, callback);
}
{% endfor %}
}

0 comments on commit 028eb20

Please sign in to comment.