Skip to content

Commit c6c85b6

Browse files
fix: finalize fixing typings for headers in generator (#2287)
* feat: paging changes for bigquery fix: add x-goog-request params to headers for LRO-polling methods fix: remove extra protos in ESM & capture ESM in headers docs: update comments for a Nodejs stream object PiperOrigin-RevId: 721038181 Source-Link: googleapis/googleapis@331a41a Source-Link: googleapis/googleapis-gen@e81b4c5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTgxYjRjNWI1MjA4ODk1ZjY2M2EyNDA0ODYxNWE1OWQ1NjM2ZjQxNSJ9 * fix: fix typings for headers in generator PiperOrigin-RevId: 723181578 Source-Link: googleapis/googleapis@c7b69f4 Source-Link: googleapis/googleapis-gen@d1bc1ac Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDFiYzFhY2Q3NDI5NjQyMmE1Y2I2ZTBjNDAxNmM4YzQ4ZTk5ODUzOCJ9 * fix: finalize fixing typings for headers in generator PiperOrigin-RevId: 723563760 Source-Link: googleapis/googleapis@2f843e2 Source-Link: googleapis/googleapis-gen@cd0f9c6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2QwZjljNmZlMWRkNzdjNTUyZWY3NjZlNjA0N2Y4ZGNmZDNiY2MyZSJ9 * 🦉 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 d559080 commit c6c85b6

22 files changed

+370
-220
lines changed

dev/protos/admin_v1.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,6 +2467,10 @@
24672467
"rule": "repeated",
24682468
"type": "string",
24692469
"id": 1
2470+
},
2471+
"generateOmittedAsInternal": {
2472+
"type": "bool",
2473+
"id": 2
24702474
}
24712475
}
24722476
},

dev/protos/firestore_admin_v1_proto_api.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5681,6 +5681,9 @@ export namespace google {
56815681

56825682
/** SelectiveGapicGeneration methods */
56835683
methods?: (string[]|null);
5684+
5685+
/** SelectiveGapicGeneration generateOmittedAsInternal */
5686+
generateOmittedAsInternal?: (boolean|null);
56845687
}
56855688

56865689
/** Represents a SelectiveGapicGeneration. */
@@ -5695,6 +5698,9 @@ export namespace google {
56955698
/** SelectiveGapicGeneration methods. */
56965699
public methods: string[];
56975700

5701+
/** SelectiveGapicGeneration generateOmittedAsInternal. */
5702+
public generateOmittedAsInternal: boolean;
5703+
56985704
/**
56995705
* Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types.
57005706
* @param object Plain object

dev/protos/firestore_admin_v1_proto_api.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13233,6 +13233,7 @@
1323313233
* @memberof google.api
1323413234
* @interface ISelectiveGapicGeneration
1323513235
* @property {Array.<string>|null} [methods] SelectiveGapicGeneration methods
13236+
* @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal
1323613237
*/
1323713238

1323813239
/**
@@ -13259,6 +13260,14 @@
1325913260
*/
1326013261
SelectiveGapicGeneration.prototype.methods = $util.emptyArray;
1326113262

13263+
/**
13264+
* SelectiveGapicGeneration generateOmittedAsInternal.
13265+
* @member {boolean} generateOmittedAsInternal
13266+
* @memberof google.api.SelectiveGapicGeneration
13267+
* @instance
13268+
*/
13269+
SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false;
13270+
1326213271
/**
1326313272
* Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types.
1326413273
* @function fromObject
@@ -13278,6 +13287,8 @@
1327813287
for (var i = 0; i < object.methods.length; ++i)
1327913288
message.methods[i] = String(object.methods[i]);
1328013289
}
13290+
if (object.generateOmittedAsInternal != null)
13291+
message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal);
1328113292
return message;
1328213293
};
1328313294

@@ -13296,11 +13307,15 @@
1329613307
var object = {};
1329713308
if (options.arrays || options.defaults)
1329813309
object.methods = [];
13310+
if (options.defaults)
13311+
object.generateOmittedAsInternal = false;
1329913312
if (message.methods && message.methods.length) {
1330013313
object.methods = [];
1330113314
for (var j = 0; j < message.methods.length; ++j)
1330213315
object.methods[j] = message.methods[j];
1330313316
}
13317+
if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal"))
13318+
object.generateOmittedAsInternal = message.generateOmittedAsInternal;
1330413319
return object;
1330513320
};
1330613321

dev/protos/firestore_v1_proto_api.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6347,6 +6347,9 @@ export namespace google {
63476347

63486348
/** SelectiveGapicGeneration methods */
63496349
methods?: (string[]|null);
6350+
6351+
/** SelectiveGapicGeneration generateOmittedAsInternal */
6352+
generateOmittedAsInternal?: (boolean|null);
63506353
}
63516354

63526355
/** Represents a SelectiveGapicGeneration. */
@@ -6361,6 +6364,9 @@ export namespace google {
63616364
/** SelectiveGapicGeneration methods. */
63626365
public methods: string[];
63636366

6367+
/** SelectiveGapicGeneration generateOmittedAsInternal. */
6368+
public generateOmittedAsInternal: boolean;
6369+
63646370
/**
63656371
* Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types.
63666372
* @param object Plain object

dev/protos/firestore_v1_proto_api.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15104,6 +15104,7 @@
1510415104
* @memberof google.api
1510515105
* @interface ISelectiveGapicGeneration
1510615106
* @property {Array.<string>|null} [methods] SelectiveGapicGeneration methods
15107+
* @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal
1510715108
*/
1510815109

1510915110
/**
@@ -15130,6 +15131,14 @@
1513015131
*/
1513115132
SelectiveGapicGeneration.prototype.methods = $util.emptyArray;
1513215133

15134+
/**
15135+
* SelectiveGapicGeneration generateOmittedAsInternal.
15136+
* @member {boolean} generateOmittedAsInternal
15137+
* @memberof google.api.SelectiveGapicGeneration
15138+
* @instance
15139+
*/
15140+
SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false;
15141+
1513315142
/**
1513415143
* Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types.
1513515144
* @function fromObject
@@ -15149,6 +15158,8 @@
1514915158
for (var i = 0; i < object.methods.length; ++i)
1515015159
message.methods[i] = String(object.methods[i]);
1515115160
}
15161+
if (object.generateOmittedAsInternal != null)
15162+
message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal);
1515215163
return message;
1515315164
};
1515415165

@@ -15167,11 +15178,15 @@
1516715178
var object = {};
1516815179
if (options.arrays || options.defaults)
1516915180
object.methods = [];
15181+
if (options.defaults)
15182+
object.generateOmittedAsInternal = false;
1517015183
if (message.methods && message.methods.length) {
1517115184
object.methods = [];
1517215185
for (var j = 0; j < message.methods.length; ++j)
1517315186
object.methods[j] = message.methods[j];
1517415187
}
15188+
if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal"))
15189+
object.generateOmittedAsInternal = message.generateOmittedAsInternal;
1517515190
return object;
1517615191
};
1517715192

dev/protos/firestore_v1beta1_proto_api.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8520,6 +8520,9 @@ export namespace google {
85208520

85218521
/** SelectiveGapicGeneration methods */
85228522
methods?: (string[]|null);
8523+
8524+
/** SelectiveGapicGeneration generateOmittedAsInternal */
8525+
generateOmittedAsInternal?: (boolean|null);
85238526
}
85248527

85258528
/** Represents a SelectiveGapicGeneration. */
@@ -8534,6 +8537,9 @@ export namespace google {
85348537
/** SelectiveGapicGeneration methods. */
85358538
public methods: string[];
85368539

8540+
/** SelectiveGapicGeneration generateOmittedAsInternal. */
8541+
public generateOmittedAsInternal: boolean;
8542+
85378543
/**
85388544
* Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types.
85398545
* @param object Plain object

dev/protos/firestore_v1beta1_proto_api.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21065,6 +21065,7 @@
2106521065
* @memberof google.api
2106621066
* @interface ISelectiveGapicGeneration
2106721067
* @property {Array.<string>|null} [methods] SelectiveGapicGeneration methods
21068+
* @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal
2106821069
*/
2106921070

2107021071
/**
@@ -21091,6 +21092,14 @@
2109121092
*/
2109221093
SelectiveGapicGeneration.prototype.methods = $util.emptyArray;
2109321094

21095+
/**
21096+
* SelectiveGapicGeneration generateOmittedAsInternal.
21097+
* @member {boolean} generateOmittedAsInternal
21098+
* @memberof google.api.SelectiveGapicGeneration
21099+
* @instance
21100+
*/
21101+
SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false;
21102+
2109421103
/**
2109521104
* Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types.
2109621105
* @function fromObject
@@ -21110,6 +21119,8 @@
2111021119
for (var i = 0; i < object.methods.length; ++i)
2111121120
message.methods[i] = String(object.methods[i]);
2111221121
}
21122+
if (object.generateOmittedAsInternal != null)
21123+
message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal);
2111321124
return message;
2111421125
};
2111521126

@@ -21128,11 +21139,15 @@
2112821139
var object = {};
2112921140
if (options.arrays || options.defaults)
2113021141
object.methods = [];
21142+
if (options.defaults)
21143+
object.generateOmittedAsInternal = false;
2113121144
if (message.methods && message.methods.length) {
2113221145
object.methods = [];
2113321146
for (var j = 0; j < message.methods.length; ++j)
2113421147
object.methods[j] = message.methods[j];
2113521148
}
21149+
if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal"))
21150+
object.generateOmittedAsInternal = message.generateOmittedAsInternal;
2113621151
return object;
2113721152
};
2113821153

dev/protos/google/api/client.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,4 +469,12 @@ message SelectiveGapicGeneration {
469469
// An allowlist of the fully qualified names of RPCs that should be included
470470
// on public client surfaces.
471471
repeated string methods = 1;
472+
473+
// Setting this to true indicates to the client generators that methods
474+
// that would be excluded from the generation should instead be generated
475+
// in a way that indicates these methods should not be consumed by
476+
// end users. How this is expressed is up to individual language
477+
// implementations to decide. Some examples may be: added annotations,
478+
// obfuscated identifiers, or other language idiomatic patterns.
479+
bool generate_omitted_as_internal = 2;
472480
}

dev/protos/v1.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,10 @@
24312431
"rule": "repeated",
24322432
"type": "string",
24332433
"id": 1
2434+
},
2435+
"generateOmittedAsInternal": {
2436+
"type": "bool",
2437+
"id": 2
24342438
}
24352439
}
24362440
},

dev/protos/v1beta1.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3566,6 +3566,10 @@
35663566
"rule": "repeated",
35673567
"type": "string",
35683568
"id": 1
3569+
},
3570+
"generateOmittedAsInternal": {
3571+
"type": "bool",
3572+
"id": 2
35693573
}
35703574
}
35713575
},

dev/src/v1/firestore_admin_client.ts

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,7 +3260,7 @@ export class FirestoreAdminClient {
32603260
}
32613261

32623262
/**
3263-
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
3263+
* Equivalent to `listIndexes`, but returns a NodeJS Stream object.
32643264
* @param {Object} request
32653265
* The request object that will be sent.
32663266
* @param {string} request.parent
@@ -3469,7 +3469,7 @@ export class FirestoreAdminClient {
34693469
}
34703470

34713471
/**
3472-
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
3472+
* Equivalent to `listFields`, but returns a NodeJS Stream object.
34733473
* @param {Object} request
34743474
* The request object that will be sent.
34753475
* @param {string} request.parent
@@ -3688,7 +3688,7 @@ export class FirestoreAdminClient {
36883688
*/
36893689
getOperation(
36903690
request: protos.google.longrunning.GetOperationRequest,
3691-
options?:
3691+
optionsOrCallback?:
36923692
| gax.CallOptions
36933693
| Callback<
36943694
protos.google.longrunning.Operation,
@@ -3701,6 +3701,20 @@ export class FirestoreAdminClient {
37013701
{} | null | undefined
37023702
>
37033703
): Promise<[protos.google.longrunning.Operation]> {
3704+
let options: gax.CallOptions;
3705+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
3706+
callback = optionsOrCallback;
3707+
options = {};
3708+
} else {
3709+
options = optionsOrCallback as gax.CallOptions;
3710+
}
3711+
options = options || {};
3712+
options.otherArgs = options.otherArgs || {};
3713+
options.otherArgs.headers = options.otherArgs.headers || {};
3714+
options.otherArgs.headers['x-goog-request-params'] =
3715+
this._gaxModule.routingHeader.fromParams({
3716+
name: request.name ?? '',
3717+
});
37043718
return this.operationsClient.getOperation(request, options, callback);
37053719
}
37063720
/**
@@ -3737,6 +3751,13 @@ export class FirestoreAdminClient {
37373751
request: protos.google.longrunning.ListOperationsRequest,
37383752
options?: gax.CallOptions
37393753
): AsyncIterable<protos.google.longrunning.ListOperationsResponse> {
3754+
options = options || {};
3755+
options.otherArgs = options.otherArgs || {};
3756+
options.otherArgs.headers = options.otherArgs.headers || {};
3757+
options.otherArgs.headers['x-goog-request-params'] =
3758+
this._gaxModule.routingHeader.fromParams({
3759+
name: request.name ?? '',
3760+
});
37403761
return this.operationsClient.listOperationsAsync(request, options);
37413762
}
37423763
/**
@@ -3772,11 +3793,11 @@ export class FirestoreAdminClient {
37723793
*/
37733794
cancelOperation(
37743795
request: protos.google.longrunning.CancelOperationRequest,
3775-
options?:
3796+
optionsOrCallback?:
37763797
| gax.CallOptions
37773798
| Callback<
3778-
protos.google.protobuf.Empty,
37793799
protos.google.longrunning.CancelOperationRequest,
3800+
protos.google.protobuf.Empty,
37803801
{} | undefined | null
37813802
>,
37823803
callback?: Callback<
@@ -3785,6 +3806,20 @@ export class FirestoreAdminClient {
37853806
{} | undefined | null
37863807
>
37873808
): Promise<protos.google.protobuf.Empty> {
3809+
let options: gax.CallOptions;
3810+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
3811+
callback = optionsOrCallback;
3812+
options = {};
3813+
} else {
3814+
options = optionsOrCallback as gax.CallOptions;
3815+
}
3816+
options = options || {};
3817+
options.otherArgs = options.otherArgs || {};
3818+
options.otherArgs.headers = options.otherArgs.headers || {};
3819+
options.otherArgs.headers['x-goog-request-params'] =
3820+
this._gaxModule.routingHeader.fromParams({
3821+
name: request.name ?? '',
3822+
});
37883823
return this.operationsClient.cancelOperation(request, options, callback);
37893824
}
37903825

@@ -3815,7 +3850,7 @@ export class FirestoreAdminClient {
38153850
*/
38163851
deleteOperation(
38173852
request: protos.google.longrunning.DeleteOperationRequest,
3818-
options?:
3853+
optionsOrCallback?:
38193854
| gax.CallOptions
38203855
| Callback<
38213856
protos.google.protobuf.Empty,
@@ -3828,6 +3863,20 @@ export class FirestoreAdminClient {
38283863
{} | null | undefined
38293864
>
38303865
): Promise<protos.google.protobuf.Empty> {
3866+
let options: gax.CallOptions;
3867+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
3868+
callback = optionsOrCallback;
3869+
options = {};
3870+
} else {
3871+
options = optionsOrCallback as gax.CallOptions;
3872+
}
3873+
options = options || {};
3874+
options.otherArgs = options.otherArgs || {};
3875+
options.otherArgs.headers = options.otherArgs.headers || {};
3876+
options.otherArgs.headers['x-goog-request-params'] =
3877+
this._gaxModule.routingHeader.fromParams({
3878+
name: request.name ?? '',
3879+
});
38313880
return this.operationsClient.deleteOperation(request, options, callback);
38323881
}
38333882

0 commit comments

Comments
 (0)