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

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

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
22 changes: 11 additions & 11 deletions src/v3/agents_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ export class AgentsClient {
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.getAgent(request, options, callback);
Expand Down Expand Up @@ -664,7 +664,7 @@ export class AgentsClient {
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.createAgent(request, options, callback);
Expand Down Expand Up @@ -762,7 +762,7 @@ export class AgentsClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'agent.name': request.agent!.name || '',
'agent.name': request.agent!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateAgent(request, options, callback);
Expand Down Expand Up @@ -854,7 +854,7 @@ export class AgentsClient {
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.deleteAgent(request, options, callback);
Expand Down Expand Up @@ -950,7 +950,7 @@ export class AgentsClient {
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.validateAgent(request, options, callback);
Expand Down Expand Up @@ -1052,7 +1052,7 @@ export class AgentsClient {
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.getAgentValidationResult(
Expand Down Expand Up @@ -1186,7 +1186,7 @@ export class AgentsClient {
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.exportAgent(request, options, callback);
Expand Down Expand Up @@ -1355,7 +1355,7 @@ export class AgentsClient {
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.restoreAgent(request, options, callback);
Expand Down Expand Up @@ -1487,7 +1487,7 @@ export class AgentsClient {
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.listAgents(request, options, callback);
Expand Down Expand Up @@ -1527,7 +1527,7 @@ export class AgentsClient {
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['listAgents'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1576,7 +1576,7 @@ export class AgentsClient {
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['listAgents'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
8 changes: 4 additions & 4 deletions src/v3/changelogs_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ export class ChangelogsClient {
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.getChangelog(request, options, callback);
Expand Down Expand Up @@ -658,7 +658,7 @@ export class ChangelogsClient {
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.listChangelogs(request, options, callback);
Expand Down Expand Up @@ -719,7 +719,7 @@ export class ChangelogsClient {
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['listChangelogs'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -789,7 +789,7 @@ export class ChangelogsClient {
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['listChangelogs'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
8 changes: 4 additions & 4 deletions src/v3/deployments_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ export class DeploymentsClient {
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.getDeployment(request, options, callback);
Expand Down Expand Up @@ -638,7 +638,7 @@ export class DeploymentsClient {
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.listDeployments(request, options, callback);
Expand Down Expand Up @@ -679,7 +679,7 @@ export class DeploymentsClient {
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['listDeployments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -729,7 +729,7 @@ export class DeploymentsClient {
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['listDeployments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
14 changes: 7 additions & 7 deletions src/v3/entity_types_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export class EntityTypesClient {
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.getEntityType(request, options, callback);
Expand Down Expand Up @@ -665,7 +665,7 @@ export class EntityTypesClient {
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.createEntityType(request, options, callback);
Expand Down Expand Up @@ -774,7 +774,7 @@ export class EntityTypesClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'entity_type.name': request.entityType!.name || '',
'entity_type.name': request.entityType!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateEntityType(request, options, callback);
Expand Down Expand Up @@ -882,7 +882,7 @@ export class EntityTypesClient {
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.deleteEntityType(request, options, callback);
Expand Down Expand Up @@ -996,7 +996,7 @@ export class EntityTypesClient {
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.listEntityTypes(request, options, callback);
Expand Down Expand Up @@ -1049,7 +1049,7 @@ export class EntityTypesClient {
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['listEntityTypes'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1111,7 +1111,7 @@ export class EntityTypesClient {
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['listEntityTypes'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
30 changes: 15 additions & 15 deletions src/v3/environments_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export class EnvironmentsClient {
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.getEnvironment(request, options, callback);
Expand Down Expand Up @@ -704,7 +704,7 @@ export class EnvironmentsClient {
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.deleteEnvironment(request, options, callback);
Expand Down Expand Up @@ -819,7 +819,7 @@ export class EnvironmentsClient {
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.createEnvironment(request, options, callback);
Expand Down Expand Up @@ -967,7 +967,7 @@ export class EnvironmentsClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'environment.name': request.environment!.name || '',
'environment.name': request.environment!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateEnvironment(request, options, callback);
Expand Down Expand Up @@ -1113,7 +1113,7 @@ export class EnvironmentsClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
environment: request.environment || '',
environment: request.environment ?? '',
});
this.initialize();
return this.innerApiCalls.runContinuousTest(request, options, callback);
Expand Down Expand Up @@ -1264,7 +1264,7 @@ export class EnvironmentsClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
environment: request.environment || '',
environment: request.environment ?? '',
});
this.initialize();
return this.innerApiCalls.deployFlow(request, options, callback);
Expand Down Expand Up @@ -1399,7 +1399,7 @@ export class EnvironmentsClient {
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.listEnvironments(request, options, callback);
Expand Down Expand Up @@ -1439,7 +1439,7 @@ export class EnvironmentsClient {
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['listEnvironments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1488,7 +1488,7 @@ export class EnvironmentsClient {
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['listEnvironments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1595,7 +1595,7 @@ export class EnvironmentsClient {
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.lookupEnvironmentHistory(
Expand Down Expand Up @@ -1640,7 +1640,7 @@ export class EnvironmentsClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
const defaultCallSettings = this._defaults['lookupEnvironmentHistory'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1690,7 +1690,7 @@ export class EnvironmentsClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
const defaultCallSettings = this._defaults['lookupEnvironmentHistory'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1797,7 +1797,7 @@ export class EnvironmentsClient {
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.listContinuousTestResults(
Expand Down Expand Up @@ -1842,7 +1842,7 @@ export class EnvironmentsClient {
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['listContinuousTestResults'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1892,7 +1892,7 @@ export class EnvironmentsClient {
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['listContinuousTestResults'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
Loading