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

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

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
46 changes: 23 additions & 23 deletions src/v1/device_manager_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ export class DeviceManagerClient {
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.createDeviceRegistry(request, options, callback);
Expand Down Expand Up @@ -534,7 +534,7 @@ export class DeviceManagerClient {
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.getDeviceRegistry(request, options, callback);
Expand Down Expand Up @@ -633,7 +633,7 @@ export class DeviceManagerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'device_registry.name': request.deviceRegistry!.name || '',
'device_registry.name': request.deviceRegistry!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateDeviceRegistry(request, options, callback);
Expand Down Expand Up @@ -725,7 +725,7 @@ export class DeviceManagerClient {
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.deleteDeviceRegistry(request, options, callback);
Expand Down Expand Up @@ -814,7 +814,7 @@ export class DeviceManagerClient {
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.createDevice(request, options, callback);
Expand Down Expand Up @@ -903,7 +903,7 @@ export class DeviceManagerClient {
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.getDevice(request, options, callback);
Expand Down Expand Up @@ -994,7 +994,7 @@ export class DeviceManagerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'device.name': request.device!.name || '',
'device.name': request.device!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateDevice(request, options, callback);
Expand Down Expand Up @@ -1079,7 +1079,7 @@ export class DeviceManagerClient {
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.deleteDevice(request, options, callback);
Expand Down Expand Up @@ -1182,7 +1182,7 @@ export class DeviceManagerClient {
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.modifyCloudToDeviceConfig(
Expand Down Expand Up @@ -1284,7 +1284,7 @@ export class DeviceManagerClient {
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.listDeviceConfigVersions(
Expand Down Expand Up @@ -1380,7 +1380,7 @@ export class DeviceManagerClient {
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.listDeviceStates(request, options, callback);
Expand Down Expand Up @@ -1476,7 +1476,7 @@ export class DeviceManagerClient {
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 @@ -1565,7 +1565,7 @@ export class DeviceManagerClient {
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 @@ -1656,7 +1656,7 @@ export class DeviceManagerClient {
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 @@ -1763,7 +1763,7 @@ export class DeviceManagerClient {
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.sendCommandToDevice(request, options, callback);
Expand Down Expand Up @@ -1856,7 +1856,7 @@ export class DeviceManagerClient {
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.bindDeviceToGateway(request, options, callback);
Expand Down Expand Up @@ -1955,7 +1955,7 @@ export class DeviceManagerClient {
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.unbindDeviceFromGateway(
Expand Down Expand Up @@ -2064,7 +2064,7 @@ export class DeviceManagerClient {
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.listDeviceRegistries(request, options, callback);
Expand Down Expand Up @@ -2108,7 +2108,7 @@ export class DeviceManagerClient {
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['listDeviceRegistries'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2161,7 +2161,7 @@ export class DeviceManagerClient {
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['listDeviceRegistries'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2276,7 +2276,7 @@ export class DeviceManagerClient {
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.listDevices(request, options, callback);
Expand Down Expand Up @@ -2333,7 +2333,7 @@ export class DeviceManagerClient {
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['listDevices'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2399,7 +2399,7 @@ export class DeviceManagerClient {
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['listDevices'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
Loading