Skip to content

Commit d964a13

Browse files
build: update gapic-generator-typescript to v4.4.1 (#1995)
* feat: Trusted Private Cloud support, use the universeDomain parameter feat: auto populate UUID fields where needed fix: revert changes to streaming retries Use gapic-generator-typescript v4.4.0. PiperOrigin-RevId: 603757799 Source-Link: googleapis/googleapis@1a45bf7 Source-Link: googleapis/googleapis-gen@19ca4b4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTljYTRiNDVhNTNkMDBjYjdiZGQ5NGI0NDJiNjBiZDIzN2RmZTEyMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build: update gapic-generator-typescript to v4.4.1 PiperOrigin-RevId: 604765466 Source-Link: googleapis/googleapis@40203ca Source-Link: googleapis/googleapis-gen@07b7f3d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDdiN2YzZGFkOGFhMTkxMmQ0YWNkY2ZkNjM2NWJiNDIzNmU0YjU0YiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 78edf80 commit d964a13

File tree

7 files changed

+329
-71
lines changed

7 files changed

+329
-71
lines changed

dev/protos/google/api/field_behavior.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extend google.protobuf.FieldOptions {
3737
// google.protobuf.Timestamp expire_time = 1
3838
// [(google.api.field_behavior) = OUTPUT_ONLY,
3939
// (google.api.field_behavior) = IMMUTABLE];
40-
repeated google.api.FieldBehavior field_behavior = 1052;
40+
repeated google.api.FieldBehavior field_behavior = 1052 [packed = false];
4141
}
4242

4343
// An indicator of the behavior of a given field (for example, that a field

dev/src/v1/firestore_admin_client.ts

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import type {
3333
import {Transform} from 'stream';
3434
import * as protos from '../../protos/firestore_admin_v1_proto_api';
3535
import jsonProtos = require('../../protos/admin_v1.json');
36+
3637
/**
3738
* Client JSON configuration object, loaded from
3839
* `src/v1/firestore_admin_client_config.json`.
@@ -81,6 +82,8 @@ export class FirestoreAdminClient {
8182
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
8283
private _protos: {};
8384
private _defaults: {[method: string]: gax.CallSettings};
85+
private _universeDomain: string;
86+
private _servicePath: string;
8487
auth: gax.GoogleAuth;
8588
descriptors: Descriptors = {
8689
page: {},
@@ -140,8 +143,20 @@ export class FirestoreAdminClient {
140143
) {
141144
// Ensure that options include all the required fields.
142145
const staticMembers = this.constructor as typeof FirestoreAdminClient;
146+
if (
147+
opts?.universe_domain &&
148+
opts?.universeDomain &&
149+
opts?.universe_domain !== opts?.universeDomain
150+
) {
151+
throw new Error(
152+
'Please set either universe_domain or universeDomain, but not both.'
153+
);
154+
}
155+
this._universeDomain =
156+
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
157+
this._servicePath = 'firestore.' + this._universeDomain;
143158
const servicePath =
144-
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
159+
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
145160
this._providedCustomServicePath = !!(
146161
opts?.servicePath || opts?.apiEndpoint
147162
);
@@ -156,7 +171,7 @@ export class FirestoreAdminClient {
156171
opts.numericEnums = true;
157172

158173
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
159-
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
174+
if (servicePath !== this._servicePath && !('scopes' in opts)) {
160175
opts['scopes'] = staticMembers.scopes;
161176
}
162177

@@ -181,10 +196,10 @@ export class FirestoreAdminClient {
181196
this.auth.useJWTAccessWithScope = true;
182197

183198
// Set defaultServicePath on the auth object.
184-
this.auth.defaultServicePath = staticMembers.servicePath;
199+
this.auth.defaultServicePath = this._servicePath;
185200

186201
// Set the default scopes in auth client if needed.
187-
if (servicePath === staticMembers.servicePath) {
202+
if (servicePath === this._servicePath) {
188203
this.auth.defaultScopes = staticMembers.scopes;
189204
}
190205
this.locationsClient = new this._gaxModule.LocationsClient(
@@ -460,21 +475,52 @@ export class FirestoreAdminClient {
460475

461476
/**
462477
* The DNS address for this API service.
478+
* @deprecated Use the apiEndpoint method of the client instance.
463479
* @returns {string} The DNS address for this service.
464480
*/
465481
static get servicePath() {
482+
if (
483+
typeof process !== undefined &&
484+
typeof process.emitWarning === 'function'
485+
) {
486+
process.emitWarning(
487+
'Static servicePath is deprecated, please use the instance method instead.',
488+
'DeprecationWarning'
489+
);
490+
}
466491
return 'firestore.googleapis.com';
467492
}
468493

469494
/**
470-
* The DNS address for this API service - same as servicePath(),
471-
* exists for compatibility reasons.
495+
* The DNS address for this API service - same as servicePath.
496+
* @deprecated Use the apiEndpoint method of the client instance.
472497
* @returns {string} The DNS address for this service.
473498
*/
474499
static get apiEndpoint() {
500+
if (
501+
typeof process !== undefined &&
502+
typeof process.emitWarning === 'function'
503+
) {
504+
process.emitWarning(
505+
'Static apiEndpoint is deprecated, please use the instance method instead.',
506+
'DeprecationWarning'
507+
);
508+
}
475509
return 'firestore.googleapis.com';
476510
}
477511

512+
/**
513+
* The DNS address for this API service.
514+
* @returns {string} The DNS address for this service.
515+
*/
516+
get apiEndpoint() {
517+
return this._servicePath;
518+
}
519+
520+
get universeDomain() {
521+
return this._universeDomain;
522+
}
523+
478524
/**
479525
* The port for this API service.
480526
* @returns {number} The default port for this service.

dev/src/v1/firestore_client.ts

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import type {
3131
import {Transform, PassThrough} from 'stream';
3232
import * as protos from '../../protos/firestore_v1_proto_api';
3333
import jsonProtos = require('../../protos/v1.json');
34+
3435
/**
3536
* Client JSON configuration object, loaded from
3637
* `src/v1/firestore_client_config.json`.
@@ -59,6 +60,8 @@ export class FirestoreClient {
5960
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
6061
private _protos: {};
6162
private _defaults: {[method: string]: gax.CallSettings};
63+
private _universeDomain: string;
64+
private _servicePath: string;
6265
auth: gax.GoogleAuth;
6366
descriptors: Descriptors = {
6467
page: {},
@@ -116,8 +119,20 @@ export class FirestoreClient {
116119
) {
117120
// Ensure that options include all the required fields.
118121
const staticMembers = this.constructor as typeof FirestoreClient;
122+
if (
123+
opts?.universe_domain &&
124+
opts?.universeDomain &&
125+
opts?.universe_domain !== opts?.universeDomain
126+
) {
127+
throw new Error(
128+
'Please set either universe_domain or universeDomain, but not both.'
129+
);
130+
}
131+
this._universeDomain =
132+
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
133+
this._servicePath = 'firestore.' + this._universeDomain;
119134
const servicePath =
120-
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
135+
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
121136
this._providedCustomServicePath = !!(
122137
opts?.servicePath || opts?.apiEndpoint
123138
);
@@ -132,7 +147,7 @@ export class FirestoreClient {
132147
opts.numericEnums = true;
133148

134149
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
135-
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
150+
if (servicePath !== this._servicePath && !('scopes' in opts)) {
136151
opts['scopes'] = staticMembers.scopes;
137152
}
138153

@@ -157,10 +172,10 @@ export class FirestoreClient {
157172
this.auth.useJWTAccessWithScope = true;
158173

159174
// Set defaultServicePath on the auth object.
160-
this.auth.defaultServicePath = staticMembers.servicePath;
175+
this.auth.defaultServicePath = this._servicePath;
161176

162177
// Set the default scopes in auth client if needed.
163-
if (servicePath === staticMembers.servicePath) {
178+
if (servicePath === this._servicePath) {
164179
this.auth.defaultScopes = staticMembers.scopes;
165180
}
166181
this.locationsClient = new this._gaxModule.LocationsClient(
@@ -213,27 +228,27 @@ export class FirestoreClient {
213228
batchGetDocuments: new this._gaxModule.StreamDescriptor(
214229
this._gaxModule.StreamType.SERVER_STREAMING,
215230
!!opts.fallback,
216-
/* gaxStreamingRetries: */ true
231+
/* gaxStreamingRetries: */ false
217232
),
218233
runQuery: new this._gaxModule.StreamDescriptor(
219234
this._gaxModule.StreamType.SERVER_STREAMING,
220235
!!opts.fallback,
221-
/* gaxStreamingRetries: */ true
236+
/* gaxStreamingRetries: */ false
222237
),
223238
runAggregationQuery: new this._gaxModule.StreamDescriptor(
224239
this._gaxModule.StreamType.SERVER_STREAMING,
225240
!!opts.fallback,
226-
/* gaxStreamingRetries: */ true
241+
/* gaxStreamingRetries: */ false
227242
),
228243
write: new this._gaxModule.StreamDescriptor(
229244
this._gaxModule.StreamType.BIDI_STREAMING,
230245
!!opts.fallback,
231-
/* gaxStreamingRetries: */ true
246+
/* gaxStreamingRetries: */ false
232247
),
233248
listen: new this._gaxModule.StreamDescriptor(
234249
this._gaxModule.StreamType.BIDI_STREAMING,
235250
!!opts.fallback,
236-
/* gaxStreamingRetries: */ true
251+
/* gaxStreamingRetries: */ false
237252
),
238253
};
239254

@@ -350,21 +365,52 @@ export class FirestoreClient {
350365

351366
/**
352367
* The DNS address for this API service.
368+
* @deprecated Use the apiEndpoint method of the client instance.
353369
* @returns {string} The DNS address for this service.
354370
*/
355371
static get servicePath() {
372+
if (
373+
typeof process !== undefined &&
374+
typeof process.emitWarning === 'function'
375+
) {
376+
process.emitWarning(
377+
'Static servicePath is deprecated, please use the instance method instead.',
378+
'DeprecationWarning'
379+
);
380+
}
356381
return 'firestore.googleapis.com';
357382
}
358383

359384
/**
360-
* The DNS address for this API service - same as servicePath(),
361-
* exists for compatibility reasons.
385+
* The DNS address for this API service - same as servicePath.
386+
* @deprecated Use the apiEndpoint method of the client instance.
362387
* @returns {string} The DNS address for this service.
363388
*/
364389
static get apiEndpoint() {
390+
if (
391+
typeof process !== undefined &&
392+
typeof process.emitWarning === 'function'
393+
) {
394+
process.emitWarning(
395+
'Static apiEndpoint is deprecated, please use the instance method instead.',
396+
'DeprecationWarning'
397+
);
398+
}
365399
return 'firestore.googleapis.com';
366400
}
367401

402+
/**
403+
* The DNS address for this API service.
404+
* @returns {string} The DNS address for this service.
405+
*/
406+
get apiEndpoint() {
407+
return this._servicePath;
408+
}
409+
410+
get universeDomain() {
411+
return this._universeDomain;
412+
}
413+
368414
/**
369415
* The port for this API service.
370416
* @returns {number} The default port for this service.

0 commit comments

Comments
 (0)