Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions src/v1/database_admin_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ export class DatabaseAdminClient {
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.getDatabase(request, options, callback);
Expand Down Expand Up @@ -690,7 +690,7 @@ export class DatabaseAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
database: request.database || '',
database: request.database ?? '',
});
this.initialize();
return this.innerApiCalls.dropDatabase(request, options, callback);
Expand Down Expand Up @@ -791,7 +791,7 @@ export class DatabaseAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
database: request.database || '',
database: request.database ?? '',
});
this.initialize();
return this.innerApiCalls.getDatabaseDdl(request, options, callback);
Expand Down Expand Up @@ -892,7 +892,7 @@ export class DatabaseAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
resource: request.resource || '',
resource: request.resource ?? '',
});
this.initialize();
return this.innerApiCalls.setIamPolicy(request, options, callback);
Expand Down Expand Up @@ -986,7 +986,7 @@ export class DatabaseAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
resource: request.resource || '',
resource: request.resource ?? '',
});
this.initialize();
return this.innerApiCalls.getIamPolicy(request, options, callback);
Expand Down Expand Up @@ -1084,7 +1084,7 @@ export class DatabaseAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
resource: request.resource || '',
resource: request.resource ?? '',
});
this.initialize();
return this.innerApiCalls.testIamPermissions(request, options, callback);
Expand Down Expand Up @@ -1177,7 +1177,7 @@ export class DatabaseAdminClient {
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.getBackup(request, options, callback);
Expand Down Expand Up @@ -1277,7 +1277,7 @@ export class DatabaseAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'backup.name': request.backup!.name || '',
'backup.name': request.backup!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateBackup(request, options, callback);
Expand Down Expand Up @@ -1370,7 +1370,7 @@ export class DatabaseAdminClient {
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.deleteBackup(request, options, callback);
Expand Down Expand Up @@ -1499,7 +1499,7 @@ export class DatabaseAdminClient {
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.createDatabase(request, options, callback);
Expand Down Expand Up @@ -1665,7 +1665,7 @@ export class DatabaseAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
database: request.database || '',
database: request.database ?? '',
});
this.initialize();
return this.innerApiCalls.updateDatabaseDdl(request, options, callback);
Expand Down Expand Up @@ -1831,7 +1831,7 @@ export class DatabaseAdminClient {
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.createBackup(request, options, callback);
Expand Down Expand Up @@ -2004,7 +2004,7 @@ export class DatabaseAdminClient {
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.copyBackup(request, options, callback);
Expand Down Expand Up @@ -2177,7 +2177,7 @@ export class DatabaseAdminClient {
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.restoreDatabase(request, options, callback);
Expand Down Expand Up @@ -2314,7 +2314,7 @@ export class DatabaseAdminClient {
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.listDatabases(request, options, callback);
Expand Down Expand Up @@ -2356,7 +2356,7 @@ export class DatabaseAdminClient {
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['listDatabases'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2407,7 +2407,7 @@ export class DatabaseAdminClient {
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['listDatabases'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2554,7 +2554,7 @@ export class DatabaseAdminClient {
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.listBackups(request, options, callback);
Expand Down Expand Up @@ -2633,7 +2633,7 @@ export class DatabaseAdminClient {
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['listBackups'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2721,7 +2721,7 @@ export class DatabaseAdminClient {
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['listBackups'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2880,7 +2880,7 @@ export class DatabaseAdminClient {
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.listDatabaseOperations(
Expand Down Expand Up @@ -2970,7 +2970,7 @@ export class DatabaseAdminClient {
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['listDatabaseOperations'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -3065,7 +3065,7 @@ export class DatabaseAdminClient {
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['listDatabaseOperations'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -3250,7 +3250,7 @@ export class DatabaseAdminClient {
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.listBackupOperations(request, options, callback);
Expand Down Expand Up @@ -3360,7 +3360,7 @@ export class DatabaseAdminClient {
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['listBackupOperations'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -3479,7 +3479,7 @@ export class DatabaseAdminClient {
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['listBackupOperations'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -3588,7 +3588,7 @@ export class DatabaseAdminClient {
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.listDatabaseRoles(request, options, callback);
Expand Down Expand Up @@ -3631,7 +3631,7 @@ export class DatabaseAdminClient {
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['listDatabaseRoles'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -3683,7 +3683,7 @@ export class DatabaseAdminClient {
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['listDatabaseRoles'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
28 changes: 14 additions & 14 deletions src/v1/instance_admin_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ export class InstanceAdminClient {
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.getInstanceConfig(request, options, callback);
Expand Down Expand Up @@ -633,7 +633,7 @@ export class InstanceAdminClient {
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.getInstance(request, options, callback);
Expand Down Expand Up @@ -741,7 +741,7 @@ export class InstanceAdminClient {
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.deleteInstance(request, options, callback);
Expand Down Expand Up @@ -840,7 +840,7 @@ export class InstanceAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
resource: request.resource || '',
resource: request.resource ?? '',
});
this.initialize();
return this.innerApiCalls.setIamPolicy(request, options, callback);
Expand Down Expand Up @@ -931,7 +931,7 @@ export class InstanceAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
resource: request.resource || '',
resource: request.resource ?? '',
});
this.initialize();
return this.innerApiCalls.getIamPolicy(request, options, callback);
Expand Down Expand Up @@ -1025,7 +1025,7 @@ export class InstanceAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
resource: request.resource || '',
resource: request.resource ?? '',
});
this.initialize();
return this.innerApiCalls.testIamPermissions(request, options, callback);
Expand Down Expand Up @@ -1170,7 +1170,7 @@ export class InstanceAdminClient {
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.createInstance(request, options, callback);
Expand Down Expand Up @@ -1353,7 +1353,7 @@ export class InstanceAdminClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'instance.name': request.instance!.name || '',
'instance.name': request.instance!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateInstance(request, options, callback);
Expand Down Expand Up @@ -1491,7 +1491,7 @@ export class InstanceAdminClient {
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.listInstanceConfigs(request, options, callback);
Expand Down Expand Up @@ -1534,7 +1534,7 @@ export class InstanceAdminClient {
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['listInstanceConfigs'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1586,7 +1586,7 @@ export class InstanceAdminClient {
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['listInstanceConfigs'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1714,7 +1714,7 @@ export class InstanceAdminClient {
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.listInstances(request, options, callback);
Expand Down Expand Up @@ -1776,7 +1776,7 @@ export class InstanceAdminClient {
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['listInstances'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1847,7 +1847,7 @@ export class InstanceAdminClient {
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['listInstances'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
Loading