Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

fix: Updating WORKSPACE files to use the newest version of the Typescript generator. #527

Merged
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
11 changes: 10 additions & 1 deletion src/v1/auto_ml_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const version = require('../../../package.json').version;
export class AutoMlClient {
private _terminated = false;
private _opts: ClientOptions;
private _providedCustomServicePath: boolean;
private _gaxModule: typeof gax | typeof gax.fallback;
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
Expand All @@ -73,6 +74,7 @@ export class AutoMlClient {
longrunning: {},
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
pathTemplates: {[name: string]: gax.PathTemplate};
operationsClient: gax.OperationsClient;
Expand Down Expand Up @@ -117,6 +119,9 @@ export class AutoMlClient {
const staticMembers = this.constructor as typeof AutoMlClient;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
this._providedCustomServicePath = !!(
opts?.servicePath || opts?.apiEndpoint
);
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
const fallback =
Expand Down Expand Up @@ -333,6 +338,9 @@ export class AutoMlClient {
// of calling the API is handled in `google-gax`, with this code
// merely providing the destination and request information.
this.innerApiCalls = {};

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
}

/**
Expand Down Expand Up @@ -361,7 +369,8 @@ export class AutoMlClient {
)
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
(this._protos as any).google.cloud.automl.v1.AutoMl,
this._opts
this._opts,
this._providedCustomServicePath
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
Expand Down
11 changes: 10 additions & 1 deletion src/v1/prediction_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const version = require('../../../package.json').version;
export class PredictionServiceClient {
private _terminated = false;
private _opts: ClientOptions;
private _providedCustomServicePath: boolean;
private _gaxModule: typeof gax | typeof gax.fallback;
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
Expand All @@ -59,6 +60,7 @@ export class PredictionServiceClient {
longrunning: {},
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
pathTemplates: {[name: string]: gax.PathTemplate};
operationsClient: gax.OperationsClient;
Expand Down Expand Up @@ -103,6 +105,9 @@ export class PredictionServiceClient {
const staticMembers = this.constructor as typeof PredictionServiceClient;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
this._providedCustomServicePath = !!(
opts?.servicePath || opts?.apiEndpoint
);
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
const fallback =
Expand Down Expand Up @@ -207,6 +212,9 @@ export class PredictionServiceClient {
// of calling the API is handled in `google-gax`, with this code
// merely providing the destination and request information.
this.innerApiCalls = {};

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
}

/**
Expand Down Expand Up @@ -235,7 +243,8 @@ export class PredictionServiceClient {
)
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
(this._protos as any).google.cloud.automl.v1.PredictionService,
this._opts
this._opts,
this._providedCustomServicePath
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
Expand Down
11 changes: 10 additions & 1 deletion src/v1beta1/auto_ml_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const version = require('../../../package.json').version;
export class AutoMlClient {
private _terminated = false;
private _opts: ClientOptions;
private _providedCustomServicePath: boolean;
private _gaxModule: typeof gax | typeof gax.fallback;
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
Expand All @@ -73,6 +74,7 @@ export class AutoMlClient {
longrunning: {},
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
pathTemplates: {[name: string]: gax.PathTemplate};
operationsClient: gax.OperationsClient;
Expand Down Expand Up @@ -117,6 +119,9 @@ export class AutoMlClient {
const staticMembers = this.constructor as typeof AutoMlClient;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
this._providedCustomServicePath = !!(
opts?.servicePath || opts?.apiEndpoint
);
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
const fallback =
Expand Down Expand Up @@ -353,6 +358,9 @@ export class AutoMlClient {
// of calling the API is handled in `google-gax`, with this code
// merely providing the destination and request information.
this.innerApiCalls = {};

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
}

/**
Expand Down Expand Up @@ -381,7 +389,8 @@ export class AutoMlClient {
)
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
(this._protos as any).google.cloud.automl.v1beta1.AutoMl,
this._opts
this._opts,
this._providedCustomServicePath
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
Expand Down
11 changes: 10 additions & 1 deletion src/v1beta1/prediction_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const version = require('../../../package.json').version;
export class PredictionServiceClient {
private _terminated = false;
private _opts: ClientOptions;
private _providedCustomServicePath: boolean;
private _gaxModule: typeof gax | typeof gax.fallback;
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
Expand All @@ -59,6 +60,7 @@ export class PredictionServiceClient {
longrunning: {},
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
pathTemplates: {[name: string]: gax.PathTemplate};
operationsClient: gax.OperationsClient;
Expand Down Expand Up @@ -103,6 +105,9 @@ export class PredictionServiceClient {
const staticMembers = this.constructor as typeof PredictionServiceClient;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
this._providedCustomServicePath = !!(
opts?.servicePath || opts?.apiEndpoint
);
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
const fallback =
Expand Down Expand Up @@ -213,6 +218,9 @@ export class PredictionServiceClient {
// of calling the API is handled in `google-gax`, with this code
// merely providing the destination and request information.
this.innerApiCalls = {};

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
}

/**
Expand Down Expand Up @@ -241,7 +249,8 @@ export class PredictionServiceClient {
)
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
(this._protos as any).google.cloud.automl.v1beta1.PredictionService,
this._opts
this._opts,
this._providedCustomServicePath
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
Expand Down