@googleapis/merchantapi 1.0.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +28 -0
  3. package/accounts_v1beta.ts +5692 -0
  4. package/build/accounts_v1beta.d.ts +2492 -0
  5. package/build/accounts_v1beta.js +1421 -0
  6. package/build/accounts_v1beta.js.map +1 -0
  7. package/build/conversions_v1beta.d.ts +406 -0
  8. package/build/conversions_v1beta.js +251 -0
  9. package/build/conversions_v1beta.js.map +1 -0
  10. package/build/datasources_v1beta.d.ts +502 -0
  11. package/build/datasources_v1beta.js +251 -0
  12. package/build/datasources_v1beta.js.map +1 -0
  13. package/build/index.d.ts +57 -0
  14. package/build/index.js +58 -0
  15. package/build/index.js.map +1 -0
  16. package/build/inventories_v1beta.d.ts +456 -0
  17. package/build/inventories_v1beta.js +272 -0
  18. package/build/inventories_v1beta.js.map +1 -0
  19. package/build/lfp_v1beta.d.ts +486 -0
  20. package/build/lfp_v1beta.js +265 -0
  21. package/build/lfp_v1beta.js.map +1 -0
  22. package/build/notifications_v1beta.d.ts +301 -0
  23. package/build/notifications_v1beta.js +224 -0
  24. package/build/notifications_v1beta.js.map +1 -0
  25. package/build/products_v1beta.d.ts +1204 -0
  26. package/build/products_v1beta.js +194 -0
  27. package/build/products_v1beta.js.map +1 -0
  28. package/build/promotions_v1beta.d.ts +524 -0
  29. package/build/promotions_v1beta.js +155 -0
  30. package/build/promotions_v1beta.js.map +1 -0
  31. package/build/quota_v1beta.d.ts +225 -0
  32. package/build/quota_v1beta.js +91 -0
  33. package/build/quota_v1beta.js.map +1 -0
  34. package/build/reports_v1beta.d.ts +1001 -0
  35. package/build/reports_v1beta.js +91 -0
  36. package/build/reports_v1beta.js.map +1 -0
  37. package/conversions_v1beta.ts +926 -0
  38. package/datasources_v1beta.ts +1016 -0
  39. package/index.ts +161 -0
  40. package/inventories_v1beta.ts +1002 -0
  41. package/lfp_v1beta.ts +1012 -0
  42. package/notifications_v1beta.ts +768 -0
  43. package/package.json +43 -0
  44. package/products_v1beta.ts +1573 -0
  45. package/promotions_v1beta.ts +814 -0
  46. package/quota_v1beta.ts +365 -0
  47. package/reports_v1beta.ts +1137 -0
  48. package/tsconfig.json +10 -0
  49. package/webpack.config.js +79 -0
@@ -0,0 +1,1002 @@
1
+ // Copyright 2020 Google LLC
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ /* eslint-disable @typescript-eslint/no-explicit-any */
15
+ /* eslint-disable @typescript-eslint/no-unused-vars */
16
+ /* eslint-disable @typescript-eslint/no-empty-interface */
17
+ /* eslint-disable @typescript-eslint/no-namespace */
18
+ /* eslint-disable no-irregular-whitespace */
19
+
20
+ import {
21
+ OAuth2Client,
22
+ JWT,
23
+ Compute,
24
+ UserRefreshClient,
25
+ BaseExternalAccountClient,
26
+ GaxiosPromise,
27
+ GoogleConfigurable,
28
+ createAPIRequest,
29
+ MethodOptions,
30
+ StreamMethodOptions,
31
+ GlobalOptions,
32
+ GoogleAuth,
33
+ BodyResponseCallback,
34
+ APIRequestContext,
35
+ } from 'googleapis-common';
36
+ import {Readable} from 'stream';
37
+
38
+ export namespace merchantapi_inventories_v1beta {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'inventories_v1beta';
41
+ }
42
+
43
+ interface StandardParameters {
44
+ /**
45
+ * Auth client or API Key for the request
46
+ */
47
+ auth?:
48
+ | string
49
+ | OAuth2Client
50
+ | JWT
51
+ | Compute
52
+ | UserRefreshClient
53
+ | BaseExternalAccountClient
54
+ | GoogleAuth;
55
+
56
+ /**
57
+ * V1 error format.
58
+ */
59
+ '$.xgafv'?: string;
60
+ /**
61
+ * OAuth access token.
62
+ */
63
+ access_token?: string;
64
+ /**
65
+ * Data format for response.
66
+ */
67
+ alt?: string;
68
+ /**
69
+ * JSONP
70
+ */
71
+ callback?: string;
72
+ /**
73
+ * Selector specifying which fields to include in a partial response.
74
+ */
75
+ fields?: string;
76
+ /**
77
+ * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
78
+ */
79
+ key?: string;
80
+ /**
81
+ * OAuth 2.0 token for the current user.
82
+ */
83
+ oauth_token?: string;
84
+ /**
85
+ * Returns response with indentations and line breaks.
86
+ */
87
+ prettyPrint?: boolean;
88
+ /**
89
+ * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
90
+ */
91
+ quotaUser?: string;
92
+ /**
93
+ * Legacy upload protocol for media (e.g. "media", "multipart").
94
+ */
95
+ uploadType?: string;
96
+ /**
97
+ * Upload protocol for media (e.g. "raw", "multipart").
98
+ */
99
+ upload_protocol?: string;
100
+ }
101
+
102
+ /**
103
+ * Merchant API
104
+ *
105
+ * Programmatically manage your Merchant Center Accounts.
106
+ *
107
+ * @example
108
+ * ```js
109
+ * const {google} = require('googleapis');
110
+ * const merchantapi = google.merchantapi('inventories_v1beta');
111
+ * ```
112
+ */
113
+ export class Merchantapi {
114
+ context: APIRequestContext;
115
+ accounts: Resource$Accounts;
116
+
117
+ constructor(options: GlobalOptions, google?: GoogleConfigurable) {
118
+ this.context = {
119
+ _options: options || {},
120
+ google,
121
+ };
122
+
123
+ this.accounts = new Resource$Accounts(this.context);
124
+ }
125
+ }
126
+
127
+ /**
128
+ * A message that represents custom attributes. Exactly one of `value` or `group_values` must not be empty.
129
+ */
130
+ export interface Schema$CustomAttribute {
131
+ /**
132
+ * Subattributes within this attribute group. If `group_values` is not empty, `value` must be empty.
133
+ */
134
+ groupValues?: Schema$CustomAttribute[];
135
+ /**
136
+ * The name of the attribute.
137
+ */
138
+ name?: string | null;
139
+ /**
140
+ * The value of the attribute. If `value` is not empty, `group_values` must be empty.
141
+ */
142
+ value?: string | null;
143
+ }
144
+ /**
145
+ * A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \}
146
+ */
147
+ export interface Schema$Empty {}
148
+ /**
149
+ * Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.
150
+ */
151
+ export interface Schema$Interval {
152
+ /**
153
+ * Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.
154
+ */
155
+ endTime?: string | null;
156
+ /**
157
+ * Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.
158
+ */
159
+ startTime?: string | null;
160
+ }
161
+ /**
162
+ * Response message for the `ListLocalInventories` method.
163
+ */
164
+ export interface Schema$ListLocalInventoriesResponse {
165
+ /**
166
+ * The `LocalInventory` resources for the given product from the specified account.
167
+ */
168
+ localInventories?: Schema$LocalInventory[];
169
+ /**
170
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.
171
+ */
172
+ nextPageToken?: string | null;
173
+ }
174
+ /**
175
+ * Response message for the `ListRegionalInventories` method.
176
+ */
177
+ export interface Schema$ListRegionalInventoriesResponse {
178
+ /**
179
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.
180
+ */
181
+ nextPageToken?: string | null;
182
+ /**
183
+ * The `RegionalInventory` resources for the given product from the specified account.
184
+ */
185
+ regionalInventories?: Schema$RegionalInventory[];
186
+ }
187
+ /**
188
+ * Local inventory information for the product. Represents in-store information for a specific product at the store specified by `storeCode`. For a list of all accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342).
189
+ */
190
+ export interface Schema$LocalInventory {
191
+ /**
192
+ * Output only. The account that owns the product. This field will be ignored if set by the client.
193
+ */
194
+ account?: string | null;
195
+ /**
196
+ * Availability of the product at this store. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342)
197
+ */
198
+ availability?: string | null;
199
+ /**
200
+ * A list of custom (merchant-provided) attributes. You can also use `CustomAttribute` to submit any attribute of the data specification in its generic form.
201
+ */
202
+ customAttributes?: Schema$CustomAttribute[];
203
+ /**
204
+ * Location of the product inside the store. Maximum length is 20 bytes.
205
+ */
206
+ instoreProductLocation?: string | null;
207
+ /**
208
+ * Output only. The name of the `LocalInventory` resource. Format: `accounts/{account\}/products/{product\}/localInventories/{store_code\}`
209
+ */
210
+ name?: string | null;
211
+ /**
212
+ * Supported pickup method for this product. Unless the value is `"not supported"`, this field must be submitted together with `pickupSla`. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342)
213
+ */
214
+ pickupMethod?: string | null;
215
+ /**
216
+ * Relative time period from the order date for an order for this product, from this store, to be ready for pickup. Must be submitted with `pickupMethod`. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342)
217
+ */
218
+ pickupSla?: string | null;
219
+ /**
220
+ * Price of the product at this store.
221
+ */
222
+ price?: Schema$Price;
223
+ /**
224
+ * Quantity of the product available at this store. Must be greater than or equal to zero.
225
+ */
226
+ quantity?: string | null;
227
+ /**
228
+ * Sale price of the product at this store. Mandatory if `salePriceEffectiveDate` is defined.
229
+ */
230
+ salePrice?: Schema$Price;
231
+ /**
232
+ * The `TimePeriod` of the sale at this store.
233
+ */
234
+ salePriceEffectiveDate?: Schema$Interval;
235
+ /**
236
+ * Required. Immutable. Store code (the store ID from your Business Profile) of the physical store the product is sold in. See the [Local product inventory data specification](https://support.google.com/merchants/answer/3061342) for more information.
237
+ */
238
+ storeCode?: string | null;
239
+ }
240
+ /**
241
+ * The price represented as a number and currency.
242
+ */
243
+ export interface Schema$Price {
244
+ /**
245
+ * The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros).
246
+ */
247
+ amountMicros?: string | null;
248
+ /**
249
+ * The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217).
250
+ */
251
+ currencyCode?: string | null;
252
+ }
253
+ /**
254
+ * The change that happened to the product including old value, new value, country code as the region code and reporting context.
255
+ */
256
+ export interface Schema$ProductChange {
257
+ /**
258
+ * The new value of the changed resource or attribute.
259
+ */
260
+ newValue?: string | null;
261
+ /**
262
+ * The old value of the changed resource or attribute.
263
+ */
264
+ oldValue?: string | null;
265
+ /**
266
+ * Countries that have the change (if applicable)
267
+ */
268
+ regionCode?: string | null;
269
+ /**
270
+ * Reporting contexts that have the change (if applicable)
271
+ */
272
+ reportingContext?: string | null;
273
+ }
274
+ /**
275
+ * The message that the merchant will receive to notify about product status change event
276
+ */
277
+ export interface Schema$ProductStatusChangeMessage {
278
+ /**
279
+ * The target account that owns the entity that changed. Format : `accounts/{merchant_id\}`
280
+ */
281
+ account?: string | null;
282
+ /**
283
+ * The attribute in the resource that changed, in this case it will be always `Status`.
284
+ */
285
+ attribute?: string | null;
286
+ /**
287
+ * A message to describe the change that happened to the product
288
+ */
289
+ changes?: Schema$ProductChange[];
290
+ /**
291
+ * The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id\}`
292
+ */
293
+ managingAccount?: string | null;
294
+ /**
295
+ * The product name. Format: `{product.name=accounts/{account\}/products/{product\}\}`
296
+ */
297
+ resource?: string | null;
298
+ /**
299
+ * The product id.
300
+ */
301
+ resourceId?: string | null;
302
+ /**
303
+ * The resource that changed, in this case it will always be `Product`.
304
+ */
305
+ resourceType?: string | null;
306
+ }
307
+ /**
308
+ * Regional inventory information for the product. Represents specific information like price and availability for a given product in a specific `region`. For a list of all accepted attribute values, see the [regional product inventory data specification](https://support.google.com/merchants/answer/9698880).
309
+ */
310
+ export interface Schema$RegionalInventory {
311
+ /**
312
+ * Output only. The account that owns the product. This field will be ignored if set by the client.
313
+ */
314
+ account?: string | null;
315
+ /**
316
+ * Availability of the product in this region. For accepted attribute values, see the [regional product inventory data specification](https://support.google.com/merchants/answer/3061342)
317
+ */
318
+ availability?: string | null;
319
+ /**
320
+ * A list of custom (merchant-provided) attributes. You can also use `CustomAttribute` to submit any attribute of the data specification in its generic form.
321
+ */
322
+ customAttributes?: Schema$CustomAttribute[];
323
+ /**
324
+ * Output only. The name of the `RegionalInventory` resource. Format: `{regional_inventory.name=accounts/{account\}/products/{product\}/regionalInventories/{region\}`
325
+ */
326
+ name?: string | null;
327
+ /**
328
+ * Price of the product in this region.
329
+ */
330
+ price?: Schema$Price;
331
+ /**
332
+ * Required. Immutable. ID of the region for this `RegionalInventory` resource. See the [Regional availability and pricing](https://support.google.com/merchants/answer/9698880) for more details.
333
+ */
334
+ region?: string | null;
335
+ /**
336
+ * Sale price of the product in this region. Mandatory if `salePriceEffectiveDate` is defined.
337
+ */
338
+ salePrice?: Schema$Price;
339
+ /**
340
+ * The `TimePeriod` of the sale price in this region.
341
+ */
342
+ salePriceEffectiveDate?: Schema$Interval;
343
+ }
344
+
345
+ export class Resource$Accounts {
346
+ context: APIRequestContext;
347
+ products: Resource$Accounts$Products;
348
+ constructor(context: APIRequestContext) {
349
+ this.context = context;
350
+ this.products = new Resource$Accounts$Products(this.context);
351
+ }
352
+ }
353
+
354
+ export class Resource$Accounts$Products {
355
+ context: APIRequestContext;
356
+ localInventories: Resource$Accounts$Products$Localinventories;
357
+ regionalInventories: Resource$Accounts$Products$Regionalinventories;
358
+ constructor(context: APIRequestContext) {
359
+ this.context = context;
360
+ this.localInventories = new Resource$Accounts$Products$Localinventories(
361
+ this.context
362
+ );
363
+ this.regionalInventories =
364
+ new Resource$Accounts$Products$Regionalinventories(this.context);
365
+ }
366
+ }
367
+
368
+ export class Resource$Accounts$Products$Localinventories {
369
+ context: APIRequestContext;
370
+ constructor(context: APIRequestContext) {
371
+ this.context = context;
372
+ }
373
+
374
+ /**
375
+ * Deletes the specified `LocalInventory` from the given product in your merchant account. It might take a up to an hour for the `LocalInventory` to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again.
376
+ *
377
+ * @param params - Parameters for request
378
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
379
+ * @param callback - Optional callback that handles the response.
380
+ * @returns A promise if used with async/await, or void if used with a callback.
381
+ */
382
+ delete(
383
+ params: Params$Resource$Accounts$Products$Localinventories$Delete,
384
+ options: StreamMethodOptions
385
+ ): GaxiosPromise<Readable>;
386
+ delete(
387
+ params?: Params$Resource$Accounts$Products$Localinventories$Delete,
388
+ options?: MethodOptions
389
+ ): GaxiosPromise<Schema$Empty>;
390
+ delete(
391
+ params: Params$Resource$Accounts$Products$Localinventories$Delete,
392
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
393
+ callback: BodyResponseCallback<Readable>
394
+ ): void;
395
+ delete(
396
+ params: Params$Resource$Accounts$Products$Localinventories$Delete,
397
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
398
+ callback: BodyResponseCallback<Schema$Empty>
399
+ ): void;
400
+ delete(
401
+ params: Params$Resource$Accounts$Products$Localinventories$Delete,
402
+ callback: BodyResponseCallback<Schema$Empty>
403
+ ): void;
404
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
405
+ delete(
406
+ paramsOrCallback?:
407
+ | Params$Resource$Accounts$Products$Localinventories$Delete
408
+ | BodyResponseCallback<Schema$Empty>
409
+ | BodyResponseCallback<Readable>,
410
+ optionsOrCallback?:
411
+ | MethodOptions
412
+ | StreamMethodOptions
413
+ | BodyResponseCallback<Schema$Empty>
414
+ | BodyResponseCallback<Readable>,
415
+ callback?:
416
+ | BodyResponseCallback<Schema$Empty>
417
+ | BodyResponseCallback<Readable>
418
+ ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
419
+ let params = (paramsOrCallback ||
420
+ {}) as Params$Resource$Accounts$Products$Localinventories$Delete;
421
+ let options = (optionsOrCallback || {}) as MethodOptions;
422
+
423
+ if (typeof paramsOrCallback === 'function') {
424
+ callback = paramsOrCallback;
425
+ params =
426
+ {} as Params$Resource$Accounts$Products$Localinventories$Delete;
427
+ options = {};
428
+ }
429
+
430
+ if (typeof optionsOrCallback === 'function') {
431
+ callback = optionsOrCallback;
432
+ options = {};
433
+ }
434
+
435
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
436
+ const parameters = {
437
+ options: Object.assign(
438
+ {
439
+ url: (rootUrl + '/inventories/v1beta/{+name}').replace(
440
+ /([^:]\/)\/+/g,
441
+ '$1'
442
+ ),
443
+ method: 'DELETE',
444
+ apiVersion: '',
445
+ },
446
+ options
447
+ ),
448
+ params,
449
+ requiredParams: ['name'],
450
+ pathParams: ['name'],
451
+ context: this.context,
452
+ };
453
+ if (callback) {
454
+ createAPIRequest<Schema$Empty>(
455
+ parameters,
456
+ callback as BodyResponseCallback<unknown>
457
+ );
458
+ } else {
459
+ return createAPIRequest<Schema$Empty>(parameters);
460
+ }
461
+ }
462
+
463
+ /**
464
+ * Inserts a `LocalInventory` resource to a product in your merchant account. Replaces the full `LocalInventory` resource if an entry with the same `storeCode` already exists for the product. It might take up to 30 minutes for the new or updated `LocalInventory` resource to appear in products.
465
+ *
466
+ * @param params - Parameters for request
467
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
468
+ * @param callback - Optional callback that handles the response.
469
+ * @returns A promise if used with async/await, or void if used with a callback.
470
+ */
471
+ insert(
472
+ params: Params$Resource$Accounts$Products$Localinventories$Insert,
473
+ options: StreamMethodOptions
474
+ ): GaxiosPromise<Readable>;
475
+ insert(
476
+ params?: Params$Resource$Accounts$Products$Localinventories$Insert,
477
+ options?: MethodOptions
478
+ ): GaxiosPromise<Schema$LocalInventory>;
479
+ insert(
480
+ params: Params$Resource$Accounts$Products$Localinventories$Insert,
481
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
482
+ callback: BodyResponseCallback<Readable>
483
+ ): void;
484
+ insert(
485
+ params: Params$Resource$Accounts$Products$Localinventories$Insert,
486
+ options: MethodOptions | BodyResponseCallback<Schema$LocalInventory>,
487
+ callback: BodyResponseCallback<Schema$LocalInventory>
488
+ ): void;
489
+ insert(
490
+ params: Params$Resource$Accounts$Products$Localinventories$Insert,
491
+ callback: BodyResponseCallback<Schema$LocalInventory>
492
+ ): void;
493
+ insert(callback: BodyResponseCallback<Schema$LocalInventory>): void;
494
+ insert(
495
+ paramsOrCallback?:
496
+ | Params$Resource$Accounts$Products$Localinventories$Insert
497
+ | BodyResponseCallback<Schema$LocalInventory>
498
+ | BodyResponseCallback<Readable>,
499
+ optionsOrCallback?:
500
+ | MethodOptions
501
+ | StreamMethodOptions
502
+ | BodyResponseCallback<Schema$LocalInventory>
503
+ | BodyResponseCallback<Readable>,
504
+ callback?:
505
+ | BodyResponseCallback<Schema$LocalInventory>
506
+ | BodyResponseCallback<Readable>
507
+ ): void | GaxiosPromise<Schema$LocalInventory> | GaxiosPromise<Readable> {
508
+ let params = (paramsOrCallback ||
509
+ {}) as Params$Resource$Accounts$Products$Localinventories$Insert;
510
+ let options = (optionsOrCallback || {}) as MethodOptions;
511
+
512
+ if (typeof paramsOrCallback === 'function') {
513
+ callback = paramsOrCallback;
514
+ params =
515
+ {} as Params$Resource$Accounts$Products$Localinventories$Insert;
516
+ options = {};
517
+ }
518
+
519
+ if (typeof optionsOrCallback === 'function') {
520
+ callback = optionsOrCallback;
521
+ options = {};
522
+ }
523
+
524
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
525
+ const parameters = {
526
+ options: Object.assign(
527
+ {
528
+ url: (
529
+ rootUrl + '/inventories/v1beta/{+parent}/localInventories:insert'
530
+ ).replace(/([^:]\/)\/+/g, '$1'),
531
+ method: 'POST',
532
+ apiVersion: '',
533
+ },
534
+ options
535
+ ),
536
+ params,
537
+ requiredParams: ['parent'],
538
+ pathParams: ['parent'],
539
+ context: this.context,
540
+ };
541
+ if (callback) {
542
+ createAPIRequest<Schema$LocalInventory>(
543
+ parameters,
544
+ callback as BodyResponseCallback<unknown>
545
+ );
546
+ } else {
547
+ return createAPIRequest<Schema$LocalInventory>(parameters);
548
+ }
549
+ }
550
+
551
+ /**
552
+ * Lists the `LocalInventory` resources for the given product in your merchant account. The response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in previous request, it can be used to obtain additional results. `LocalInventory` resources are listed per product for a given account.
553
+ *
554
+ * @param params - Parameters for request
555
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
556
+ * @param callback - Optional callback that handles the response.
557
+ * @returns A promise if used with async/await, or void if used with a callback.
558
+ */
559
+ list(
560
+ params: Params$Resource$Accounts$Products$Localinventories$List,
561
+ options: StreamMethodOptions
562
+ ): GaxiosPromise<Readable>;
563
+ list(
564
+ params?: Params$Resource$Accounts$Products$Localinventories$List,
565
+ options?: MethodOptions
566
+ ): GaxiosPromise<Schema$ListLocalInventoriesResponse>;
567
+ list(
568
+ params: Params$Resource$Accounts$Products$Localinventories$List,
569
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
570
+ callback: BodyResponseCallback<Readable>
571
+ ): void;
572
+ list(
573
+ params: Params$Resource$Accounts$Products$Localinventories$List,
574
+ options:
575
+ | MethodOptions
576
+ | BodyResponseCallback<Schema$ListLocalInventoriesResponse>,
577
+ callback: BodyResponseCallback<Schema$ListLocalInventoriesResponse>
578
+ ): void;
579
+ list(
580
+ params: Params$Resource$Accounts$Products$Localinventories$List,
581
+ callback: BodyResponseCallback<Schema$ListLocalInventoriesResponse>
582
+ ): void;
583
+ list(
584
+ callback: BodyResponseCallback<Schema$ListLocalInventoriesResponse>
585
+ ): void;
586
+ list(
587
+ paramsOrCallback?:
588
+ | Params$Resource$Accounts$Products$Localinventories$List
589
+ | BodyResponseCallback<Schema$ListLocalInventoriesResponse>
590
+ | BodyResponseCallback<Readable>,
591
+ optionsOrCallback?:
592
+ | MethodOptions
593
+ | StreamMethodOptions
594
+ | BodyResponseCallback<Schema$ListLocalInventoriesResponse>
595
+ | BodyResponseCallback<Readable>,
596
+ callback?:
597
+ | BodyResponseCallback<Schema$ListLocalInventoriesResponse>
598
+ | BodyResponseCallback<Readable>
599
+ ):
600
+ | void
601
+ | GaxiosPromise<Schema$ListLocalInventoriesResponse>
602
+ | GaxiosPromise<Readable> {
603
+ let params = (paramsOrCallback ||
604
+ {}) as Params$Resource$Accounts$Products$Localinventories$List;
605
+ let options = (optionsOrCallback || {}) as MethodOptions;
606
+
607
+ if (typeof paramsOrCallback === 'function') {
608
+ callback = paramsOrCallback;
609
+ params = {} as Params$Resource$Accounts$Products$Localinventories$List;
610
+ options = {};
611
+ }
612
+
613
+ if (typeof optionsOrCallback === 'function') {
614
+ callback = optionsOrCallback;
615
+ options = {};
616
+ }
617
+
618
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
619
+ const parameters = {
620
+ options: Object.assign(
621
+ {
622
+ url: (
623
+ rootUrl + '/inventories/v1beta/{+parent}/localInventories'
624
+ ).replace(/([^:]\/)\/+/g, '$1'),
625
+ method: 'GET',
626
+ apiVersion: '',
627
+ },
628
+ options
629
+ ),
630
+ params,
631
+ requiredParams: ['parent'],
632
+ pathParams: ['parent'],
633
+ context: this.context,
634
+ };
635
+ if (callback) {
636
+ createAPIRequest<Schema$ListLocalInventoriesResponse>(
637
+ parameters,
638
+ callback as BodyResponseCallback<unknown>
639
+ );
640
+ } else {
641
+ return createAPIRequest<Schema$ListLocalInventoriesResponse>(
642
+ parameters
643
+ );
644
+ }
645
+ }
646
+ }
647
+
648
+ export interface Params$Resource$Accounts$Products$Localinventories$Delete
649
+ extends StandardParameters {
650
+ /**
651
+ * Required. The name of the local inventory for the given product to delete. Format: `accounts/{account\}/products/{product\}/localInventories/{store_code\}`
652
+ */
653
+ name?: string;
654
+ }
655
+ export interface Params$Resource$Accounts$Products$Localinventories$Insert
656
+ extends StandardParameters {
657
+ /**
658
+ * Required. The account and product where this inventory will be inserted. Format: `accounts/{account\}/products/{product\}`
659
+ */
660
+ parent?: string;
661
+
662
+ /**
663
+ * Request body metadata
664
+ */
665
+ requestBody?: Schema$LocalInventory;
666
+ }
667
+ export interface Params$Resource$Accounts$Products$Localinventories$List
668
+ extends StandardParameters {
669
+ /**
670
+ * The maximum number of `LocalInventory` resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the `pageSize`. The default value is 25000. The maximum value is 25000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum
671
+ */
672
+ pageSize?: number;
673
+ /**
674
+ * A page token, received from a previous `ListLocalInventories` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListLocalInventories` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.
675
+ */
676
+ pageToken?: string;
677
+ /**
678
+ * Required. The `name` of the parent product to list local inventories for. Format: `accounts/{account\}/products/{product\}`
679
+ */
680
+ parent?: string;
681
+ }
682
+
683
+ export class Resource$Accounts$Products$Regionalinventories {
684
+ context: APIRequestContext;
685
+ constructor(context: APIRequestContext) {
686
+ this.context = context;
687
+ }
688
+
689
+ /**
690
+ * Deletes the specified `RegionalInventory` resource from the given product in your merchant account. It might take up to an hour for the `RegionalInventory` to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again.
691
+ *
692
+ * @param params - Parameters for request
693
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
694
+ * @param callback - Optional callback that handles the response.
695
+ * @returns A promise if used with async/await, or void if used with a callback.
696
+ */
697
+ delete(
698
+ params: Params$Resource$Accounts$Products$Regionalinventories$Delete,
699
+ options: StreamMethodOptions
700
+ ): GaxiosPromise<Readable>;
701
+ delete(
702
+ params?: Params$Resource$Accounts$Products$Regionalinventories$Delete,
703
+ options?: MethodOptions
704
+ ): GaxiosPromise<Schema$Empty>;
705
+ delete(
706
+ params: Params$Resource$Accounts$Products$Regionalinventories$Delete,
707
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
708
+ callback: BodyResponseCallback<Readable>
709
+ ): void;
710
+ delete(
711
+ params: Params$Resource$Accounts$Products$Regionalinventories$Delete,
712
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
713
+ callback: BodyResponseCallback<Schema$Empty>
714
+ ): void;
715
+ delete(
716
+ params: Params$Resource$Accounts$Products$Regionalinventories$Delete,
717
+ callback: BodyResponseCallback<Schema$Empty>
718
+ ): void;
719
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
720
+ delete(
721
+ paramsOrCallback?:
722
+ | Params$Resource$Accounts$Products$Regionalinventories$Delete
723
+ | BodyResponseCallback<Schema$Empty>
724
+ | BodyResponseCallback<Readable>,
725
+ optionsOrCallback?:
726
+ | MethodOptions
727
+ | StreamMethodOptions
728
+ | BodyResponseCallback<Schema$Empty>
729
+ | BodyResponseCallback<Readable>,
730
+ callback?:
731
+ | BodyResponseCallback<Schema$Empty>
732
+ | BodyResponseCallback<Readable>
733
+ ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
734
+ let params = (paramsOrCallback ||
735
+ {}) as Params$Resource$Accounts$Products$Regionalinventories$Delete;
736
+ let options = (optionsOrCallback || {}) as MethodOptions;
737
+
738
+ if (typeof paramsOrCallback === 'function') {
739
+ callback = paramsOrCallback;
740
+ params =
741
+ {} as Params$Resource$Accounts$Products$Regionalinventories$Delete;
742
+ options = {};
743
+ }
744
+
745
+ if (typeof optionsOrCallback === 'function') {
746
+ callback = optionsOrCallback;
747
+ options = {};
748
+ }
749
+
750
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
751
+ const parameters = {
752
+ options: Object.assign(
753
+ {
754
+ url: (rootUrl + '/inventories/v1beta/{+name}').replace(
755
+ /([^:]\/)\/+/g,
756
+ '$1'
757
+ ),
758
+ method: 'DELETE',
759
+ apiVersion: '',
760
+ },
761
+ options
762
+ ),
763
+ params,
764
+ requiredParams: ['name'],
765
+ pathParams: ['name'],
766
+ context: this.context,
767
+ };
768
+ if (callback) {
769
+ createAPIRequest<Schema$Empty>(
770
+ parameters,
771
+ callback as BodyResponseCallback<unknown>
772
+ );
773
+ } else {
774
+ return createAPIRequest<Schema$Empty>(parameters);
775
+ }
776
+ }
777
+
778
+ /**
779
+ * Inserts a `RegionalInventory` to a given product in your merchant account. Replaces the full `RegionalInventory` resource if an entry with the same `region` already exists for the product. It might take up to 30 minutes for the new or updated `RegionalInventory` resource to appear in products.
780
+ *
781
+ * @param params - Parameters for request
782
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
783
+ * @param callback - Optional callback that handles the response.
784
+ * @returns A promise if used with async/await, or void if used with a callback.
785
+ */
786
+ insert(
787
+ params: Params$Resource$Accounts$Products$Regionalinventories$Insert,
788
+ options: StreamMethodOptions
789
+ ): GaxiosPromise<Readable>;
790
+ insert(
791
+ params?: Params$Resource$Accounts$Products$Regionalinventories$Insert,
792
+ options?: MethodOptions
793
+ ): GaxiosPromise<Schema$RegionalInventory>;
794
+ insert(
795
+ params: Params$Resource$Accounts$Products$Regionalinventories$Insert,
796
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
797
+ callback: BodyResponseCallback<Readable>
798
+ ): void;
799
+ insert(
800
+ params: Params$Resource$Accounts$Products$Regionalinventories$Insert,
801
+ options: MethodOptions | BodyResponseCallback<Schema$RegionalInventory>,
802
+ callback: BodyResponseCallback<Schema$RegionalInventory>
803
+ ): void;
804
+ insert(
805
+ params: Params$Resource$Accounts$Products$Regionalinventories$Insert,
806
+ callback: BodyResponseCallback<Schema$RegionalInventory>
807
+ ): void;
808
+ insert(callback: BodyResponseCallback<Schema$RegionalInventory>): void;
809
+ insert(
810
+ paramsOrCallback?:
811
+ | Params$Resource$Accounts$Products$Regionalinventories$Insert
812
+ | BodyResponseCallback<Schema$RegionalInventory>
813
+ | BodyResponseCallback<Readable>,
814
+ optionsOrCallback?:
815
+ | MethodOptions
816
+ | StreamMethodOptions
817
+ | BodyResponseCallback<Schema$RegionalInventory>
818
+ | BodyResponseCallback<Readable>,
819
+ callback?:
820
+ | BodyResponseCallback<Schema$RegionalInventory>
821
+ | BodyResponseCallback<Readable>
822
+ ):
823
+ | void
824
+ | GaxiosPromise<Schema$RegionalInventory>
825
+ | GaxiosPromise<Readable> {
826
+ let params = (paramsOrCallback ||
827
+ {}) as Params$Resource$Accounts$Products$Regionalinventories$Insert;
828
+ let options = (optionsOrCallback || {}) as MethodOptions;
829
+
830
+ if (typeof paramsOrCallback === 'function') {
831
+ callback = paramsOrCallback;
832
+ params =
833
+ {} as Params$Resource$Accounts$Products$Regionalinventories$Insert;
834
+ options = {};
835
+ }
836
+
837
+ if (typeof optionsOrCallback === 'function') {
838
+ callback = optionsOrCallback;
839
+ options = {};
840
+ }
841
+
842
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
843
+ const parameters = {
844
+ options: Object.assign(
845
+ {
846
+ url: (
847
+ rootUrl +
848
+ '/inventories/v1beta/{+parent}/regionalInventories:insert'
849
+ ).replace(/([^:]\/)\/+/g, '$1'),
850
+ method: 'POST',
851
+ apiVersion: '',
852
+ },
853
+ options
854
+ ),
855
+ params,
856
+ requiredParams: ['parent'],
857
+ pathParams: ['parent'],
858
+ context: this.context,
859
+ };
860
+ if (callback) {
861
+ createAPIRequest<Schema$RegionalInventory>(
862
+ parameters,
863
+ callback as BodyResponseCallback<unknown>
864
+ );
865
+ } else {
866
+ return createAPIRequest<Schema$RegionalInventory>(parameters);
867
+ }
868
+ }
869
+
870
+ /**
871
+ * Lists the `RegionalInventory` resources for the given product in your merchant account. The response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in previous request, it can be used to obtain additional results. `RegionalInventory` resources are listed per product for a given account.
872
+ *
873
+ * @param params - Parameters for request
874
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
875
+ * @param callback - Optional callback that handles the response.
876
+ * @returns A promise if used with async/await, or void if used with a callback.
877
+ */
878
+ list(
879
+ params: Params$Resource$Accounts$Products$Regionalinventories$List,
880
+ options: StreamMethodOptions
881
+ ): GaxiosPromise<Readable>;
882
+ list(
883
+ params?: Params$Resource$Accounts$Products$Regionalinventories$List,
884
+ options?: MethodOptions
885
+ ): GaxiosPromise<Schema$ListRegionalInventoriesResponse>;
886
+ list(
887
+ params: Params$Resource$Accounts$Products$Regionalinventories$List,
888
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
889
+ callback: BodyResponseCallback<Readable>
890
+ ): void;
891
+ list(
892
+ params: Params$Resource$Accounts$Products$Regionalinventories$List,
893
+ options:
894
+ | MethodOptions
895
+ | BodyResponseCallback<Schema$ListRegionalInventoriesResponse>,
896
+ callback: BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
897
+ ): void;
898
+ list(
899
+ params: Params$Resource$Accounts$Products$Regionalinventories$List,
900
+ callback: BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
901
+ ): void;
902
+ list(
903
+ callback: BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
904
+ ): void;
905
+ list(
906
+ paramsOrCallback?:
907
+ | Params$Resource$Accounts$Products$Regionalinventories$List
908
+ | BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
909
+ | BodyResponseCallback<Readable>,
910
+ optionsOrCallback?:
911
+ | MethodOptions
912
+ | StreamMethodOptions
913
+ | BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
914
+ | BodyResponseCallback<Readable>,
915
+ callback?:
916
+ | BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
917
+ | BodyResponseCallback<Readable>
918
+ ):
919
+ | void
920
+ | GaxiosPromise<Schema$ListRegionalInventoriesResponse>
921
+ | GaxiosPromise<Readable> {
922
+ let params = (paramsOrCallback ||
923
+ {}) as Params$Resource$Accounts$Products$Regionalinventories$List;
924
+ let options = (optionsOrCallback || {}) as MethodOptions;
925
+
926
+ if (typeof paramsOrCallback === 'function') {
927
+ callback = paramsOrCallback;
928
+ params =
929
+ {} as Params$Resource$Accounts$Products$Regionalinventories$List;
930
+ options = {};
931
+ }
932
+
933
+ if (typeof optionsOrCallback === 'function') {
934
+ callback = optionsOrCallback;
935
+ options = {};
936
+ }
937
+
938
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
939
+ const parameters = {
940
+ options: Object.assign(
941
+ {
942
+ url: (
943
+ rootUrl + '/inventories/v1beta/{+parent}/regionalInventories'
944
+ ).replace(/([^:]\/)\/+/g, '$1'),
945
+ method: 'GET',
946
+ apiVersion: '',
947
+ },
948
+ options
949
+ ),
950
+ params,
951
+ requiredParams: ['parent'],
952
+ pathParams: ['parent'],
953
+ context: this.context,
954
+ };
955
+ if (callback) {
956
+ createAPIRequest<Schema$ListRegionalInventoriesResponse>(
957
+ parameters,
958
+ callback as BodyResponseCallback<unknown>
959
+ );
960
+ } else {
961
+ return createAPIRequest<Schema$ListRegionalInventoriesResponse>(
962
+ parameters
963
+ );
964
+ }
965
+ }
966
+ }
967
+
968
+ export interface Params$Resource$Accounts$Products$Regionalinventories$Delete
969
+ extends StandardParameters {
970
+ /**
971
+ * Required. The name of the `RegionalInventory` resource to delete. Format: `accounts/{account\}/products/{product\}/regionalInventories/{region\}`
972
+ */
973
+ name?: string;
974
+ }
975
+ export interface Params$Resource$Accounts$Products$Regionalinventories$Insert
976
+ extends StandardParameters {
977
+ /**
978
+ * Required. The account and product where this inventory will be inserted. Format: `accounts/{account\}/products/{product\}`
979
+ */
980
+ parent?: string;
981
+
982
+ /**
983
+ * Request body metadata
984
+ */
985
+ requestBody?: Schema$RegionalInventory;
986
+ }
987
+ export interface Params$Resource$Accounts$Products$Regionalinventories$List
988
+ extends StandardParameters {
989
+ /**
990
+ * The maximum number of `RegionalInventory` resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the `pageSize`. The default value is 25000. The maximum value is 100000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum.
991
+ */
992
+ pageSize?: number;
993
+ /**
994
+ * A page token, received from a previous `ListRegionalInventories` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListRegionalInventories` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.
995
+ */
996
+ pageToken?: string;
997
+ /**
998
+ * Required. The `name` of the parent product to list `RegionalInventory` resources for. Format: `accounts/{account\}/products/{product\}`
999
+ */
1000
+ parent?: string;
1001
+ }
1002
+ }