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

fix: preserve default values in x-goog-request-params header #634

Merged
merged 2 commits into from
Sep 14, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 24 additions & 24 deletions src/v1/auto_ml_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.getDataset(request, options, callback);
Expand Down Expand Up @@ -729,7 +729,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'dataset.name': request.dataset!.name || '',
'dataset.name': request.dataset!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateDataset(request, options, callback);
Expand Down Expand Up @@ -820,7 +820,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.getAnnotationSpec(request, options, callback);
Expand Down Expand Up @@ -903,7 +903,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.getModel(request, options, callback);
Expand Down Expand Up @@ -988,7 +988,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'model.name': request.model!.name || '',
'model.name': request.model!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateModel(request, options, callback);
Expand Down Expand Up @@ -1079,7 +1079,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.getModelEvaluation(request, options, callback);
Expand Down Expand Up @@ -1185,7 +1185,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.createDataset(request, options, callback);
Expand Down Expand Up @@ -1327,7 +1327,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.deleteDataset(request, options, callback);
Expand Down Expand Up @@ -1477,7 +1477,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.importData(request, options, callback);
Expand Down Expand Up @@ -1619,7 +1619,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.exportData(request, options, callback);
Expand Down Expand Up @@ -1763,7 +1763,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.createModel(request, options, callback);
Expand Down Expand Up @@ -1905,7 +1905,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.deleteModel(request, options, callback);
Expand Down Expand Up @@ -2057,7 +2057,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.deployModel(request, options, callback);
Expand Down Expand Up @@ -2201,7 +2201,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.undeployModel(request, options, callback);
Expand Down Expand Up @@ -2347,7 +2347,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.exportModel(request, options, callback);
Expand Down Expand Up @@ -2486,7 +2486,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.listDatasets(request, options, callback);
Expand Down Expand Up @@ -2536,7 +2536,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listDatasets'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2595,7 +2595,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listDatasets'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2704,7 +2704,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.listModels(request, options, callback);
Expand Down Expand Up @@ -2755,7 +2755,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listModels'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2815,7 +2815,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listModels'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2936,7 +2936,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.listModelEvaluations(request, options, callback);
Expand Down Expand Up @@ -2991,7 +2991,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listModelEvaluations'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -3055,7 +3055,7 @@ export class AutoMlClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listModelEvaluations'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
4 changes: 2 additions & 2 deletions src/v1/prediction_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export class PredictionServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.predict(request, options, callback);
Expand Down Expand Up @@ -773,7 +773,7 @@ export class PredictionServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.batchPredict(request, options, callback);
Expand Down