Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only import GaxCall if needed #374

Merged
merged 2 commits into from
Mar 31, 2020
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 @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax';
import * as path from 'path';

import * as protos from '../../protos/protos';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {BigQueryStorageClient} from 'storage';

function main() {
const bigQueryStorageClient = new BigQueryStorageClient();
new BigQueryStorageClient();
}

main();
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
2 changes: 1 addition & 1 deletion baselines/dlp/src/v2/dlp_service_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {DlpServiceClient} from 'dlp';

function main() {
const dlpServiceClient = new DlpServiceClient();
new DlpServiceClient();
}

main();
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {KeyManagementServiceClient} from 'kms';

function main() {
const keyManagementServiceClient = new KeyManagementServiceClient();
new KeyManagementServiceClient();
}

main();
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import {ConfigServiceV2Client, LoggingServiceV2Client, MetricsServiceV2Client} from 'logging';

function main() {
const configServiceV2Client = new ConfigServiceV2Client();
const loggingServiceV2Client = new LoggingServiceV2Client();
const metricsServiceV2Client = new MetricsServiceV2Client();
new ConfigServiceV2Client();
new LoggingServiceV2Client();
new MetricsServiceV2Client();
}

main();
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import {AlertPolicyServiceClient, GroupServiceClient, MetricServiceClient, NotificationChannelServiceClient, ServiceMonitoringServiceClient, UptimeCheckServiceClient} from 'monitoring';

function main() {
const alertPolicyServiceClient = new AlertPolicyServiceClient();
const groupServiceClient = new GroupServiceClient();
const metricServiceClient = new MetricServiceClient();
const notificationChannelServiceClient = new NotificationChannelServiceClient();
const serviceMonitoringServiceClient = new ServiceMonitoringServiceClient();
const uptimeCheckServiceClient = new UptimeCheckServiceClient();
new AlertPolicyServiceClient();
new GroupServiceClient();
new MetricServiceClient();
new NotificationChannelServiceClient();
new ServiceMonitoringServiceClient();
new UptimeCheckServiceClient();
}

main();
2 changes: 1 addition & 1 deletion baselines/redis/src/v1beta1/cloud_redis_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {CloudRedisClient} from 'redis';

function main() {
const cloudRedisClient = new CloudRedisClient();
new CloudRedisClient();
}

main();
2 changes: 1 addition & 1 deletion baselines/showcase/src/v1beta1/echo_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
2 changes: 1 addition & 1 deletion baselines/showcase/src/v1beta1/identity_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
2 changes: 1 addition & 1 deletion baselines/showcase/src/v1beta1/testing_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import {EchoClient, IdentityClient, MessagingClient, TestingClient} from 'showcase';

function main() {
const echoClient = new EchoClient();
const identityClient = new IdentityClient();
const messagingClient = new MessagingClient();
const testingClient = new TestingClient();
new EchoClient();
new IdentityClient();
new MessagingClient();
new TestingClient();
}

main();
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax';
import * as path from 'path';

import * as protos from '../../protos/protos';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {TextToSpeechClient} from '@google-cloud/text-to-speech';

function main() {
const textToSpeechClient = new TextToSpeechClient();
new TextToSpeechClient();
}

main();
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback} from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {TranslationServiceClient} from 'translation';

function main() {
const translationServiceClient = new TranslationServiceClient();
new TranslationServiceClient();
}

main();
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ limitations under the License.
{% import "../../_util.njk" as util -%}

import * as gax from 'google-gax';
import {GaxCall, Callback, CallOptions, Descriptors, ClientOptions
import {Callback, CallOptions, Descriptors, ClientOptions
{%- if service.longRunning.length > 0 %}, LROperation{%- endif -%}
{%- if service.paging.length > 0 %}, PaginationCallback{%- endif -%}
{%- if service.paging.length > 0 %}, PaginationCallback, GaxCall{%- endif -%}
} from 'google-gax';
import * as path from 'path';
{% if (service.paging.length > 0) %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {

function main() {
{%- for service in api.services %}
const {{ service.name.toCamelCase() -}}Client = new {{ service.name.toPascalCase() + 'Client' -}}();
new {{ service.name.toPascalCase() + 'Client' -}}();
{%- endfor %}
}

Expand Down