GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Updating WORKSPACE files to use the newest version of the Typesc… · googleapis/google-cloud-node@eb11593

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handwritten/datastore/src/v1
    • datastore_admin_client.ts
    • datastore_client.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handwritten/datastore/src/v1/datastore_admin_client.ts‎

Copy file name to clipboardExpand all lines: handwritten/datastore/src/v1/datastore_admin_client.ts
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ const version = require('../../../package.json').version;
109109
export class DatastoreAdminClient {
110110
private _terminated = false;
111111
private _opts: ClientOptions;
112+
private _providedCustomServicePath: boolean;
112113
private _gaxModule: typeof gax | typeof gax.fallback;
113114
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
114115
private _protos: {};
@@ -120,6 +121,7 @@ export class DatastoreAdminClient {
120121
longrunning: {},
121122
batching: {},
122123
};
124+
warn: (code: string, message: string, warnType?: string) => void;
123125
innerApiCalls: {[name: string]: Function};
124126
operationsClient: gax.OperationsClient;
125127
datastoreAdminStub?: Promise<{[name: string]: Function}>;
@@ -163,6 +165,9 @@ export class DatastoreAdminClient {
163165
const staticMembers = this.constructor as typeof DatastoreAdminClient;
164166
const servicePath =
165167
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
168+
this._providedCustomServicePath = !!(
169+
opts?.servicePath || opts?.apiEndpoint
170+
);
166171
const port = opts?.port || staticMembers.port;
167172
const clientConfig = opts?.clientConfig ?? {};
168173
const fallback =
@@ -293,6 +298,9 @@ export class DatastoreAdminClient {
293298
// of calling the API is handled in `google-gax`, with this code
294299
// merely providing the destination and request information.
295300
this.innerApiCalls = {};
301+
302+
// Add a warn function to the client constructor so it can be easily tested.
303+
this.warn = gax.warn;
296304
}
297305

298306
/**
@@ -321,7 +329,8 @@ export class DatastoreAdminClient {
321329
)
322330
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
323331
(this._protos as any).google.datastore.admin.v1.DatastoreAdmin,
324-
this._opts
332+
this._opts,
333+
this._providedCustomServicePath
325334
) as Promise<{[method: string]: Function}>;
326335

327336
// Iterate over each of the methods that the service provides
Collapse file

‎handwritten/datastore/src/v1/datastore_client.ts‎

Copy file name to clipboardExpand all lines: handwritten/datastore/src/v1/datastore_client.ts
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const version = require('../../../package.json').version;
4545
export class DatastoreClient {
4646
private _terminated = false;
4747
private _opts: ClientOptions;
48+
private _providedCustomServicePath: boolean;
4849
private _gaxModule: typeof gax | typeof gax.fallback;
4950
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
5051
private _protos: {};
@@ -56,6 +57,7 @@ export class DatastoreClient {
5657
longrunning: {},
5758
batching: {},
5859
};
60+
warn: (code: string, message: string, warnType?: string) => void;
5961
innerApiCalls: {[name: string]: Function};
6062
datastoreStub?: Promise<{[name: string]: Function}>;
6163

@@ -98,6 +100,9 @@ export class DatastoreClient {
98100
const staticMembers = this.constructor as typeof DatastoreClient;
99101
const servicePath =
100102
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
103+
this._providedCustomServicePath = !!(
104+
opts?.servicePath || opts?.apiEndpoint
105+
);
101106
const port = opts?.port || staticMembers.port;
102107
const clientConfig = opts?.clientConfig ?? {};
103108
const fallback =
@@ -157,6 +162,9 @@ export class DatastoreClient {
157162
// of calling the API is handled in `google-gax`, with this code
158163
// merely providing the destination and request information.
159164
this.innerApiCalls = {};
165+
166+
// Add a warn function to the client constructor so it can be easily tested.
167+
this.warn = gax.warn;
160168
}
161169

162170
/**
@@ -185,7 +193,8 @@ export class DatastoreClient {
185193
)
186194
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
187195
(this._protos as any).google.datastore.v1.Datastore,
188-
this._opts
196+
this._opts,
197+
this._providedCustomServicePath
189198
) as Promise<{[method: string]: Function}>;
190199

191200
// Iterate over each of the methods that the service provides

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.