Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -438,18 +438,21 @@ export class {{ service.name }}Client {
(this._protos as any).{{api.naming.protoPackage}}.{{ service.name }},
this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
// and create an API call method for each.
const {{ service.name.toCamelCase() }}StubMethods =
[
{%- set stubMethodsContent %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the indentation on this funky? (sorry, super-nit)

{%- set stubMethodsJoiner = joiner(', ') -%}
{%- for method in service.method -%}
{%- if not method.ignoreMapPagingMethod %}
{{- stubMethodsJoiner() -}}
'{{ method.name.toCamelCase(true) }}'
{%- endif %}
{%- endfor -%}
];
{% endset -%}
{%- if stubMethodsContent | trim %}

// Iterate over each of the methods that the service provides
// and create an API call method for each.
const {{ service.name.toCamelCase() }}StubMethods =
[{{ stubMethodsContent | safe }}];
for (const methodName of {{ service.name.toCamelCase() }}StubMethods) {
const callPromise = this.{{ service.name.toCamelCase() }}Stub.then(
stub => (...args: Array<{}>) => {
Expand Down Expand Up @@ -495,6 +498,7 @@ export class {{ service.name }}Client {

this.innerApiCalls[methodName] = apiCall;
}
{%- endif -%}
{%- if service.options and service.options.deprecated %}
this.warn('DEP${{service.name}}', '{{service.name}} is deprecated and may be removed in a future version.', 'DeprecationWarning');
{%- endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,21 @@ export class {{ service.name }}Client {
(this._protos as any).{{api.naming.protoPackage}}.{{ service.name }},
this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
// and create an API call method for each.
const {{ service.name.toCamelCase() }}StubMethods =
[
{%- set stubMethodsContent %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no actually! I ran the baseline test so it didn't end up changing anything currently

{%- set stubMethodsJoiner = joiner(', ') -%}
{%- for method in service.method -%}
{%- if not method.ignoreMapPagingMethod %}
{{- stubMethodsJoiner() -}}
'{{ method.name.toCamelCase(true) }}'
{%- endif %}
{%- endfor -%}
];
{% endset -%}
{%- if stubMethodsContent | trim %}

// Iterate over each of the methods that the service provides
// and create an API call method for each.
const {{ service.name.toCamelCase() }}StubMethods =
[{{ stubMethodsContent | safe }}];
for (const methodName of {{ service.name.toCamelCase() }}StubMethods) {
const callPromise = this.{{ service.name.toCamelCase() }}Stub.then(
stub => (...args: Array<{}>) => {
Expand Down Expand Up @@ -506,6 +509,7 @@ export class {{ service.name }}Client {

this.innerApiCalls[methodName] = apiCall;
}
{%- endif -%}
{%- if service.options and service.options.deprecated %}
this.warn('DEP${{service.name}}', '{{service.name}} is deprecated and may be removed in a future version.', 'DeprecationWarning');
{%- endif %}
Expand Down
Loading