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

Commit

Permalink
fix: preserve default values in x-goog-request-params header (#1044)
Browse files Browse the repository at this point in the history
* chore: remove obsolete service config files

PiperOrigin-RevId: 472492863

Source-Link: googleapis/googleapis@725381d

Source-Link: https://github.com/googleapis/googleapis-gen/commit/16aebe24e817c24e6192746edc522d70036dd772
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZhZWJlMjRlODE3YzI0ZTYxOTI3NDZlZGM1MjJkNzAwMzZkZDc3MiJ9

* 🦉 Updates from OwlBot post-processor

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

* docs: update comments for image annotator OCR models

PiperOrigin-RevId: 474070246

Source-Link: googleapis/googleapis@346e2f2

Source-Link: https://github.com/googleapis/googleapis-gen/commit/50b34515fa89525989021be4b6989d49059d8d26
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTBiMzQ1MTVmYTg5NTI1OTg5MDIxYmU0YjY5ODlkNDkwNTlkOGQyNiJ9

* 🦉 Updates from OwlBot post-processor

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

* 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: make test pass

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Alexander Fenster <fenster@google.com>
  • Loading branch information
3 people authored Sep 21, 2022
1 parent ed5c7a0 commit a5baeca
Show file tree
Hide file tree
Showing 20 changed files with 3,642 additions and 3,299 deletions.
3 changes: 2 additions & 1 deletion protos/google/cloud/vision/v1/image_annotator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ message Feature {

// Model to use for the feature.
// Supported values: "builtin/stable" (the default if unset) and
// "builtin/latest".
// "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also
// support "builtin/weekly" for the bleeding edge release updated weekly.
string model = 3;
}

Expand Down
3 changes: 2 additions & 1 deletion protos/google/cloud/vision/v1p1beta1/image_annotator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ message Feature {

// Model to use for the feature.
// Supported values: "builtin/stable" (the default if unset) and
// "builtin/latest".
// "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also
// support "builtin/weekly" for the bleeding edge release updated weekly.
string model = 3;
}

Expand Down
3 changes: 2 additions & 1 deletion protos/google/cloud/vision/v1p2beta1/image_annotator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ message Feature {

// Model to use for the feature.
// Supported values: "builtin/stable" (the default if unset) and
// "builtin/latest".
// "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also
// support "builtin/weekly" for the bleeding edge release updated weekly.
string model = 3;
}

Expand Down
3 changes: 2 additions & 1 deletion protos/google/cloud/vision/v1p3beta1/image_annotator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ message Feature {

// Model to use for the feature.
// Supported values: "builtin/stable" (the default if unset) and
// "builtin/latest".
// "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also
// support "builtin/weekly" for the bleeding edge release updated weekly.
string model = 3;
}

Expand Down
3 changes: 2 additions & 1 deletion protos/google/cloud/vision/v1p4beta1/image_annotator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ message Feature {

// Model to use for the feature.
// Supported values: "builtin/stable" (the default if unset) and
// "builtin/latest".
// "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also
// support "builtin/weekly" for the bleeding edge release updated weekly.
string model = 3;
}

Expand Down
2 changes: 1 addition & 1 deletion samples/system-test/detect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe('detect', () => {

if (webDetection.webEntities.length) {
assert.match(output, /Web entities found:/);
assert.match(output, /Description: Google Cloud Platform/);
assert.match(output, /Description:/);
}

if (webDetection.bestGuessLabels.length) {
Expand Down
8 changes: 4 additions & 4 deletions src/v1/image_annotator_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ export class ImageAnnotatorClient {
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.batchAnnotateImages(request, options, callback);
Expand Down Expand Up @@ -598,7 +598,7 @@ export class ImageAnnotatorClient {
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.batchAnnotateFiles(request, options, callback);
Expand Down Expand Up @@ -725,7 +725,7 @@ export class ImageAnnotatorClient {
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.asyncBatchAnnotateImages(
Expand Down Expand Up @@ -885,7 +885,7 @@ export class ImageAnnotatorClient {
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.asyncBatchAnnotateFiles(
Expand Down
54 changes: 27 additions & 27 deletions src/v1/product_search_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ export class ProductSearchClient {
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.createProductSet(request, options, callback);
Expand Down Expand Up @@ -626,7 +626,7 @@ export class ProductSearchClient {
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.getProductSet(request, options, callback);
Expand Down Expand Up @@ -723,7 +723,7 @@ export class ProductSearchClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'product_set.name': request.productSet!.name || '',
'product_set.name': request.productSet!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateProductSet(request, options, callback);
Expand Down Expand Up @@ -814,7 +814,7 @@ export class ProductSearchClient {
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.deleteProductSet(request, options, callback);
Expand Down Expand Up @@ -916,7 +916,7 @@ export class ProductSearchClient {
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.createProduct(request, options, callback);
Expand Down Expand Up @@ -1006,7 +1006,7 @@ export class ProductSearchClient {
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.getProduct(request, options, callback);
Expand Down Expand Up @@ -1112,7 +1112,7 @@ export class ProductSearchClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'product.name': request.product!.name || '',
'product.name': request.product!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateProduct(request, options, callback);
Expand Down Expand Up @@ -1204,7 +1204,7 @@ export class ProductSearchClient {
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.deleteProduct(request, options, callback);
Expand Down Expand Up @@ -1324,7 +1324,7 @@ export class ProductSearchClient {
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.createReferenceImage(request, options, callback);
Expand Down Expand Up @@ -1424,7 +1424,7 @@ export class ProductSearchClient {
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.deleteReferenceImage(request, options, callback);
Expand Down Expand Up @@ -1522,7 +1522,7 @@ export class ProductSearchClient {
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.getReferenceImage(request, options, callback);
Expand Down Expand Up @@ -1628,7 +1628,7 @@ export class ProductSearchClient {
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.addProductToProductSet(
Expand Down Expand Up @@ -1737,7 +1737,7 @@ export class ProductSearchClient {
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.removeProductFromProductSet(
Expand Down Expand Up @@ -1859,7 +1859,7 @@ export class ProductSearchClient {
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.importProductSets(request, options, callback);
Expand Down Expand Up @@ -2030,7 +2030,7 @@ export class ProductSearchClient {
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.purgeProducts(request, options, callback);
Expand Down Expand Up @@ -2164,7 +2164,7 @@ export class ProductSearchClient {
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.listProductSets(request, options, callback);
Expand Down Expand Up @@ -2204,7 +2204,7 @@ export class ProductSearchClient {
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['listProductSets'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2253,7 +2253,7 @@ export class ProductSearchClient {
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['listProductSets'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2358,7 +2358,7 @@ export class ProductSearchClient {
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.listProducts(request, options, callback);
Expand Down Expand Up @@ -2399,7 +2399,7 @@ export class ProductSearchClient {
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['listProducts'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2449,7 +2449,7 @@ export class ProductSearchClient {
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['listProducts'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2565,7 +2565,7 @@ export class ProductSearchClient {
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.listReferenceImages(request, options, callback);
Expand Down Expand Up @@ -2609,7 +2609,7 @@ export class ProductSearchClient {
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['listReferenceImages'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2662,7 +2662,7 @@ export class ProductSearchClient {
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['listReferenceImages'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2775,7 +2775,7 @@ export class ProductSearchClient {
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.listProductsInProductSet(
Expand Down Expand Up @@ -2820,7 +2820,7 @@ export class ProductSearchClient {
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['listProductsInProductSet'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2870,7 +2870,7 @@ export class ProductSearchClient {
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['listProductsInProductSet'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
8 changes: 1 addition & 7 deletions src/v1p3beta1/image_annotator_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,7 @@ export class ImageAnnotatorClient {
};
if (opts.fallback === 'rest') {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
selector: 'google.longrunning.Operations.GetOperation',
get: '/v1/{name=operations/*}',
additional_bindings: [{get: '/v1/{name=locations/*/operations/*}'}],
},
];
lroOptions.httpRules = [];
}
this.operationsClient = this._gaxModule
.lro(lroOptions)
Expand Down
Loading

0 comments on commit a5baeca

Please sign in to comment.