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

Commit

Permalink
fix: preserve default values in x-goog-request-params header (#820)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-typescript v2.17.0

PiperOrigin-RevId: 474338479

Source-Link: googleapis/googleapis@d5d35e0

Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* test: use fully qualified request type name in tests

PiperOrigin-RevId: 475685359

Source-Link: googleapis/googleapis@7a12973

Source-Link: https://github.com/googleapis/googleapis-gen/commit/370c729e2ba062a167449c27882ba5f379c5c34d
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* test: fix translation

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Alexander Fenster <[email protected]>
  • Loading branch information
3 people authored Sep 21, 2022
1 parent 079a099 commit 913ac11
Show file tree
Hide file tree
Showing 6 changed files with 1,154 additions and 1,044 deletions.
2 changes: 1 addition & 1 deletion samples/test/v3/translate_translate_text.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ describe(REGION_TAG, () => {
const output = execSync(
`node v3/${REGION_TAG}.js ${projectId} ${location} ${text}`
);
assert.match(output, /Translation: Zdravo svijete/);
assert.match(output, /Translation: Здраво Свете/);
});
});
2 changes: 1 addition & 1 deletion samples/test/v3beta1/translate_translate_text_beta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ describe(REGION_TAG, () => {
const output = execSync(
`node v3beta1/${REGION_TAG}.js ${projectId} ${location} ${text}`
);
assert.match(output, /Translation: Zdravo svijete/);
assert.match(output, /Translation: Здраво Свете/);
});
});
24 changes: 12 additions & 12 deletions src/v3/translation_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ export class TranslationServiceClient {
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.translateText(request, options, callback);
Expand Down Expand Up @@ -717,7 +717,7 @@ export class TranslationServiceClient {
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.detectLanguage(request, options, callback);
Expand Down Expand Up @@ -844,7 +844,7 @@ export class TranslationServiceClient {
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.getSupportedLanguages(request, options, callback);
Expand Down Expand Up @@ -992,7 +992,7 @@ export class TranslationServiceClient {
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.translateDocument(request, options, callback);
Expand Down Expand Up @@ -1078,7 +1078,7 @@ export class TranslationServiceClient {
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.getGlossary(request, options, callback);
Expand Down Expand Up @@ -1238,7 +1238,7 @@ export class TranslationServiceClient {
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.batchTranslateText(request, options, callback);
Expand Down Expand Up @@ -1435,7 +1435,7 @@ export class TranslationServiceClient {
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.batchTranslateDocument(
Expand Down Expand Up @@ -1580,7 +1580,7 @@ export class TranslationServiceClient {
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.createGlossary(request, options, callback);
Expand Down Expand Up @@ -1720,7 +1720,7 @@ export class TranslationServiceClient {
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.deleteGlossary(request, options, callback);
Expand Down Expand Up @@ -1875,7 +1875,7 @@ export class TranslationServiceClient {
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.listGlossaries(request, options, callback);
Expand Down Expand Up @@ -1934,7 +1934,7 @@ export class TranslationServiceClient {
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['listGlossaries'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2002,7 +2002,7 @@ export class TranslationServiceClient {
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['listGlossaries'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
24 changes: 12 additions & 12 deletions src/v3beta1/translation_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ export class TranslationServiceClient {
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.translateText(request, options, callback);
Expand Down Expand Up @@ -722,7 +722,7 @@ export class TranslationServiceClient {
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.detectLanguage(request, options, callback);
Expand Down Expand Up @@ -849,7 +849,7 @@ export class TranslationServiceClient {
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.getSupportedLanguages(request, options, callback);
Expand Down Expand Up @@ -1002,7 +1002,7 @@ export class TranslationServiceClient {
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.translateDocument(request, options, callback);
Expand Down Expand Up @@ -1094,7 +1094,7 @@ export class TranslationServiceClient {
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.getGlossary(request, options, callback);
Expand Down Expand Up @@ -1253,7 +1253,7 @@ export class TranslationServiceClient {
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.batchTranslateText(request, options, callback);
Expand Down Expand Up @@ -1450,7 +1450,7 @@ export class TranslationServiceClient {
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.batchTranslateDocument(
Expand Down Expand Up @@ -1595,7 +1595,7 @@ export class TranslationServiceClient {
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.createGlossary(request, options, callback);
Expand Down Expand Up @@ -1735,7 +1735,7 @@ export class TranslationServiceClient {
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.deleteGlossary(request, options, callback);
Expand Down Expand Up @@ -1890,7 +1890,7 @@ export class TranslationServiceClient {
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.listGlossaries(request, options, callback);
Expand Down Expand Up @@ -1949,7 +1949,7 @@ export class TranslationServiceClient {
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['listGlossaries'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2017,7 +2017,7 @@ export class TranslationServiceClient {
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['listGlossaries'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
Loading

0 comments on commit 913ac11

Please sign in to comment.