Skip to content

Commit

Permalink
fix: failing tests for LRO check methods (#35)
Browse files Browse the repository at this point in the history
* fix: failing tests for LRO check methods

Updated gapic-generator-typescript to v2.1.1.

Committer: @alexander-fenster
PiperOrigin-RevId: 387841814

Source-Link: googleapis/googleapis@f973532

Source-Link: googleapis/googleapis-gen@acb489d

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jul 30, 2021
1 parent bef495e commit b041f65
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 9 deletions.
11 changes: 10 additions & 1 deletion packages/google-api-serviceusage/src/v1/service_usage_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const version = require('../../../package.json').version;
export class ServiceUsageClient {
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 @@ -64,6 +65,7 @@ export class ServiceUsageClient {
longrunning: {},
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
operationsClient: gax.OperationsClient;
serviceUsageStub?: Promise<{[name: string]: Function}>;
Expand Down Expand Up @@ -107,6 +109,9 @@ export class ServiceUsageClient {
const staticMembers = this.constructor as typeof ServiceUsageClient;
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 @@ -226,6 +231,9 @@ export class ServiceUsageClient {
// 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 @@ -254,7 +262,8 @@ export class ServiceUsageClient {
)
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
(this._protos as any).google.api.serviceusage.v1.ServiceUsage,
this._opts
this._opts,
this._providedCustomServicePath
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const version = require('../../../package.json').version;
export class ServiceUsageClient {
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 @@ -60,6 +61,7 @@ export class ServiceUsageClient {
longrunning: {},
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
operationsClient: gax.OperationsClient;
serviceUsageStub?: Promise<{[name: string]: Function}>;
Expand Down Expand Up @@ -103,6 +105,9 @@ export class ServiceUsageClient {
const staticMembers = this.constructor as typeof ServiceUsageClient;
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 @@ -356,6 +361,9 @@ export class ServiceUsageClient {
// 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 @@ -384,7 +392,8 @@ export class ServiceUsageClient {
)
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
(this._protos as any).google.api.serviceusage.v1beta1.ServiceUsage,
this._opts
this._opts,
this._providedCustomServicePath
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
Expand Down Expand Up @@ -592,7 +601,7 @@ export class ServiceUsageClient {
name: request.name || '',
});
this.initialize();
gax.warn(
this.warn(
'DEP$ServiceUsage-$GetService',
'GetService is deprecated and may be removed in a future version.',
'DeprecationWarning'
Expand Down Expand Up @@ -923,7 +932,7 @@ export class ServiceUsageClient {
name: request.name || '',
});
this.initialize();
gax.warn(
this.warn(
'DEP$ServiceUsage-$EnableService',
'EnableService is deprecated and may be removed in a future version.',
'DeprecationWarning'
Expand Down Expand Up @@ -954,6 +963,11 @@ export class ServiceUsageClient {
protos.google.api.serviceusage.v1beta1.OperationMetadata
>
> {
this.warn(
'DEP$ServiceUsage-$checkEnableServiceProgress',
'checkEnableServiceProgress is deprecated and may be removed in a future version.',
'DeprecationWarning'
);
const request = new operationsProtos.google.longrunning.GetOperationRequest(
{name}
);
Expand Down Expand Up @@ -1085,7 +1099,7 @@ export class ServiceUsageClient {
name: request.name || '',
});
this.initialize();
gax.warn(
this.warn(
'DEP$ServiceUsage-$DisableService',
'DisableService is deprecated and may be removed in a future version.',
'DeprecationWarning'
Expand Down Expand Up @@ -1116,6 +1130,11 @@ export class ServiceUsageClient {
protos.google.api.serviceusage.v1beta1.OperationMetadata
>
> {
this.warn(
'DEP$ServiceUsage-$checkDisableServiceProgress',
'checkDisableServiceProgress is deprecated and may be removed in a future version.',
'DeprecationWarning'
);
const request = new operationsProtos.google.longrunning.GetOperationRequest(
{name}
);
Expand Down Expand Up @@ -1258,7 +1277,7 @@ export class ServiceUsageClient {
parent: request.parent || '',
});
this.initialize();
gax.warn(
this.warn(
'DEP$ServiceUsage-$BatchEnableServices',
'BatchEnableServices is deprecated and may be removed in a future version.',
'DeprecationWarning'
Expand Down Expand Up @@ -1289,6 +1308,11 @@ export class ServiceUsageClient {
protos.google.api.serviceusage.v1beta1.OperationMetadata
>
> {
this.warn(
'DEP$ServiceUsage-$checkBatchEnableServicesProgress',
'checkBatchEnableServicesProgress is deprecated and may be removed in a future version.',
'DeprecationWarning'
);
const request = new operationsProtos.google.longrunning.GetOperationRequest(
{name}
);
Expand Down Expand Up @@ -2842,7 +2866,7 @@ export class ServiceUsageClient {
parent: request.parent || '',
});
this.initialize();
gax.warn(
this.warn(
'DEP$ServiceUsage-$ListServices',
'ListServices is deprecated and may be removed in a future version.',
'DeprecationWarning'
Expand Down Expand Up @@ -2897,7 +2921,7 @@ export class ServiceUsageClient {
});
const callSettings = new gax.CallSettings(options);
this.initialize();
gax.warn(
this.warn(
'DEP$ServiceUsage-$ListServices',
'ListServices is deprecated and may be removed in a future version.',
'DeprecationWarning'
Expand Down Expand Up @@ -2963,7 +2987,7 @@ export class ServiceUsageClient {
options = options || {};
const callSettings = new gax.CallSettings(options);
this.initialize();
gax.warn(
this.warn(
'DEP$ServiceUsage-$ListServices',
'ListServices is deprecated and may be removed in a future version.',
'DeprecationWarning'
Expand Down
Loading

0 comments on commit b041f65

Please sign in to comment.