diff --git a/packages/google-cloud-retail/protos/protos.d.ts b/packages/google-cloud-retail/protos/protos.d.ts index da9cee99d27..113813bb115 100644 --- a/packages/google-cloud-retail/protos/protos.d.ts +++ b/packages/google-cloud-retail/protos/protos.d.ts @@ -1405,7 +1405,7 @@ export namespace google { constructor(properties?: google.cloud.retail.v2.IImportErrorsConfig); /** ImportErrorsConfig gcsPrefix. */ - public gcsPrefix: string; + public gcsPrefix?: (string|null); /** ImportErrorsConfig destination. */ public destination?: "gcsPrefix"; @@ -6044,7 +6044,7 @@ export namespace google { constructor(properties?: google.cloud.retail.v2alpha.IImportErrorsConfig); /** ImportErrorsConfig gcsPrefix. */ - public gcsPrefix: string; + public gcsPrefix?: (string|null); /** ImportErrorsConfig destination. */ public destination?: "gcsPrefix"; @@ -10683,7 +10683,7 @@ export namespace google { constructor(properties?: google.cloud.retail.v2beta.IImportErrorsConfig); /** ImportErrorsConfig gcsPrefix. */ - public gcsPrefix: string; + public gcsPrefix?: (string|null); /** ImportErrorsConfig destination. */ public destination?: "gcsPrefix"; @@ -14088,19 +14088,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); @@ -19066,16 +19066,16 @@ export namespace google { constructor(properties?: google.protobuf.IValue); /** Value nullValue. */ - public nullValue: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue); + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value numberValue. */ - public numberValue: number; + public numberValue?: (number|null); /** Value stringValue. */ - public stringValue: string; + public stringValue?: (string|null); /** Value boolValue. */ - public boolValue: boolean; + public boolValue?: (boolean|null); /** Value structValue. */ public structValue?: (google.protobuf.IStruct|null); diff --git a/packages/google-cloud-retail/protos/protos.js b/packages/google-cloud-retail/protos/protos.js index 7545289e638..1bbefd56c22 100644 --- a/packages/google-cloud-retail/protos/protos.js +++ b/packages/google-cloud-retail/protos/protos.js @@ -3231,11 +3231,11 @@ /** * ImportErrorsConfig gcsPrefix. - * @member {string} gcsPrefix + * @member {string|null|undefined} gcsPrefix * @memberof google.cloud.retail.v2.ImportErrorsConfig * @instance */ - ImportErrorsConfig.prototype.gcsPrefix = ""; + ImportErrorsConfig.prototype.gcsPrefix = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -14439,11 +14439,11 @@ /** * ImportErrorsConfig gcsPrefix. - * @member {string} gcsPrefix + * @member {string|null|undefined} gcsPrefix * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @instance */ - ImportErrorsConfig.prototype.gcsPrefix = ""; + ImportErrorsConfig.prototype.gcsPrefix = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -25647,11 +25647,11 @@ /** * ImportErrorsConfig gcsPrefix. - * @member {string} gcsPrefix + * @member {string|null|undefined} gcsPrefix * @memberof google.cloud.retail.v2beta.ImportErrorsConfig * @instance */ - ImportErrorsConfig.prototype.gcsPrefix = ""; + ImportErrorsConfig.prototype.gcsPrefix = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -33971,43 +33971,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. @@ -47027,35 +47027,35 @@ /** * Value nullValue. - * @member {google.protobuf.NullValue} nullValue + * @member {google.protobuf.NullValue|null|undefined} nullValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.nullValue = 0; + Value.prototype.nullValue = null; /** * Value numberValue. - * @member {number} numberValue + * @member {number|null|undefined} numberValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.numberValue = 0; + Value.prototype.numberValue = null; /** * Value stringValue. - * @member {string} stringValue + * @member {string|null|undefined} stringValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.stringValue = ""; + Value.prototype.stringValue = null; /** * Value boolValue. - * @member {boolean} boolValue + * @member {boolean|null|undefined} boolValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.boolValue = false; + Value.prototype.boolValue = null; /** * Value structValue. diff --git a/packages/google-cloud-retail/src/v2/catalog_service_client.ts b/packages/google-cloud-retail/src/v2/catalog_service_client.ts index 87b28f49839..79d5313de0a 100644 --- a/packages/google-cloud-retail/src/v2/catalog_service_client.ts +++ b/packages/google-cloud-retail/src/v2/catalog_service_client.ts @@ -236,13 +236,14 @@ export class CatalogServiceClient { const catalogServiceStubMethods = ['listCatalogs', 'updateCatalog']; for (const methodName of catalogServiceStubMethods) { const callPromise = this.catalogServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -408,11 +409,10 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'catalog.name': request.catalog!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'catalog.name': request.catalog!.name || '', + }); this.initialize(); return this.innerApiCalls.updateCatalog(request, options, callback); } @@ -521,11 +521,10 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listCatalogs(request, options, callback); } @@ -578,11 +577,10 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listCatalogs.createStream( @@ -646,17 +644,16 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listCatalogs.asyncIterate( this.innerApiCalls['listCatalogs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-retail/src/v2/prediction_service_client.ts b/packages/google-cloud-retail/src/v2/prediction_service_client.ts index cbae29e9982..ad39a04e484 100644 --- a/packages/google-cloud-retail/src/v2/prediction_service_client.ts +++ b/packages/google-cloud-retail/src/v2/prediction_service_client.ts @@ -213,13 +213,14 @@ export class PredictionServiceClient { const predictionServiceStubMethods = ['predict']; for (const methodName of predictionServiceStubMethods) { const callPromise = this.predictionServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -462,11 +463,10 @@ export class PredictionServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - placement: request.placement || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + placement: request.placement || '', + }); this.initialize(); return this.innerApiCalls.predict(request, options, callback); } diff --git a/packages/google-cloud-retail/src/v2/product_service_client.ts b/packages/google-cloud-retail/src/v2/product_service_client.ts index 02eb955de08..fb4959086a2 100644 --- a/packages/google-cloud-retail/src/v2/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2/product_service_client.ts @@ -261,13 +261,14 @@ export class ProductServiceClient { ]; for (const methodName of productServiceStubMethods) { const callPromise = this.productServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -436,11 +437,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createProduct(request, options, callback); } @@ -529,11 +529,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getProduct(request, options, callback); } @@ -630,11 +629,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'product.name': request.product!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'product.name': request.product!.name || '', + }); this.initialize(); return this.innerApiCalls.updateProduct(request, options, callback); } @@ -725,11 +723,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteProduct(request, options, callback); } @@ -848,11 +845,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.importProducts(request, options, callback); } diff --git a/packages/google-cloud-retail/src/v2/user_event_service_client.ts b/packages/google-cloud-retail/src/v2/user_event_service_client.ts index c104d166949..c9d9e189ac0 100644 --- a/packages/google-cloud-retail/src/v2/user_event_service_client.ts +++ b/packages/google-cloud-retail/src/v2/user_event_service_client.ts @@ -279,13 +279,14 @@ export class UserEventServiceClient { ]; for (const methodName of userEventServiceStubMethods) { const callPromise = this.userEventServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -438,11 +439,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.writeUserEvent(request, options, callback); } @@ -541,11 +541,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.collectUserEvent(request, options, callback); } @@ -680,11 +679,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.purgeUserEvents(request, options, callback); } @@ -833,11 +831,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.importUserEvents(request, options, callback); } @@ -987,11 +984,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.rejoinUserEvents(request, options, callback); } diff --git a/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts b/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts index f5125242fda..0b6999f8d91 100644 --- a/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts @@ -236,13 +236,14 @@ export class CatalogServiceClient { const catalogServiceStubMethods = ['listCatalogs', 'updateCatalog']; for (const methodName of catalogServiceStubMethods) { const callPromise = this.catalogServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -414,11 +415,10 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'catalog.name': request.catalog!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'catalog.name': request.catalog!.name || '', + }); this.initialize(); return this.innerApiCalls.updateCatalog(request, options, callback); } @@ -533,11 +533,10 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listCatalogs(request, options, callback); } @@ -590,11 +589,10 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listCatalogs.createStream( @@ -658,17 +656,16 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listCatalogs.asyncIterate( this.innerApiCalls['listCatalogs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts b/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts index 7bebb167ba2..c4c0f3007b9 100644 --- a/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts @@ -213,13 +213,14 @@ export class PredictionServiceClient { const predictionServiceStubMethods = ['predict']; for (const methodName of predictionServiceStubMethods) { const callPromise = this.predictionServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -462,11 +463,10 @@ export class PredictionServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - placement: request.placement || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + placement: request.placement || '', + }); this.initialize(); return this.innerApiCalls.predict(request, options, callback); } diff --git a/packages/google-cloud-retail/src/v2alpha/product_service_client.ts b/packages/google-cloud-retail/src/v2alpha/product_service_client.ts index 367078cfc4a..981173684ae 100644 --- a/packages/google-cloud-retail/src/v2alpha/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/product_service_client.ts @@ -261,13 +261,14 @@ export class ProductServiceClient { ]; for (const methodName of productServiceStubMethods) { const callPromise = this.productServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -442,11 +443,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createProduct(request, options, callback); } @@ -537,11 +537,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getProduct(request, options, callback); } @@ -644,11 +643,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'product.name': request.product!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'product.name': request.product!.name || '', + }); this.initialize(); return this.innerApiCalls.updateProduct(request, options, callback); } @@ -745,11 +743,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteProduct(request, options, callback); } @@ -868,11 +865,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.importProducts(request, options, callback); } diff --git a/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts b/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts index 34b654f5b89..bd83f8dc2af 100644 --- a/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts @@ -279,13 +279,14 @@ export class UserEventServiceClient { ]; for (const methodName of userEventServiceStubMethods) { const callPromise = this.userEventServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -444,11 +445,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.writeUserEvent(request, options, callback); } @@ -553,11 +553,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.collectUserEvent(request, options, callback); } @@ -693,11 +692,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.purgeUserEvents(request, options, callback); } @@ -846,11 +844,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.importUserEvents(request, options, callback); } @@ -1000,11 +997,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.rejoinUserEvents(request, options, callback); } diff --git a/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts b/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts index e6979275172..e5c5a6aba58 100644 --- a/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts @@ -236,13 +236,14 @@ export class CatalogServiceClient { const catalogServiceStubMethods = ['listCatalogs', 'updateCatalog']; for (const methodName of catalogServiceStubMethods) { const callPromise = this.catalogServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -414,11 +415,10 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'catalog.name': request.catalog!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'catalog.name': request.catalog!.name || '', + }); this.initialize(); return this.innerApiCalls.updateCatalog(request, options, callback); } @@ -533,11 +533,10 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listCatalogs(request, options, callback); } @@ -590,11 +589,10 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listCatalogs.createStream( @@ -658,17 +656,16 @@ export class CatalogServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listCatalogs.asyncIterate( this.innerApiCalls['listCatalogs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts b/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts index 34caddd4654..91dae2d7ec2 100644 --- a/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts @@ -213,13 +213,14 @@ export class PredictionServiceClient { const predictionServiceStubMethods = ['predict']; for (const methodName of predictionServiceStubMethods) { const callPromise = this.predictionServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -462,11 +463,10 @@ export class PredictionServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - placement: request.placement || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + placement: request.placement || '', + }); this.initialize(); return this.innerApiCalls.predict(request, options, callback); } diff --git a/packages/google-cloud-retail/src/v2beta/product_service_client.ts b/packages/google-cloud-retail/src/v2beta/product_service_client.ts index 4cad5dac5ed..604066c7139 100644 --- a/packages/google-cloud-retail/src/v2beta/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/product_service_client.ts @@ -261,13 +261,14 @@ export class ProductServiceClient { ]; for (const methodName of productServiceStubMethods) { const callPromise = this.productServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -442,11 +443,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createProduct(request, options, callback); } @@ -537,11 +537,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getProduct(request, options, callback); } @@ -644,11 +643,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'product.name': request.product!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'product.name': request.product!.name || '', + }); this.initialize(); return this.innerApiCalls.updateProduct(request, options, callback); } @@ -745,11 +743,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteProduct(request, options, callback); } @@ -868,11 +865,10 @@ export class ProductServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.importProducts(request, options, callback); } diff --git a/packages/google-cloud-retail/src/v2beta/user_event_service_client.ts b/packages/google-cloud-retail/src/v2beta/user_event_service_client.ts index 116724fea44..ad15071aa50 100644 --- a/packages/google-cloud-retail/src/v2beta/user_event_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/user_event_service_client.ts @@ -279,13 +279,14 @@ export class UserEventServiceClient { ]; for (const methodName of userEventServiceStubMethods) { const callPromise = this.userEventServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -444,11 +445,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.writeUserEvent(request, options, callback); } @@ -553,11 +553,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.collectUserEvent(request, options, callback); } @@ -693,11 +692,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.purgeUserEvents(request, options, callback); } @@ -846,11 +844,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.importUserEvents(request, options, callback); } @@ -1000,11 +997,10 @@ export class UserEventServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.rejoinUserEvents(request, options, callback); } diff --git a/packages/google-cloud-retail/test/gapic_catalog_service_v2.ts b/packages/google-cloud-retail/test/gapic_catalog_service_v2.ts index ff99a8a106f..154e29b2e4a 100644 --- a/packages/google-cloud-retail/test/gapic_catalog_service_v2.ts +++ b/packages/google-cloud-retail/test/gapic_catalog_service_v2.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -251,9 +250,8 @@ describe('v2.CatalogServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2.Catalog() ); - client.innerApiCalls.updateCatalog = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateCatalog = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateCatalog( request, @@ -368,9 +366,8 @@ describe('v2.CatalogServiceClient', () => { generateSampleMessage(new protos.google.cloud.retail.v2.Catalog()), generateSampleMessage(new protos.google.cloud.retail.v2.Catalog()), ]; - client.innerApiCalls.listCatalogs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listCatalogs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listCatalogs( request, @@ -442,9 +439,8 @@ describe('v2.CatalogServiceClient', () => { generateSampleMessage(new protos.google.cloud.retail.v2.Catalog()), generateSampleMessage(new protos.google.cloud.retail.v2.Catalog()), ]; - client.descriptors.page.listCatalogs.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listCatalogs.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listCatalogsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.retail.v2.Catalog[] = []; @@ -466,10 +462,9 @@ describe('v2.CatalogServiceClient', () => { .calledWith(client.innerApiCalls.listCatalogs, request) ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -510,10 +505,9 @@ describe('v2.CatalogServiceClient', () => { .calledWith(client.innerApiCalls.listCatalogs, request) ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -534,9 +528,8 @@ describe('v2.CatalogServiceClient', () => { generateSampleMessage(new protos.google.cloud.retail.v2.Catalog()), generateSampleMessage(new protos.google.cloud.retail.v2.Catalog()), ]; - client.descriptors.page.listCatalogs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listCatalogs.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.retail.v2.ICatalog[] = []; const iterable = client.listCatalogsAsync(request); for await (const resource of iterable) { @@ -544,15 +537,15 @@ describe('v2.CatalogServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -569,10 +562,8 @@ describe('v2.CatalogServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listCatalogs.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listCatalogs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listCatalogsAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.retail.v2.ICatalog[] = []; @@ -581,15 +572,15 @@ describe('v2.CatalogServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); diff --git a/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts index e92d12f8ea9..2c29e1bed77 100644 --- a/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -251,9 +250,8 @@ describe('v2alpha.CatalogServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2alpha.Catalog() ); - client.innerApiCalls.updateCatalog = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateCatalog = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateCatalog( request, @@ -368,9 +366,8 @@ describe('v2alpha.CatalogServiceClient', () => { generateSampleMessage(new protos.google.cloud.retail.v2alpha.Catalog()), generateSampleMessage(new protos.google.cloud.retail.v2alpha.Catalog()), ]; - client.innerApiCalls.listCatalogs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listCatalogs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listCatalogs( request, @@ -442,9 +439,8 @@ describe('v2alpha.CatalogServiceClient', () => { generateSampleMessage(new protos.google.cloud.retail.v2alpha.Catalog()), generateSampleMessage(new protos.google.cloud.retail.v2alpha.Catalog()), ]; - client.descriptors.page.listCatalogs.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listCatalogs.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listCatalogsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.retail.v2alpha.Catalog[] = []; @@ -469,10 +465,9 @@ describe('v2alpha.CatalogServiceClient', () => { .calledWith(client.innerApiCalls.listCatalogs, request) ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -516,10 +511,9 @@ describe('v2alpha.CatalogServiceClient', () => { .calledWith(client.innerApiCalls.listCatalogs, request) ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -540,9 +534,8 @@ describe('v2alpha.CatalogServiceClient', () => { generateSampleMessage(new protos.google.cloud.retail.v2alpha.Catalog()), generateSampleMessage(new protos.google.cloud.retail.v2alpha.Catalog()), ]; - client.descriptors.page.listCatalogs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listCatalogs.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.retail.v2alpha.ICatalog[] = []; const iterable = client.listCatalogsAsync(request); for await (const resource of iterable) { @@ -550,15 +543,15 @@ describe('v2alpha.CatalogServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -575,10 +568,8 @@ describe('v2alpha.CatalogServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listCatalogs.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listCatalogs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listCatalogsAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.retail.v2alpha.ICatalog[] = []; @@ -587,15 +578,15 @@ describe('v2alpha.CatalogServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); diff --git a/packages/google-cloud-retail/test/gapic_catalog_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_catalog_service_v2beta.ts index 72bbb12c702..6433b142a5a 100644 --- a/packages/google-cloud-retail/test/gapic_catalog_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_catalog_service_v2beta.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -251,9 +250,8 @@ describe('v2beta.CatalogServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2beta.Catalog() ); - client.innerApiCalls.updateCatalog = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateCatalog = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateCatalog( request, @@ -368,9 +366,8 @@ describe('v2beta.CatalogServiceClient', () => { generateSampleMessage(new protos.google.cloud.retail.v2beta.Catalog()), generateSampleMessage(new protos.google.cloud.retail.v2beta.Catalog()), ]; - client.innerApiCalls.listCatalogs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listCatalogs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listCatalogs( request, @@ -442,9 +439,8 @@ describe('v2beta.CatalogServiceClient', () => { generateSampleMessage(new protos.google.cloud.retail.v2beta.Catalog()), generateSampleMessage(new protos.google.cloud.retail.v2beta.Catalog()), ]; - client.descriptors.page.listCatalogs.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listCatalogs.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listCatalogsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.retail.v2beta.Catalog[] = []; @@ -469,10 +465,9 @@ describe('v2beta.CatalogServiceClient', () => { .calledWith(client.innerApiCalls.listCatalogs, request) ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -516,10 +511,9 @@ describe('v2beta.CatalogServiceClient', () => { .calledWith(client.innerApiCalls.listCatalogs, request) ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -540,9 +534,8 @@ describe('v2beta.CatalogServiceClient', () => { generateSampleMessage(new protos.google.cloud.retail.v2beta.Catalog()), generateSampleMessage(new protos.google.cloud.retail.v2beta.Catalog()), ]; - client.descriptors.page.listCatalogs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listCatalogs.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.retail.v2beta.ICatalog[] = []; const iterable = client.listCatalogsAsync(request); for await (const resource of iterable) { @@ -550,15 +543,15 @@ describe('v2beta.CatalogServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -575,10 +568,8 @@ describe('v2beta.CatalogServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listCatalogs.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listCatalogs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listCatalogsAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.retail.v2beta.ICatalog[] = []; @@ -587,15 +578,15 @@ describe('v2beta.CatalogServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCatalogs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCatalogs.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); diff --git a/packages/google-cloud-retail/test/gapic_prediction_service_v2.ts b/packages/google-cloud-retail/test/gapic_prediction_service_v2.ts index 46d7609dafd..96fcc59fd03 100644 --- a/packages/google-cloud-retail/test/gapic_prediction_service_v2.ts +++ b/packages/google-cloud-retail/test/gapic_prediction_service_v2.ts @@ -26,10 +26,9 @@ import * as predictionserviceModule from '../src'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -186,9 +185,8 @@ describe('v2.PredictionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2.PredictResponse() ); - client.innerApiCalls.predict = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.predict = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.predict( request, diff --git a/packages/google-cloud-retail/test/gapic_prediction_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_prediction_service_v2alpha.ts index d800b9a2bb3..05dd2edfb24 100644 --- a/packages/google-cloud-retail/test/gapic_prediction_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_prediction_service_v2alpha.ts @@ -26,10 +26,9 @@ import * as predictionserviceModule from '../src'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -70,7 +69,8 @@ describe('v2alpha.PredictionServiceClient', () => { }); it('should create a client with no option', () => { - const client = new predictionserviceModule.v2alpha.PredictionServiceClient(); + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient(); assert(client); }); @@ -135,12 +135,11 @@ describe('v2alpha.PredictionServiceClient', () => { describe('predict', () => { it('invokes predict without error', async () => { - const client = new predictionserviceModule.v2alpha.PredictionServiceClient( - { + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.retail.v2alpha.PredictRequest() @@ -168,12 +167,11 @@ describe('v2alpha.PredictionServiceClient', () => { }); it('invokes predict without error using callback', async () => { - const client = new predictionserviceModule.v2alpha.PredictionServiceClient( - { + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.retail.v2alpha.PredictRequest() @@ -190,9 +188,8 @@ describe('v2alpha.PredictionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2alpha.PredictResponse() ); - client.innerApiCalls.predict = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.predict = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.predict( request, @@ -218,12 +215,11 @@ describe('v2alpha.PredictionServiceClient', () => { }); it('invokes predict with error', async () => { - const client = new predictionserviceModule.v2alpha.PredictionServiceClient( - { + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.retail.v2alpha.PredictRequest() @@ -256,12 +252,11 @@ describe('v2alpha.PredictionServiceClient', () => { location: 'locationValue', catalog: 'catalogValue', }; - const client = new predictionserviceModule.v2alpha.PredictionServiceClient( - { + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.catalogPathTemplate.render = sinon .stub() @@ -324,12 +319,11 @@ describe('v2alpha.PredictionServiceClient', () => { branch: 'branchValue', product: 'productValue', }; - const client = new predictionserviceModule.v2alpha.PredictionServiceClient( - { + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.productPathTemplate.render = sinon .stub() diff --git a/packages/google-cloud-retail/test/gapic_prediction_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_prediction_service_v2beta.ts index 681fb26fbf6..03ca999805f 100644 --- a/packages/google-cloud-retail/test/gapic_prediction_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_prediction_service_v2beta.ts @@ -26,10 +26,9 @@ import * as predictionserviceModule from '../src'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -190,9 +189,8 @@ describe('v2beta.PredictionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2beta.PredictResponse() ); - client.innerApiCalls.predict = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.predict = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.predict( request, diff --git a/packages/google-cloud-retail/test/gapic_product_service_v2.ts b/packages/google-cloud-retail/test/gapic_product_service_v2.ts index dba06a83fbe..223212fbe59 100644 --- a/packages/google-cloud-retail/test/gapic_product_service_v2.ts +++ b/packages/google-cloud-retail/test/gapic_product_service_v2.ts @@ -26,10 +26,9 @@ import * as productserviceModule from '../src'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -218,9 +217,8 @@ describe('v2.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2.Product() ); - client.innerApiCalls.createProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createProduct( request, @@ -330,9 +328,8 @@ describe('v2.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2.Product() ); - client.innerApiCalls.getProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getProduct( request, @@ -444,9 +441,8 @@ describe('v2.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2.Product() ); - client.innerApiCalls.updateProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateProduct( request, @@ -557,9 +553,8 @@ describe('v2.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteProduct( request, @@ -638,9 +633,8 @@ describe('v2.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importProducts = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.importProducts = + stubLongRunningCall(expectedResponse); const [operation] = await client.importProducts(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -672,9 +666,8 @@ describe('v2.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importProducts = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.importProducts = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.importProducts( request, diff --git a/packages/google-cloud-retail/test/gapic_product_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_product_service_v2alpha.ts index 3f708cc3314..98b5cbd6de0 100644 --- a/packages/google-cloud-retail/test/gapic_product_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_product_service_v2alpha.ts @@ -26,10 +26,9 @@ import * as productserviceModule from '../src'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -218,9 +217,8 @@ describe('v2alpha.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2alpha.Product() ); - client.innerApiCalls.createProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createProduct( request, @@ -330,9 +328,8 @@ describe('v2alpha.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2alpha.Product() ); - client.innerApiCalls.getProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getProduct( request, @@ -444,9 +441,8 @@ describe('v2alpha.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2alpha.Product() ); - client.innerApiCalls.updateProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateProduct( request, @@ -557,9 +553,8 @@ describe('v2alpha.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteProduct( request, @@ -638,9 +633,8 @@ describe('v2alpha.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importProducts = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.importProducts = + stubLongRunningCall(expectedResponse); const [operation] = await client.importProducts(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -672,9 +666,8 @@ describe('v2alpha.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importProducts = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.importProducts = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.importProducts( request, diff --git a/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts index 6844b31681b..0fb59443cd8 100644 --- a/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts @@ -26,10 +26,9 @@ import * as productserviceModule from '../src'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -218,9 +217,8 @@ describe('v2beta.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2beta.Product() ); - client.innerApiCalls.createProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createProduct( request, @@ -330,9 +328,8 @@ describe('v2beta.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2beta.Product() ); - client.innerApiCalls.getProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getProduct( request, @@ -444,9 +441,8 @@ describe('v2beta.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2beta.Product() ); - client.innerApiCalls.updateProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateProduct( request, @@ -557,9 +553,8 @@ describe('v2beta.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteProduct = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteProduct = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteProduct( request, @@ -638,9 +633,8 @@ describe('v2beta.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importProducts = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.importProducts = + stubLongRunningCall(expectedResponse); const [operation] = await client.importProducts(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -672,9 +666,8 @@ describe('v2beta.ProductServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importProducts = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.importProducts = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.importProducts( request, diff --git a/packages/google-cloud-retail/test/gapic_user_event_service_v2.ts b/packages/google-cloud-retail/test/gapic_user_event_service_v2.ts index 7fde3d9fa31..246309144e2 100644 --- a/packages/google-cloud-retail/test/gapic_user_event_service_v2.ts +++ b/packages/google-cloud-retail/test/gapic_user_event_service_v2.ts @@ -26,10 +26,9 @@ import * as usereventserviceModule from '../src'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -218,9 +217,8 @@ describe('v2.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2.UserEvent() ); - client.innerApiCalls.writeUserEvent = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.writeUserEvent = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.writeUserEvent( request, @@ -330,9 +328,8 @@ describe('v2.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); - client.innerApiCalls.collectUserEvent = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.collectUserEvent = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.collectUserEvent( request, @@ -408,9 +405,8 @@ describe('v2.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.purgeUserEvents = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.purgeUserEvents = + stubLongRunningCall(expectedResponse); const [operation] = await client.purgeUserEvents(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -442,9 +438,8 @@ describe('v2.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.purgeUserEvents = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.purgeUserEvents = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.purgeUserEvents( request, @@ -604,9 +599,8 @@ describe('v2.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importUserEvents = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.importUserEvents = + stubLongRunningCall(expectedResponse); const [operation] = await client.importUserEvents(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -638,9 +632,8 @@ describe('v2.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importUserEvents = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.importUserEvents = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.importUserEvents( request, @@ -800,9 +793,8 @@ describe('v2.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.rejoinUserEvents = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.rejoinUserEvents = + stubLongRunningCall(expectedResponse); const [operation] = await client.rejoinUserEvents(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -834,9 +826,8 @@ describe('v2.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.rejoinUserEvents = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.rejoinUserEvents = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.rejoinUserEvents( request, diff --git a/packages/google-cloud-retail/test/gapic_user_event_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_user_event_service_v2alpha.ts index 7aec2211deb..91225ec816b 100644 --- a/packages/google-cloud-retail/test/gapic_user_event_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_user_event_service_v2alpha.ts @@ -26,10 +26,9 @@ import * as usereventserviceModule from '../src'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -218,9 +217,8 @@ describe('v2alpha.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2alpha.UserEvent() ); - client.innerApiCalls.writeUserEvent = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.writeUserEvent = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.writeUserEvent( request, @@ -330,9 +328,8 @@ describe('v2alpha.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); - client.innerApiCalls.collectUserEvent = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.collectUserEvent = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.collectUserEvent( request, @@ -408,9 +405,8 @@ describe('v2alpha.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.purgeUserEvents = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.purgeUserEvents = + stubLongRunningCall(expectedResponse); const [operation] = await client.purgeUserEvents(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -442,9 +438,8 @@ describe('v2alpha.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.purgeUserEvents = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.purgeUserEvents = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.purgeUserEvents( request, @@ -604,9 +599,8 @@ describe('v2alpha.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importUserEvents = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.importUserEvents = + stubLongRunningCall(expectedResponse); const [operation] = await client.importUserEvents(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -638,9 +632,8 @@ describe('v2alpha.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importUserEvents = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.importUserEvents = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.importUserEvents( request, @@ -800,9 +793,8 @@ describe('v2alpha.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.rejoinUserEvents = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.rejoinUserEvents = + stubLongRunningCall(expectedResponse); const [operation] = await client.rejoinUserEvents(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -834,9 +826,8 @@ describe('v2alpha.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.rejoinUserEvents = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.rejoinUserEvents = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.rejoinUserEvents( request, diff --git a/packages/google-cloud-retail/test/gapic_user_event_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_user_event_service_v2beta.ts index 29329e9e4c4..fd1b4979a08 100644 --- a/packages/google-cloud-retail/test/gapic_user_event_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_user_event_service_v2beta.ts @@ -26,10 +26,9 @@ import * as usereventserviceModule from '../src'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -218,9 +217,8 @@ describe('v2beta.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.retail.v2beta.UserEvent() ); - client.innerApiCalls.writeUserEvent = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.writeUserEvent = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.writeUserEvent( request, @@ -330,9 +328,8 @@ describe('v2beta.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); - client.innerApiCalls.collectUserEvent = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.collectUserEvent = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.collectUserEvent( request, @@ -408,9 +405,8 @@ describe('v2beta.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.purgeUserEvents = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.purgeUserEvents = + stubLongRunningCall(expectedResponse); const [operation] = await client.purgeUserEvents(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -442,9 +438,8 @@ describe('v2beta.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.purgeUserEvents = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.purgeUserEvents = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.purgeUserEvents( request, @@ -604,9 +599,8 @@ describe('v2beta.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importUserEvents = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.importUserEvents = + stubLongRunningCall(expectedResponse); const [operation] = await client.importUserEvents(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -638,9 +632,8 @@ describe('v2beta.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.importUserEvents = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.importUserEvents = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.importUserEvents( request, @@ -800,9 +793,8 @@ describe('v2beta.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.rejoinUserEvents = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.rejoinUserEvents = + stubLongRunningCall(expectedResponse); const [operation] = await client.rejoinUserEvents(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -834,9 +826,8 @@ describe('v2beta.UserEventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.rejoinUserEvents = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.rejoinUserEvents = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.rejoinUserEvents( request,