@google-shopping/reviews 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,359 @@
1
+ import type * as gax from 'google-gax';
2
+ import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
3
+ import { Transform } from 'stream';
4
+ import * as protos from '../../protos/protos';
5
+ /**
6
+ * Service to manage product reviews.
7
+ * @class
8
+ * @memberof v1beta
9
+ */
10
+ export declare class ProductReviewsServiceClient {
11
+ private _terminated;
12
+ private _opts;
13
+ private _providedCustomServicePath;
14
+ private _gaxModule;
15
+ private _gaxGrpc;
16
+ private _protos;
17
+ private _defaults;
18
+ private _universeDomain;
19
+ private _servicePath;
20
+ auth: gax.GoogleAuth;
21
+ descriptors: Descriptors;
22
+ warn: (code: string, message: string, warnType?: string) => void;
23
+ innerApiCalls: {
24
+ [name: string]: Function;
25
+ };
26
+ pathTemplates: {
27
+ [name: string]: gax.PathTemplate;
28
+ };
29
+ productReviewsServiceStub?: Promise<{
30
+ [name: string]: Function;
31
+ }>;
32
+ /**
33
+ * Construct an instance of ProductReviewsServiceClient.
34
+ *
35
+ * @param {object} [options] - The configuration object.
36
+ * The options accepted by the constructor are described in detail
37
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
38
+ * The common options are:
39
+ * @param {object} [options.credentials] - Credentials object.
40
+ * @param {string} [options.credentials.client_email]
41
+ * @param {string} [options.credentials.private_key]
42
+ * @param {string} [options.email] - Account email address. Required when
43
+ * using a .pem or .p12 keyFilename.
44
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
45
+ * .p12 key downloaded from the Google Developers Console. If you provide
46
+ * a path to a JSON file, the projectId option below is not necessary.
47
+ * NOTE: .pem and .p12 require you to specify options.email as well.
48
+ * @param {number} [options.port] - The port on which to connect to
49
+ * the remote host.
50
+ * @param {string} [options.projectId] - The project ID from the Google
51
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
52
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
53
+ * app is running in an environment which supports
54
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
55
+ * your project ID will be detected automatically.
56
+ * @param {string} [options.apiEndpoint] - The domain name of the
57
+ * API remote host.
58
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
59
+ * Follows the structure of {@link gapicConfig}.
60
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
61
+ * For more information, please check the
62
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
63
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
64
+ * need to avoid loading the default gRPC version and want to use the fallback
65
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
66
+ * ```
67
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
68
+ * const client = new ProductReviewsServiceClient({fallback: true}, gax);
69
+ * ```
70
+ */
71
+ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
72
+ /**
73
+ * Initialize the client.
74
+ * Performs asynchronous operations (such as authentication) and prepares the client.
75
+ * This function will be called automatically when any class method is called for the
76
+ * first time, but if you need to initialize it before calling an actual method,
77
+ * feel free to call initialize() directly.
78
+ *
79
+ * You can await on this method if you want to make sure the client is initialized.
80
+ *
81
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
82
+ */
83
+ initialize(): Promise<{
84
+ [name: string]: Function;
85
+ }>;
86
+ /**
87
+ * The DNS address for this API service.
88
+ * @deprecated Use the apiEndpoint method of the client instance.
89
+ * @returns {string} The DNS address for this service.
90
+ */
91
+ static get servicePath(): string;
92
+ /**
93
+ * The DNS address for this API service - same as servicePath.
94
+ * @deprecated Use the apiEndpoint method of the client instance.
95
+ * @returns {string} The DNS address for this service.
96
+ */
97
+ static get apiEndpoint(): string;
98
+ /**
99
+ * The DNS address for this API service.
100
+ * @returns {string} The DNS address for this service.
101
+ */
102
+ get apiEndpoint(): string;
103
+ get universeDomain(): string;
104
+ /**
105
+ * The port for this API service.
106
+ * @returns {number} The default port for this service.
107
+ */
108
+ static get port(): number;
109
+ /**
110
+ * The scopes needed to make gRPC calls for every method defined
111
+ * in this service.
112
+ * @returns {string[]} List of default scopes.
113
+ */
114
+ static get scopes(): string[];
115
+ getProjectId(): Promise<string>;
116
+ getProjectId(callback: Callback<string, undefined, undefined>): void;
117
+ /**
118
+ * Gets a product review.
119
+ *
120
+ * @param {Object} request
121
+ * The request object that will be sent.
122
+ * @param {string} request.name
123
+ * Required. The ID of the merchant review.
124
+ * Format: accounts/{account}/productReviews/{productReview}
125
+ * @param {object} [options]
126
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
127
+ * @returns {Promise} - The promise which resolves to an array.
128
+ * The first element of the array is an object representing {@link protos.google.shopping.merchant.reviews.v1beta.ProductReview|ProductReview}.
129
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
130
+ * for more details and examples.
131
+ * @example <caption>include:samples/generated/v1beta/product_reviews_service.get_product_review.js</caption>
132
+ * region_tag:merchantapi_v1beta_generated_ProductReviewsService_GetProductReview_async
133
+ */
134
+ getProductReview(request?: protos.google.shopping.merchant.reviews.v1beta.IGetProductReviewRequest, options?: CallOptions): Promise<[
135
+ protos.google.shopping.merchant.reviews.v1beta.IProductReview,
136
+ (protos.google.shopping.merchant.reviews.v1beta.IGetProductReviewRequest | undefined),
137
+ {} | undefined
138
+ ]>;
139
+ getProductReview(request: protos.google.shopping.merchant.reviews.v1beta.IGetProductReviewRequest, options: CallOptions, callback: Callback<protos.google.shopping.merchant.reviews.v1beta.IProductReview, protos.google.shopping.merchant.reviews.v1beta.IGetProductReviewRequest | null | undefined, {} | null | undefined>): void;
140
+ getProductReview(request: protos.google.shopping.merchant.reviews.v1beta.IGetProductReviewRequest, callback: Callback<protos.google.shopping.merchant.reviews.v1beta.IProductReview, protos.google.shopping.merchant.reviews.v1beta.IGetProductReviewRequest | null | undefined, {} | null | undefined>): void;
141
+ /**
142
+ * Inserts a product review.
143
+ *
144
+ * @param {Object} request
145
+ * The request object that will be sent.
146
+ * @param {string} request.parent
147
+ * Required. The account where the product review will be inserted.
148
+ * Format: accounts/{account}
149
+ * @param {google.shopping.merchant.reviews.v1beta.ProductReview} request.productReview
150
+ * Required. The product review to insert.
151
+ * @param {string} request.dataSource
152
+ * Required. Format:
153
+ * `accounts/{account}/dataSources/{datasource}`.
154
+ * @param {object} [options]
155
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
156
+ * @returns {Promise} - The promise which resolves to an array.
157
+ * The first element of the array is an object representing {@link protos.google.shopping.merchant.reviews.v1beta.ProductReview|ProductReview}.
158
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
159
+ * for more details and examples.
160
+ * @example <caption>include:samples/generated/v1beta/product_reviews_service.insert_product_review.js</caption>
161
+ * region_tag:merchantapi_v1beta_generated_ProductReviewsService_InsertProductReview_async
162
+ */
163
+ insertProductReview(request?: protos.google.shopping.merchant.reviews.v1beta.IInsertProductReviewRequest, options?: CallOptions): Promise<[
164
+ protos.google.shopping.merchant.reviews.v1beta.IProductReview,
165
+ (protos.google.shopping.merchant.reviews.v1beta.IInsertProductReviewRequest | undefined),
166
+ {} | undefined
167
+ ]>;
168
+ insertProductReview(request: protos.google.shopping.merchant.reviews.v1beta.IInsertProductReviewRequest, options: CallOptions, callback: Callback<protos.google.shopping.merchant.reviews.v1beta.IProductReview, protos.google.shopping.merchant.reviews.v1beta.IInsertProductReviewRequest | null | undefined, {} | null | undefined>): void;
169
+ insertProductReview(request: protos.google.shopping.merchant.reviews.v1beta.IInsertProductReviewRequest, callback: Callback<protos.google.shopping.merchant.reviews.v1beta.IProductReview, protos.google.shopping.merchant.reviews.v1beta.IInsertProductReviewRequest | null | undefined, {} | null | undefined>): void;
170
+ /**
171
+ * Deletes a product review.
172
+ *
173
+ * @param {Object} request
174
+ * The request object that will be sent.
175
+ * @param {string} request.name
176
+ * Required. The ID of the Product review.
177
+ * Format: accounts/{account}/productReviews/{productReview}
178
+ * @param {object} [options]
179
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
180
+ * @returns {Promise} - The promise which resolves to an array.
181
+ * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
182
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
183
+ * for more details and examples.
184
+ * @example <caption>include:samples/generated/v1beta/product_reviews_service.delete_product_review.js</caption>
185
+ * region_tag:merchantapi_v1beta_generated_ProductReviewsService_DeleteProductReview_async
186
+ */
187
+ deleteProductReview(request?: protos.google.shopping.merchant.reviews.v1beta.IDeleteProductReviewRequest, options?: CallOptions): Promise<[
188
+ protos.google.protobuf.IEmpty,
189
+ (protos.google.shopping.merchant.reviews.v1beta.IDeleteProductReviewRequest | undefined),
190
+ {} | undefined
191
+ ]>;
192
+ deleteProductReview(request: protos.google.shopping.merchant.reviews.v1beta.IDeleteProductReviewRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.shopping.merchant.reviews.v1beta.IDeleteProductReviewRequest | null | undefined, {} | null | undefined>): void;
193
+ deleteProductReview(request: protos.google.shopping.merchant.reviews.v1beta.IDeleteProductReviewRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.shopping.merchant.reviews.v1beta.IDeleteProductReviewRequest | null | undefined, {} | null | undefined>): void;
194
+ /**
195
+ * Lists product reviews.
196
+ *
197
+ * @param {Object} request
198
+ * The request object that will be sent.
199
+ * @param {string} request.parent
200
+ * Required. The account to list product reviews for.
201
+ * Format: accounts/{account}
202
+ * @param {number} [request.pageSize]
203
+ * Optional. The maximum number of products to return. The service may return
204
+ * fewer than this value.
205
+ * @param {string} [request.pageToken]
206
+ * Optional. A page token, received from a previous `ListProductReviews` call.
207
+ * Provide this to retrieve the subsequent page.
208
+ *
209
+ * When paginating, all other parameters provided to `ListProductReviews`
210
+ * must match the call that provided the page token.
211
+ * @param {object} [options]
212
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
213
+ * @returns {Promise} - The promise which resolves to an array.
214
+ * The first element of the array is Array of {@link protos.google.shopping.merchant.reviews.v1beta.ProductReview|ProductReview}.
215
+ * The client library will perform auto-pagination by default: it will call the API as many
216
+ * times as needed and will merge results from all the pages into this array.
217
+ * Note that it can affect your quota.
218
+ * We recommend using `listProductReviewsAsync()`
219
+ * method described below for async iteration which you can stop as needed.
220
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
221
+ * for more details and examples.
222
+ */
223
+ listProductReviews(request?: protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsRequest, options?: CallOptions): Promise<[
224
+ protos.google.shopping.merchant.reviews.v1beta.IProductReview[],
225
+ protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsRequest | null,
226
+ protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsResponse
227
+ ]>;
228
+ listProductReviews(request: protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsRequest, options: CallOptions, callback: PaginationCallback<protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsRequest, protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsResponse | null | undefined, protos.google.shopping.merchant.reviews.v1beta.IProductReview>): void;
229
+ listProductReviews(request: protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsRequest, callback: PaginationCallback<protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsRequest, protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsResponse | null | undefined, protos.google.shopping.merchant.reviews.v1beta.IProductReview>): void;
230
+ /**
231
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
232
+ * @param {Object} request
233
+ * The request object that will be sent.
234
+ * @param {string} request.parent
235
+ * Required. The account to list product reviews for.
236
+ * Format: accounts/{account}
237
+ * @param {number} [request.pageSize]
238
+ * Optional. The maximum number of products to return. The service may return
239
+ * fewer than this value.
240
+ * @param {string} [request.pageToken]
241
+ * Optional. A page token, received from a previous `ListProductReviews` call.
242
+ * Provide this to retrieve the subsequent page.
243
+ *
244
+ * When paginating, all other parameters provided to `ListProductReviews`
245
+ * must match the call that provided the page token.
246
+ * @param {object} [options]
247
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
248
+ * @returns {Stream}
249
+ * An object stream which emits an object representing {@link protos.google.shopping.merchant.reviews.v1beta.ProductReview|ProductReview} on 'data' event.
250
+ * The client library will perform auto-pagination by default: it will call the API as many
251
+ * times as needed. Note that it can affect your quota.
252
+ * We recommend using `listProductReviewsAsync()`
253
+ * method described below for async iteration which you can stop as needed.
254
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
255
+ * for more details and examples.
256
+ */
257
+ listProductReviewsStream(request?: protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsRequest, options?: CallOptions): Transform;
258
+ /**
259
+ * Equivalent to `listProductReviews`, but returns an iterable object.
260
+ *
261
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
262
+ * @param {Object} request
263
+ * The request object that will be sent.
264
+ * @param {string} request.parent
265
+ * Required. The account to list product reviews for.
266
+ * Format: accounts/{account}
267
+ * @param {number} [request.pageSize]
268
+ * Optional. The maximum number of products to return. The service may return
269
+ * fewer than this value.
270
+ * @param {string} [request.pageToken]
271
+ * Optional. A page token, received from a previous `ListProductReviews` call.
272
+ * Provide this to retrieve the subsequent page.
273
+ *
274
+ * When paginating, all other parameters provided to `ListProductReviews`
275
+ * must match the call that provided the page token.
276
+ * @param {object} [options]
277
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
278
+ * @returns {Object}
279
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
280
+ * When you iterate the returned iterable, each element will be an object representing
281
+ * {@link protos.google.shopping.merchant.reviews.v1beta.ProductReview|ProductReview}. The API will be called under the hood as needed, once per the page,
282
+ * so you can stop the iteration when you don't need more results.
283
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
284
+ * for more details and examples.
285
+ * @example <caption>include:samples/generated/v1beta/product_reviews_service.list_product_reviews.js</caption>
286
+ * region_tag:merchantapi_v1beta_generated_ProductReviewsService_ListProductReviews_async
287
+ */
288
+ listProductReviewsAsync(request?: protos.google.shopping.merchant.reviews.v1beta.IListProductReviewsRequest, options?: CallOptions): AsyncIterable<protos.google.shopping.merchant.reviews.v1beta.IProductReview>;
289
+ /**
290
+ * Return a fully-qualified account resource name string.
291
+ *
292
+ * @param {string} account
293
+ * @returns {string} Resource name string.
294
+ */
295
+ accountPath(account: string): string;
296
+ /**
297
+ * Parse the account from Account resource.
298
+ *
299
+ * @param {string} accountName
300
+ * A fully-qualified path representing Account resource.
301
+ * @returns {string} A string representing the account.
302
+ */
303
+ matchAccountFromAccountName(accountName: string): string | number;
304
+ /**
305
+ * Return a fully-qualified merchantReview resource name string.
306
+ *
307
+ * @param {string} account
308
+ * @param {string} name
309
+ * @returns {string} Resource name string.
310
+ */
311
+ merchantReviewPath(account: string, name: string): string;
312
+ /**
313
+ * Parse the account from MerchantReview resource.
314
+ *
315
+ * @param {string} merchantReviewName
316
+ * A fully-qualified path representing MerchantReview resource.
317
+ * @returns {string} A string representing the account.
318
+ */
319
+ matchAccountFromMerchantReviewName(merchantReviewName: string): string | number;
320
+ /**
321
+ * Parse the name from MerchantReview resource.
322
+ *
323
+ * @param {string} merchantReviewName
324
+ * A fully-qualified path representing MerchantReview resource.
325
+ * @returns {string} A string representing the name.
326
+ */
327
+ matchNameFromMerchantReviewName(merchantReviewName: string): string | number;
328
+ /**
329
+ * Return a fully-qualified productReview resource name string.
330
+ *
331
+ * @param {string} account
332
+ * @param {string} productreview
333
+ * @returns {string} Resource name string.
334
+ */
335
+ productReviewPath(account: string, productreview: string): string;
336
+ /**
337
+ * Parse the account from ProductReview resource.
338
+ *
339
+ * @param {string} productReviewName
340
+ * A fully-qualified path representing ProductReview resource.
341
+ * @returns {string} A string representing the account.
342
+ */
343
+ matchAccountFromProductReviewName(productReviewName: string): string | number;
344
+ /**
345
+ * Parse the productreview from ProductReview resource.
346
+ *
347
+ * @param {string} productReviewName
348
+ * A fully-qualified path representing ProductReview resource.
349
+ * @returns {string} A string representing the productreview.
350
+ */
351
+ matchProductreviewFromProductReviewName(productReviewName: string): string | number;
352
+ /**
353
+ * Terminate the gRPC channel and close the client.
354
+ *
355
+ * The client will no longer be usable and all future behavior is undefined.
356
+ * @returns {Promise} A promise that resolves when the client is closed.
357
+ */
358
+ close(): Promise<void>;
359
+ }