@googleapis/merchantapi 11.0.0 → 12.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 (100) hide show
  1. package/CHANGELOG.md +216 -0
  2. package/accounts_v1.ts +13566 -0
  3. package/accounts_v1beta.ts +4 -4
  4. package/build/accounts_v1.d.ts +7784 -0
  5. package/build/accounts_v1.js +2504 -0
  6. package/build/accounts_v1.js.map +1 -0
  7. package/build/accounts_v1beta.d.ts +4 -5
  8. package/build/accounts_v1beta.js +46 -1
  9. package/build/accounts_v1beta.js.map +1 -1
  10. package/build/conversions_v1.d.ts +748 -0
  11. package/build/conversions_v1.js +256 -0
  12. package/build/conversions_v1.js.map +1 -0
  13. package/build/conversions_v1beta.d.ts +0 -1
  14. package/build/conversions_v1beta.js +6 -1
  15. package/build/conversions_v1beta.js.map +1 -1
  16. package/build/datasources_v1.d.ts +1075 -0
  17. package/build/datasources_v1.js +297 -0
  18. package/build/datasources_v1.js.map +1 -0
  19. package/build/datasources_v1beta.d.ts +0 -1
  20. package/build/datasources_v1beta.js +8 -1
  21. package/build/datasources_v1beta.js.map +1 -1
  22. package/build/index.d.ts +60 -0
  23. package/build/index.js +38 -2
  24. package/build/index.js.map +1 -1
  25. package/build/inventories_v1.d.ts +766 -0
  26. package/build/inventories_v1.js +280 -0
  27. package/build/inventories_v1.js.map +1 -0
  28. package/build/inventories_v1beta.d.ts +0 -1
  29. package/build/inventories_v1beta.js +10 -1
  30. package/build/inventories_v1beta.js.map +1 -1
  31. package/build/issueresolution_v1.d.ts +1026 -0
  32. package/build/issueresolution_v1.js +202 -0
  33. package/build/issueresolution_v1.js.map +1 -0
  34. package/build/issueresolution_v1beta.d.ts +0 -1
  35. package/build/issueresolution_v1beta.js +8 -1
  36. package/build/issueresolution_v1beta.js.map +1 -1
  37. package/build/lfp_v1.d.ts +1047 -0
  38. package/build/lfp_v1.js +315 -0
  39. package/build/lfp_v1.js.map +1 -0
  40. package/build/lfp_v1beta.d.ts +1 -2
  41. package/build/lfp_v1beta.js +12 -1
  42. package/build/lfp_v1beta.js.map +1 -1
  43. package/build/notifications_v1.d.ts +579 -0
  44. package/build/notifications_v1.js +227 -0
  45. package/build/notifications_v1.js.map +1 -0
  46. package/build/notifications_v1beta.d.ts +0 -1
  47. package/build/notifications_v1beta.js +6 -1
  48. package/build/notifications_v1beta.js.map +1 -1
  49. package/build/ordertracking_v1.d.ts +458 -0
  50. package/build/ordertracking_v1.js +96 -0
  51. package/build/ordertracking_v1.js.map +1 -0
  52. package/build/ordertracking_v1beta.d.ts +4 -1
  53. package/build/ordertracking_v1beta.js +6 -1
  54. package/build/ordertracking_v1beta.js.map +1 -1
  55. package/build/products_v1.d.ts +1555 -0
  56. package/build/products_v1.js +233 -0
  57. package/build/products_v1.js.map +1 -0
  58. package/build/products_v1beta.d.ts +3 -4
  59. package/build/products_v1beta.js +8 -1
  60. package/build/products_v1beta.js.map +1 -1
  61. package/build/promotions_v1.d.ts +698 -0
  62. package/build/promotions_v1.js +160 -0
  63. package/build/promotions_v1.js.map +1 -0
  64. package/build/promotions_v1beta.d.ts +4 -5
  65. package/build/promotions_v1beta.js +6 -1
  66. package/build/promotions_v1beta.js.map +1 -1
  67. package/build/quota_v1.d.ts +283 -0
  68. package/build/quota_v1.js +96 -0
  69. package/build/quota_v1.js.map +1 -0
  70. package/build/quota_v1beta.d.ts +0 -1
  71. package/build/quota_v1beta.js +6 -1
  72. package/build/quota_v1beta.js.map +1 -1
  73. package/build/reports_v1.d.ts +1065 -0
  74. package/build/reports_v1.js +96 -0
  75. package/build/reports_v1.js.map +1 -0
  76. package/build/reports_v1beta.d.ts +1 -2
  77. package/build/reports_v1beta.js +6 -1
  78. package/build/reports_v1beta.js.map +1 -1
  79. package/build/reviews_v1beta.d.ts +0 -1
  80. package/build/reviews_v1beta.js +8 -1
  81. package/build/reviews_v1beta.js.map +1 -1
  82. package/build/tsconfig.tsbuildinfo +1 -0
  83. package/conversions_v1.ts +1284 -0
  84. package/datasources_v1.ts +1690 -0
  85. package/index.ts +142 -0
  86. package/inventories_v1.ts +1321 -0
  87. package/issueresolution_v1.ts +1425 -0
  88. package/lfp_v1.ts +1666 -0
  89. package/lfp_v1beta.ts +1 -1
  90. package/notifications_v1.ts +1052 -0
  91. package/ordertracking_v1.ts +599 -0
  92. package/ordertracking_v1beta.ts +4 -0
  93. package/package.json +4 -4
  94. package/products_v1.ts +2013 -0
  95. package/products_v1beta.ts +3 -3
  96. package/promotions_v1.ts +995 -0
  97. package/promotions_v1beta.ts +4 -4
  98. package/quota_v1.ts +424 -0
  99. package/reports_v1.ts +1205 -0
  100. package/reports_v1beta.ts +1 -1
@@ -0,0 +1,1321 @@
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
+ GaxiosResponseWithHTTP2,
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_v1 {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'inventories_v1';
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_v1');
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 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); \}
129
+ */
130
+ export interface Schema$Empty {}
131
+ /**
132
+ * 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.
133
+ */
134
+ export interface Schema$Interval {
135
+ /**
136
+ * Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.
137
+ */
138
+ endTime?: string | null;
139
+ /**
140
+ * Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.
141
+ */
142
+ startTime?: string | null;
143
+ }
144
+ /**
145
+ * Response message for the `ListLocalInventories` method.
146
+ */
147
+ export interface Schema$ListLocalInventoriesResponse {
148
+ /**
149
+ * The `LocalInventory` resources for the given product from the specified account.
150
+ */
151
+ localInventories?: Schema$LocalInventory[];
152
+ /**
153
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.
154
+ */
155
+ nextPageToken?: string | null;
156
+ }
157
+ /**
158
+ * Response message for the `ListRegionalInventories` method.
159
+ */
160
+ export interface Schema$ListRegionalInventoriesResponse {
161
+ /**
162
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.
163
+ */
164
+ nextPageToken?: string | null;
165
+ /**
166
+ * The `RegionalInventory` resources for the given product from the specified account.
167
+ */
168
+ regionalInventories?: Schema$RegionalInventory[];
169
+ }
170
+ /**
171
+ * 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).
172
+ */
173
+ export interface Schema$LocalInventory {
174
+ /**
175
+ * Output only. The account that owns the product. This field will be ignored if set by the client.
176
+ */
177
+ account?: string | null;
178
+ /**
179
+ * Optional. A list of local inventory attributes.
180
+ */
181
+ localInventoryAttributes?: Schema$LocalInventoryAttributes;
182
+ /**
183
+ * Output only. The name of the `LocalInventory` resource. Format: `accounts/{account\}/products/{product\}/localInventories/{store_code\}`
184
+ */
185
+ name?: string | null;
186
+ /**
187
+ * 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.
188
+ */
189
+ storeCode?: string | null;
190
+ }
191
+ /**
192
+ * Local inventory attributes.
193
+ */
194
+ export interface Schema$LocalInventoryAttributes {
195
+ /**
196
+ * [Availability](https://support.google.com/merchants/answer/3061342) of the product at this store.
197
+ */
198
+ availability?: string | null;
199
+ /**
200
+ * Optional. Location of the product inside the store. Maximum length is 20 bytes.
201
+ */
202
+ instoreProductLocation?: string | null;
203
+ /**
204
+ * Optional. Supported [pickup method](https://support.google.com/merchants/answer/3061342) for this product. Unless the value is `"not supported"`, this field must be submitted together with `pickupSla`.
205
+ */
206
+ pickupMethod?: string | null;
207
+ /**
208
+ * Optional. 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`. See more details [here](https://support.google.com/merchants/answer/3061342).
209
+ */
210
+ pickupSla?: string | null;
211
+ /**
212
+ * Optional. Price of the product at this store.
213
+ */
214
+ price?: Schema$Price;
215
+ /**
216
+ * Optional. Quantity of the product available at this store. Must be greater than or equal to zero.
217
+ */
218
+ quantity?: string | null;
219
+ /**
220
+ * Optional. Sale price of the product at this store. Mandatory if `salePriceEffectiveDate` is defined.
221
+ */
222
+ salePrice?: Schema$Price;
223
+ /**
224
+ * Optional. The `TimePeriod` of the sale at this store.
225
+ */
226
+ salePriceEffectiveDate?: Schema$Interval;
227
+ }
228
+ /**
229
+ * The price represented as a number and currency.
230
+ */
231
+ export interface Schema$Price {
232
+ /**
233
+ * 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).
234
+ */
235
+ amountMicros?: string | null;
236
+ /**
237
+ * The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217).
238
+ */
239
+ currencyCode?: string | null;
240
+ }
241
+ /**
242
+ * The change that happened to the product including old value, new value, country code as the region code and reporting context.
243
+ */
244
+ export interface Schema$ProductChange {
245
+ /**
246
+ * The new value of the changed resource or attribute. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)
247
+ */
248
+ newValue?: string | null;
249
+ /**
250
+ * The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)
251
+ */
252
+ oldValue?: string | null;
253
+ /**
254
+ * Countries that have the change (if applicable). Represented in the ISO 3166 format.
255
+ */
256
+ regionCode?: string | null;
257
+ /**
258
+ * Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)
259
+ */
260
+ reportingContext?: string | null;
261
+ }
262
+ /**
263
+ * The message that the merchant will receive to notify about product status change event
264
+ */
265
+ export interface Schema$ProductStatusChangeMessage {
266
+ /**
267
+ * The target account that owns the entity that changed. Format : `accounts/{merchant_id\}`
268
+ */
269
+ account?: string | null;
270
+ /**
271
+ * The attribute in the resource that changed, in this case it will be always `Status`.
272
+ */
273
+ attribute?: string | null;
274
+ /**
275
+ * A message to describe the change that happened to the product
276
+ */
277
+ changes?: Schema$ProductChange[];
278
+ /**
279
+ * The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.
280
+ */
281
+ eventTime?: string | null;
282
+ /**
283
+ * Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.
284
+ */
285
+ expirationTime?: string | null;
286
+ /**
287
+ * 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\}`
288
+ */
289
+ managingAccount?: string | null;
290
+ /**
291
+ * The product name. Format: `accounts/{account\}/products/{product\}`
292
+ */
293
+ resource?: string | null;
294
+ /**
295
+ * The product id.
296
+ */
297
+ resourceId?: string | null;
298
+ /**
299
+ * The resource that changed, in this case it will always be `Product`.
300
+ */
301
+ resourceType?: string | null;
302
+ }
303
+ /**
304
+ * 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).
305
+ */
306
+ export interface Schema$RegionalInventory {
307
+ /**
308
+ * Output only. The account that owns the product. This field will be ignored if set by the client.
309
+ */
310
+ account?: string | null;
311
+ /**
312
+ * Output only. The name of the `RegionalInventory` resource. Format: `{regional_inventory.name=accounts/{account\}/products/{product\}/regionalInventories/{region\}`
313
+ */
314
+ name?: string | null;
315
+ /**
316
+ * 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.
317
+ */
318
+ region?: string | null;
319
+ /**
320
+ * Optional. A list of regional inventory attributes.
321
+ */
322
+ regionalInventoryAttributes?: Schema$RegionalInventoryAttributes;
323
+ }
324
+ /**
325
+ * Regional inventory attributes.
326
+ */
327
+ export interface Schema$RegionalInventoryAttributes {
328
+ /**
329
+ * Optional. [Availability](https://support.google.com/merchants/answer/14644124) of the product in this region.
330
+ */
331
+ availability?: string | null;
332
+ /**
333
+ * Optional. Price of the product in this region.
334
+ */
335
+ price?: Schema$Price;
336
+ /**
337
+ * Optional. Sale price of the product in this region. Mandatory if `salePriceEffectiveDate` is defined.
338
+ */
339
+ salePrice?: Schema$Price;
340
+ /**
341
+ * Optional. The `TimePeriod` of the sale price in this region.
342
+ */
343
+ salePriceEffectiveDate?: Schema$Interval;
344
+ }
345
+
346
+ export class Resource$Accounts {
347
+ context: APIRequestContext;
348
+ products: Resource$Accounts$Products;
349
+ constructor(context: APIRequestContext) {
350
+ this.context = context;
351
+ this.products = new Resource$Accounts$Products(this.context);
352
+ }
353
+ }
354
+
355
+ export class Resource$Accounts$Products {
356
+ context: APIRequestContext;
357
+ localInventories: Resource$Accounts$Products$Localinventories;
358
+ regionalInventories: Resource$Accounts$Products$Regionalinventories;
359
+ constructor(context: APIRequestContext) {
360
+ this.context = context;
361
+ this.localInventories = new Resource$Accounts$Products$Localinventories(
362
+ this.context
363
+ );
364
+ this.regionalInventories =
365
+ new Resource$Accounts$Products$Regionalinventories(this.context);
366
+ }
367
+ }
368
+
369
+ export class Resource$Accounts$Products$Localinventories {
370
+ context: APIRequestContext;
371
+ constructor(context: APIRequestContext) {
372
+ this.context = context;
373
+ }
374
+
375
+ /**
376
+ * 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.
377
+ * @example
378
+ * ```js
379
+ * // Before running the sample:
380
+ * // - Enable the API at:
381
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
382
+ * // - Login into gcloud by running:
383
+ * // ```sh
384
+ * // $ gcloud auth application-default login
385
+ * // ```
386
+ * // - Install the npm module by running:
387
+ * // ```sh
388
+ * // $ npm install googleapis
389
+ * // ```
390
+ *
391
+ * const {google} = require('googleapis');
392
+ * const merchantapi = google.merchantapi('inventories_v1');
393
+ *
394
+ * async function main() {
395
+ * const auth = new google.auth.GoogleAuth({
396
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
397
+ * scopes: ['https://www.googleapis.com/auth/content'],
398
+ * });
399
+ *
400
+ * // Acquire an auth client, and bind it to all future calls
401
+ * const authClient = await auth.getClient();
402
+ * google.options({auth: authClient});
403
+ *
404
+ * // Do the magic
405
+ * const res = await merchantapi.accounts.products.localInventories.delete({
406
+ * // Required. The name of the local inventory for the given product to delete. Format: `accounts/{account\}/products/{product\}/localInventories/{store_code\}`
407
+ * name: 'accounts/my-account/products/my-product/localInventories/my-localInventorie',
408
+ * });
409
+ * console.log(res.data);
410
+ *
411
+ * // Example response
412
+ * // {}
413
+ * }
414
+ *
415
+ * main().catch(e => {
416
+ * console.error(e);
417
+ * throw e;
418
+ * });
419
+ *
420
+ * ```
421
+ *
422
+ * @param params - Parameters for request
423
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
424
+ * @param callback - Optional callback that handles the response.
425
+ * @returns A promise if used with async/await, or void if used with a callback.
426
+ */
427
+ delete(
428
+ params: Params$Resource$Accounts$Products$Localinventories$Delete,
429
+ options: StreamMethodOptions
430
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
431
+ delete(
432
+ params?: Params$Resource$Accounts$Products$Localinventories$Delete,
433
+ options?: MethodOptions
434
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
435
+ delete(
436
+ params: Params$Resource$Accounts$Products$Localinventories$Delete,
437
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
438
+ callback: BodyResponseCallback<Readable>
439
+ ): void;
440
+ delete(
441
+ params: Params$Resource$Accounts$Products$Localinventories$Delete,
442
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
443
+ callback: BodyResponseCallback<Schema$Empty>
444
+ ): void;
445
+ delete(
446
+ params: Params$Resource$Accounts$Products$Localinventories$Delete,
447
+ callback: BodyResponseCallback<Schema$Empty>
448
+ ): void;
449
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
450
+ delete(
451
+ paramsOrCallback?:
452
+ | Params$Resource$Accounts$Products$Localinventories$Delete
453
+ | BodyResponseCallback<Schema$Empty>
454
+ | BodyResponseCallback<Readable>,
455
+ optionsOrCallback?:
456
+ | MethodOptions
457
+ | StreamMethodOptions
458
+ | BodyResponseCallback<Schema$Empty>
459
+ | BodyResponseCallback<Readable>,
460
+ callback?:
461
+ | BodyResponseCallback<Schema$Empty>
462
+ | BodyResponseCallback<Readable>
463
+ ):
464
+ | void
465
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
466
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
467
+ let params = (paramsOrCallback ||
468
+ {}) as Params$Resource$Accounts$Products$Localinventories$Delete;
469
+ let options = (optionsOrCallback || {}) as MethodOptions;
470
+
471
+ if (typeof paramsOrCallback === 'function') {
472
+ callback = paramsOrCallback;
473
+ params =
474
+ {} as Params$Resource$Accounts$Products$Localinventories$Delete;
475
+ options = {};
476
+ }
477
+
478
+ if (typeof optionsOrCallback === 'function') {
479
+ callback = optionsOrCallback;
480
+ options = {};
481
+ }
482
+
483
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
484
+ const parameters = {
485
+ options: Object.assign(
486
+ {
487
+ url: (rootUrl + '/inventories/v1/{+name}').replace(
488
+ /([^:]\/)\/+/g,
489
+ '$1'
490
+ ),
491
+ method: 'DELETE',
492
+ apiVersion: '',
493
+ },
494
+ options
495
+ ),
496
+ params,
497
+ requiredParams: ['name'],
498
+ pathParams: ['name'],
499
+ context: this.context,
500
+ };
501
+ if (callback) {
502
+ createAPIRequest<Schema$Empty>(
503
+ parameters,
504
+ callback as BodyResponseCallback<unknown>
505
+ );
506
+ } else {
507
+ return createAPIRequest<Schema$Empty>(parameters);
508
+ }
509
+ }
510
+
511
+ /**
512
+ * 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.
513
+ * @example
514
+ * ```js
515
+ * // Before running the sample:
516
+ * // - Enable the API at:
517
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
518
+ * // - Login into gcloud by running:
519
+ * // ```sh
520
+ * // $ gcloud auth application-default login
521
+ * // ```
522
+ * // - Install the npm module by running:
523
+ * // ```sh
524
+ * // $ npm install googleapis
525
+ * // ```
526
+ *
527
+ * const {google} = require('googleapis');
528
+ * const merchantapi = google.merchantapi('inventories_v1');
529
+ *
530
+ * async function main() {
531
+ * const auth = new google.auth.GoogleAuth({
532
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
533
+ * scopes: ['https://www.googleapis.com/auth/content'],
534
+ * });
535
+ *
536
+ * // Acquire an auth client, and bind it to all future calls
537
+ * const authClient = await auth.getClient();
538
+ * google.options({auth: authClient});
539
+ *
540
+ * // Do the magic
541
+ * const res = await merchantapi.accounts.products.localInventories.insert({
542
+ * // Required. The account and product where this inventory will be inserted. Format: `accounts/{account\}/products/{product\}`
543
+ * parent: 'accounts/my-account/products/my-product',
544
+ *
545
+ * // Request body metadata
546
+ * requestBody: {
547
+ * // request body parameters
548
+ * // {
549
+ * // "account": "my_account",
550
+ * // "localInventoryAttributes": {},
551
+ * // "name": "my_name",
552
+ * // "storeCode": "my_storeCode"
553
+ * // }
554
+ * },
555
+ * });
556
+ * console.log(res.data);
557
+ *
558
+ * // Example response
559
+ * // {
560
+ * // "account": "my_account",
561
+ * // "localInventoryAttributes": {},
562
+ * // "name": "my_name",
563
+ * // "storeCode": "my_storeCode"
564
+ * // }
565
+ * }
566
+ *
567
+ * main().catch(e => {
568
+ * console.error(e);
569
+ * throw e;
570
+ * });
571
+ *
572
+ * ```
573
+ *
574
+ * @param params - Parameters for request
575
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
576
+ * @param callback - Optional callback that handles the response.
577
+ * @returns A promise if used with async/await, or void if used with a callback.
578
+ */
579
+ insert(
580
+ params: Params$Resource$Accounts$Products$Localinventories$Insert,
581
+ options: StreamMethodOptions
582
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
583
+ insert(
584
+ params?: Params$Resource$Accounts$Products$Localinventories$Insert,
585
+ options?: MethodOptions
586
+ ): Promise<GaxiosResponseWithHTTP2<Schema$LocalInventory>>;
587
+ insert(
588
+ params: Params$Resource$Accounts$Products$Localinventories$Insert,
589
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
590
+ callback: BodyResponseCallback<Readable>
591
+ ): void;
592
+ insert(
593
+ params: Params$Resource$Accounts$Products$Localinventories$Insert,
594
+ options: MethodOptions | BodyResponseCallback<Schema$LocalInventory>,
595
+ callback: BodyResponseCallback<Schema$LocalInventory>
596
+ ): void;
597
+ insert(
598
+ params: Params$Resource$Accounts$Products$Localinventories$Insert,
599
+ callback: BodyResponseCallback<Schema$LocalInventory>
600
+ ): void;
601
+ insert(callback: BodyResponseCallback<Schema$LocalInventory>): void;
602
+ insert(
603
+ paramsOrCallback?:
604
+ | Params$Resource$Accounts$Products$Localinventories$Insert
605
+ | BodyResponseCallback<Schema$LocalInventory>
606
+ | BodyResponseCallback<Readable>,
607
+ optionsOrCallback?:
608
+ | MethodOptions
609
+ | StreamMethodOptions
610
+ | BodyResponseCallback<Schema$LocalInventory>
611
+ | BodyResponseCallback<Readable>,
612
+ callback?:
613
+ | BodyResponseCallback<Schema$LocalInventory>
614
+ | BodyResponseCallback<Readable>
615
+ ):
616
+ | void
617
+ | Promise<GaxiosResponseWithHTTP2<Schema$LocalInventory>>
618
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
619
+ let params = (paramsOrCallback ||
620
+ {}) as Params$Resource$Accounts$Products$Localinventories$Insert;
621
+ let options = (optionsOrCallback || {}) as MethodOptions;
622
+
623
+ if (typeof paramsOrCallback === 'function') {
624
+ callback = paramsOrCallback;
625
+ params =
626
+ {} as Params$Resource$Accounts$Products$Localinventories$Insert;
627
+ options = {};
628
+ }
629
+
630
+ if (typeof optionsOrCallback === 'function') {
631
+ callback = optionsOrCallback;
632
+ options = {};
633
+ }
634
+
635
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
636
+ const parameters = {
637
+ options: Object.assign(
638
+ {
639
+ url: (
640
+ rootUrl + '/inventories/v1/{+parent}/localInventories:insert'
641
+ ).replace(/([^:]\/)\/+/g, '$1'),
642
+ method: 'POST',
643
+ apiVersion: '',
644
+ },
645
+ options
646
+ ),
647
+ params,
648
+ requiredParams: ['parent'],
649
+ pathParams: ['parent'],
650
+ context: this.context,
651
+ };
652
+ if (callback) {
653
+ createAPIRequest<Schema$LocalInventory>(
654
+ parameters,
655
+ callback as BodyResponseCallback<unknown>
656
+ );
657
+ } else {
658
+ return createAPIRequest<Schema$LocalInventory>(parameters);
659
+ }
660
+ }
661
+
662
+ /**
663
+ * 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.
664
+ * @example
665
+ * ```js
666
+ * // Before running the sample:
667
+ * // - Enable the API at:
668
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
669
+ * // - Login into gcloud by running:
670
+ * // ```sh
671
+ * // $ gcloud auth application-default login
672
+ * // ```
673
+ * // - Install the npm module by running:
674
+ * // ```sh
675
+ * // $ npm install googleapis
676
+ * // ```
677
+ *
678
+ * const {google} = require('googleapis');
679
+ * const merchantapi = google.merchantapi('inventories_v1');
680
+ *
681
+ * async function main() {
682
+ * const auth = new google.auth.GoogleAuth({
683
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
684
+ * scopes: ['https://www.googleapis.com/auth/content'],
685
+ * });
686
+ *
687
+ * // Acquire an auth client, and bind it to all future calls
688
+ * const authClient = await auth.getClient();
689
+ * google.options({auth: authClient});
690
+ *
691
+ * // Do the magic
692
+ * const res = await merchantapi.accounts.products.localInventories.list({
693
+ * // 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
694
+ * pageSize: 'placeholder-value',
695
+ * // 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.
696
+ * pageToken: 'placeholder-value',
697
+ * // Required. The `name` of the parent product to list local inventories for. Format: `accounts/{account\}/products/{product\}`
698
+ * parent: 'accounts/my-account/products/my-product',
699
+ * });
700
+ * console.log(res.data);
701
+ *
702
+ * // Example response
703
+ * // {
704
+ * // "localInventories": [],
705
+ * // "nextPageToken": "my_nextPageToken"
706
+ * // }
707
+ * }
708
+ *
709
+ * main().catch(e => {
710
+ * console.error(e);
711
+ * throw e;
712
+ * });
713
+ *
714
+ * ```
715
+ *
716
+ * @param params - Parameters for request
717
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
718
+ * @param callback - Optional callback that handles the response.
719
+ * @returns A promise if used with async/await, or void if used with a callback.
720
+ */
721
+ list(
722
+ params: Params$Resource$Accounts$Products$Localinventories$List,
723
+ options: StreamMethodOptions
724
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
725
+ list(
726
+ params?: Params$Resource$Accounts$Products$Localinventories$List,
727
+ options?: MethodOptions
728
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListLocalInventoriesResponse>>;
729
+ list(
730
+ params: Params$Resource$Accounts$Products$Localinventories$List,
731
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
732
+ callback: BodyResponseCallback<Readable>
733
+ ): void;
734
+ list(
735
+ params: Params$Resource$Accounts$Products$Localinventories$List,
736
+ options:
737
+ | MethodOptions
738
+ | BodyResponseCallback<Schema$ListLocalInventoriesResponse>,
739
+ callback: BodyResponseCallback<Schema$ListLocalInventoriesResponse>
740
+ ): void;
741
+ list(
742
+ params: Params$Resource$Accounts$Products$Localinventories$List,
743
+ callback: BodyResponseCallback<Schema$ListLocalInventoriesResponse>
744
+ ): void;
745
+ list(
746
+ callback: BodyResponseCallback<Schema$ListLocalInventoriesResponse>
747
+ ): void;
748
+ list(
749
+ paramsOrCallback?:
750
+ | Params$Resource$Accounts$Products$Localinventories$List
751
+ | BodyResponseCallback<Schema$ListLocalInventoriesResponse>
752
+ | BodyResponseCallback<Readable>,
753
+ optionsOrCallback?:
754
+ | MethodOptions
755
+ | StreamMethodOptions
756
+ | BodyResponseCallback<Schema$ListLocalInventoriesResponse>
757
+ | BodyResponseCallback<Readable>,
758
+ callback?:
759
+ | BodyResponseCallback<Schema$ListLocalInventoriesResponse>
760
+ | BodyResponseCallback<Readable>
761
+ ):
762
+ | void
763
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListLocalInventoriesResponse>>
764
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
765
+ let params = (paramsOrCallback ||
766
+ {}) as Params$Resource$Accounts$Products$Localinventories$List;
767
+ let options = (optionsOrCallback || {}) as MethodOptions;
768
+
769
+ if (typeof paramsOrCallback === 'function') {
770
+ callback = paramsOrCallback;
771
+ params = {} as Params$Resource$Accounts$Products$Localinventories$List;
772
+ options = {};
773
+ }
774
+
775
+ if (typeof optionsOrCallback === 'function') {
776
+ callback = optionsOrCallback;
777
+ options = {};
778
+ }
779
+
780
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
781
+ const parameters = {
782
+ options: Object.assign(
783
+ {
784
+ url: (
785
+ rootUrl + '/inventories/v1/{+parent}/localInventories'
786
+ ).replace(/([^:]\/)\/+/g, '$1'),
787
+ method: 'GET',
788
+ apiVersion: '',
789
+ },
790
+ options
791
+ ),
792
+ params,
793
+ requiredParams: ['parent'],
794
+ pathParams: ['parent'],
795
+ context: this.context,
796
+ };
797
+ if (callback) {
798
+ createAPIRequest<Schema$ListLocalInventoriesResponse>(
799
+ parameters,
800
+ callback as BodyResponseCallback<unknown>
801
+ );
802
+ } else {
803
+ return createAPIRequest<Schema$ListLocalInventoriesResponse>(
804
+ parameters
805
+ );
806
+ }
807
+ }
808
+ }
809
+
810
+ export interface Params$Resource$Accounts$Products$Localinventories$Delete
811
+ extends StandardParameters {
812
+ /**
813
+ * Required. The name of the local inventory for the given product to delete. Format: `accounts/{account\}/products/{product\}/localInventories/{store_code\}`
814
+ */
815
+ name?: string;
816
+ }
817
+ export interface Params$Resource$Accounts$Products$Localinventories$Insert
818
+ extends StandardParameters {
819
+ /**
820
+ * Required. The account and product where this inventory will be inserted. Format: `accounts/{account\}/products/{product\}`
821
+ */
822
+ parent?: string;
823
+
824
+ /**
825
+ * Request body metadata
826
+ */
827
+ requestBody?: Schema$LocalInventory;
828
+ }
829
+ export interface Params$Resource$Accounts$Products$Localinventories$List
830
+ extends StandardParameters {
831
+ /**
832
+ * 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
833
+ */
834
+ pageSize?: number;
835
+ /**
836
+ * 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.
837
+ */
838
+ pageToken?: string;
839
+ /**
840
+ * Required. The `name` of the parent product to list local inventories for. Format: `accounts/{account\}/products/{product\}`
841
+ */
842
+ parent?: string;
843
+ }
844
+
845
+ export class Resource$Accounts$Products$Regionalinventories {
846
+ context: APIRequestContext;
847
+ constructor(context: APIRequestContext) {
848
+ this.context = context;
849
+ }
850
+
851
+ /**
852
+ * 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.
853
+ * @example
854
+ * ```js
855
+ * // Before running the sample:
856
+ * // - Enable the API at:
857
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
858
+ * // - Login into gcloud by running:
859
+ * // ```sh
860
+ * // $ gcloud auth application-default login
861
+ * // ```
862
+ * // - Install the npm module by running:
863
+ * // ```sh
864
+ * // $ npm install googleapis
865
+ * // ```
866
+ *
867
+ * const {google} = require('googleapis');
868
+ * const merchantapi = google.merchantapi('inventories_v1');
869
+ *
870
+ * async function main() {
871
+ * const auth = new google.auth.GoogleAuth({
872
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
873
+ * scopes: ['https://www.googleapis.com/auth/content'],
874
+ * });
875
+ *
876
+ * // Acquire an auth client, and bind it to all future calls
877
+ * const authClient = await auth.getClient();
878
+ * google.options({auth: authClient});
879
+ *
880
+ * // Do the magic
881
+ * const res = await merchantapi.accounts.products.regionalInventories.delete({
882
+ * // Required. The name of the `RegionalInventory` resource to delete. Format: `accounts/{account\}/products/{product\}/regionalInventories/{region\}`
883
+ * name: 'accounts/my-account/products/my-product/regionalInventories/my-regionalInventorie',
884
+ * });
885
+ * console.log(res.data);
886
+ *
887
+ * // Example response
888
+ * // {}
889
+ * }
890
+ *
891
+ * main().catch(e => {
892
+ * console.error(e);
893
+ * throw e;
894
+ * });
895
+ *
896
+ * ```
897
+ *
898
+ * @param params - Parameters for request
899
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
900
+ * @param callback - Optional callback that handles the response.
901
+ * @returns A promise if used with async/await, or void if used with a callback.
902
+ */
903
+ delete(
904
+ params: Params$Resource$Accounts$Products$Regionalinventories$Delete,
905
+ options: StreamMethodOptions
906
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
907
+ delete(
908
+ params?: Params$Resource$Accounts$Products$Regionalinventories$Delete,
909
+ options?: MethodOptions
910
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
911
+ delete(
912
+ params: Params$Resource$Accounts$Products$Regionalinventories$Delete,
913
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
914
+ callback: BodyResponseCallback<Readable>
915
+ ): void;
916
+ delete(
917
+ params: Params$Resource$Accounts$Products$Regionalinventories$Delete,
918
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
919
+ callback: BodyResponseCallback<Schema$Empty>
920
+ ): void;
921
+ delete(
922
+ params: Params$Resource$Accounts$Products$Regionalinventories$Delete,
923
+ callback: BodyResponseCallback<Schema$Empty>
924
+ ): void;
925
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
926
+ delete(
927
+ paramsOrCallback?:
928
+ | Params$Resource$Accounts$Products$Regionalinventories$Delete
929
+ | BodyResponseCallback<Schema$Empty>
930
+ | BodyResponseCallback<Readable>,
931
+ optionsOrCallback?:
932
+ | MethodOptions
933
+ | StreamMethodOptions
934
+ | BodyResponseCallback<Schema$Empty>
935
+ | BodyResponseCallback<Readable>,
936
+ callback?:
937
+ | BodyResponseCallback<Schema$Empty>
938
+ | BodyResponseCallback<Readable>
939
+ ):
940
+ | void
941
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
942
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
943
+ let params = (paramsOrCallback ||
944
+ {}) as Params$Resource$Accounts$Products$Regionalinventories$Delete;
945
+ let options = (optionsOrCallback || {}) as MethodOptions;
946
+
947
+ if (typeof paramsOrCallback === 'function') {
948
+ callback = paramsOrCallback;
949
+ params =
950
+ {} as Params$Resource$Accounts$Products$Regionalinventories$Delete;
951
+ options = {};
952
+ }
953
+
954
+ if (typeof optionsOrCallback === 'function') {
955
+ callback = optionsOrCallback;
956
+ options = {};
957
+ }
958
+
959
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
960
+ const parameters = {
961
+ options: Object.assign(
962
+ {
963
+ url: (rootUrl + '/inventories/v1/{+name}').replace(
964
+ /([^:]\/)\/+/g,
965
+ '$1'
966
+ ),
967
+ method: 'DELETE',
968
+ apiVersion: '',
969
+ },
970
+ options
971
+ ),
972
+ params,
973
+ requiredParams: ['name'],
974
+ pathParams: ['name'],
975
+ context: this.context,
976
+ };
977
+ if (callback) {
978
+ createAPIRequest<Schema$Empty>(
979
+ parameters,
980
+ callback as BodyResponseCallback<unknown>
981
+ );
982
+ } else {
983
+ return createAPIRequest<Schema$Empty>(parameters);
984
+ }
985
+ }
986
+
987
+ /**
988
+ * 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.
989
+ * @example
990
+ * ```js
991
+ * // Before running the sample:
992
+ * // - Enable the API at:
993
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
994
+ * // - Login into gcloud by running:
995
+ * // ```sh
996
+ * // $ gcloud auth application-default login
997
+ * // ```
998
+ * // - Install the npm module by running:
999
+ * // ```sh
1000
+ * // $ npm install googleapis
1001
+ * // ```
1002
+ *
1003
+ * const {google} = require('googleapis');
1004
+ * const merchantapi = google.merchantapi('inventories_v1');
1005
+ *
1006
+ * async function main() {
1007
+ * const auth = new google.auth.GoogleAuth({
1008
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1009
+ * scopes: ['https://www.googleapis.com/auth/content'],
1010
+ * });
1011
+ *
1012
+ * // Acquire an auth client, and bind it to all future calls
1013
+ * const authClient = await auth.getClient();
1014
+ * google.options({auth: authClient});
1015
+ *
1016
+ * // Do the magic
1017
+ * const res = await merchantapi.accounts.products.regionalInventories.insert({
1018
+ * // Required. The account and product where this inventory will be inserted. Format: `accounts/{account\}/products/{product\}`
1019
+ * parent: 'accounts/my-account/products/my-product',
1020
+ *
1021
+ * // Request body metadata
1022
+ * requestBody: {
1023
+ * // request body parameters
1024
+ * // {
1025
+ * // "account": "my_account",
1026
+ * // "name": "my_name",
1027
+ * // "region": "my_region",
1028
+ * // "regionalInventoryAttributes": {}
1029
+ * // }
1030
+ * },
1031
+ * });
1032
+ * console.log(res.data);
1033
+ *
1034
+ * // Example response
1035
+ * // {
1036
+ * // "account": "my_account",
1037
+ * // "name": "my_name",
1038
+ * // "region": "my_region",
1039
+ * // "regionalInventoryAttributes": {}
1040
+ * // }
1041
+ * }
1042
+ *
1043
+ * main().catch(e => {
1044
+ * console.error(e);
1045
+ * throw e;
1046
+ * });
1047
+ *
1048
+ * ```
1049
+ *
1050
+ * @param params - Parameters for request
1051
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1052
+ * @param callback - Optional callback that handles the response.
1053
+ * @returns A promise if used with async/await, or void if used with a callback.
1054
+ */
1055
+ insert(
1056
+ params: Params$Resource$Accounts$Products$Regionalinventories$Insert,
1057
+ options: StreamMethodOptions
1058
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1059
+ insert(
1060
+ params?: Params$Resource$Accounts$Products$Regionalinventories$Insert,
1061
+ options?: MethodOptions
1062
+ ): Promise<GaxiosResponseWithHTTP2<Schema$RegionalInventory>>;
1063
+ insert(
1064
+ params: Params$Resource$Accounts$Products$Regionalinventories$Insert,
1065
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1066
+ callback: BodyResponseCallback<Readable>
1067
+ ): void;
1068
+ insert(
1069
+ params: Params$Resource$Accounts$Products$Regionalinventories$Insert,
1070
+ options: MethodOptions | BodyResponseCallback<Schema$RegionalInventory>,
1071
+ callback: BodyResponseCallback<Schema$RegionalInventory>
1072
+ ): void;
1073
+ insert(
1074
+ params: Params$Resource$Accounts$Products$Regionalinventories$Insert,
1075
+ callback: BodyResponseCallback<Schema$RegionalInventory>
1076
+ ): void;
1077
+ insert(callback: BodyResponseCallback<Schema$RegionalInventory>): void;
1078
+ insert(
1079
+ paramsOrCallback?:
1080
+ | Params$Resource$Accounts$Products$Regionalinventories$Insert
1081
+ | BodyResponseCallback<Schema$RegionalInventory>
1082
+ | BodyResponseCallback<Readable>,
1083
+ optionsOrCallback?:
1084
+ | MethodOptions
1085
+ | StreamMethodOptions
1086
+ | BodyResponseCallback<Schema$RegionalInventory>
1087
+ | BodyResponseCallback<Readable>,
1088
+ callback?:
1089
+ | BodyResponseCallback<Schema$RegionalInventory>
1090
+ | BodyResponseCallback<Readable>
1091
+ ):
1092
+ | void
1093
+ | Promise<GaxiosResponseWithHTTP2<Schema$RegionalInventory>>
1094
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1095
+ let params = (paramsOrCallback ||
1096
+ {}) as Params$Resource$Accounts$Products$Regionalinventories$Insert;
1097
+ let options = (optionsOrCallback || {}) as MethodOptions;
1098
+
1099
+ if (typeof paramsOrCallback === 'function') {
1100
+ callback = paramsOrCallback;
1101
+ params =
1102
+ {} as Params$Resource$Accounts$Products$Regionalinventories$Insert;
1103
+ options = {};
1104
+ }
1105
+
1106
+ if (typeof optionsOrCallback === 'function') {
1107
+ callback = optionsOrCallback;
1108
+ options = {};
1109
+ }
1110
+
1111
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
1112
+ const parameters = {
1113
+ options: Object.assign(
1114
+ {
1115
+ url: (
1116
+ rootUrl + '/inventories/v1/{+parent}/regionalInventories:insert'
1117
+ ).replace(/([^:]\/)\/+/g, '$1'),
1118
+ method: 'POST',
1119
+ apiVersion: '',
1120
+ },
1121
+ options
1122
+ ),
1123
+ params,
1124
+ requiredParams: ['parent'],
1125
+ pathParams: ['parent'],
1126
+ context: this.context,
1127
+ };
1128
+ if (callback) {
1129
+ createAPIRequest<Schema$RegionalInventory>(
1130
+ parameters,
1131
+ callback as BodyResponseCallback<unknown>
1132
+ );
1133
+ } else {
1134
+ return createAPIRequest<Schema$RegionalInventory>(parameters);
1135
+ }
1136
+ }
1137
+
1138
+ /**
1139
+ * 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.
1140
+ * @example
1141
+ * ```js
1142
+ * // Before running the sample:
1143
+ * // - Enable the API at:
1144
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
1145
+ * // - Login into gcloud by running:
1146
+ * // ```sh
1147
+ * // $ gcloud auth application-default login
1148
+ * // ```
1149
+ * // - Install the npm module by running:
1150
+ * // ```sh
1151
+ * // $ npm install googleapis
1152
+ * // ```
1153
+ *
1154
+ * const {google} = require('googleapis');
1155
+ * const merchantapi = google.merchantapi('inventories_v1');
1156
+ *
1157
+ * async function main() {
1158
+ * const auth = new google.auth.GoogleAuth({
1159
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1160
+ * scopes: ['https://www.googleapis.com/auth/content'],
1161
+ * });
1162
+ *
1163
+ * // Acquire an auth client, and bind it to all future calls
1164
+ * const authClient = await auth.getClient();
1165
+ * google.options({auth: authClient});
1166
+ *
1167
+ * // Do the magic
1168
+ * const res = await merchantapi.accounts.products.regionalInventories.list({
1169
+ * // 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.
1170
+ * pageSize: 'placeholder-value',
1171
+ * // 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.
1172
+ * pageToken: 'placeholder-value',
1173
+ * // Required. The `name` of the parent product to list `RegionalInventory` resources for. Format: `accounts/{account\}/products/{product\}`
1174
+ * parent: 'accounts/my-account/products/my-product',
1175
+ * });
1176
+ * console.log(res.data);
1177
+ *
1178
+ * // Example response
1179
+ * // {
1180
+ * // "nextPageToken": "my_nextPageToken",
1181
+ * // "regionalInventories": []
1182
+ * // }
1183
+ * }
1184
+ *
1185
+ * main().catch(e => {
1186
+ * console.error(e);
1187
+ * throw e;
1188
+ * });
1189
+ *
1190
+ * ```
1191
+ *
1192
+ * @param params - Parameters for request
1193
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1194
+ * @param callback - Optional callback that handles the response.
1195
+ * @returns A promise if used with async/await, or void if used with a callback.
1196
+ */
1197
+ list(
1198
+ params: Params$Resource$Accounts$Products$Regionalinventories$List,
1199
+ options: StreamMethodOptions
1200
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1201
+ list(
1202
+ params?: Params$Resource$Accounts$Products$Regionalinventories$List,
1203
+ options?: MethodOptions
1204
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListRegionalInventoriesResponse>>;
1205
+ list(
1206
+ params: Params$Resource$Accounts$Products$Regionalinventories$List,
1207
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1208
+ callback: BodyResponseCallback<Readable>
1209
+ ): void;
1210
+ list(
1211
+ params: Params$Resource$Accounts$Products$Regionalinventories$List,
1212
+ options:
1213
+ | MethodOptions
1214
+ | BodyResponseCallback<Schema$ListRegionalInventoriesResponse>,
1215
+ callback: BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
1216
+ ): void;
1217
+ list(
1218
+ params: Params$Resource$Accounts$Products$Regionalinventories$List,
1219
+ callback: BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
1220
+ ): void;
1221
+ list(
1222
+ callback: BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
1223
+ ): void;
1224
+ list(
1225
+ paramsOrCallback?:
1226
+ | Params$Resource$Accounts$Products$Regionalinventories$List
1227
+ | BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
1228
+ | BodyResponseCallback<Readable>,
1229
+ optionsOrCallback?:
1230
+ | MethodOptions
1231
+ | StreamMethodOptions
1232
+ | BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
1233
+ | BodyResponseCallback<Readable>,
1234
+ callback?:
1235
+ | BodyResponseCallback<Schema$ListRegionalInventoriesResponse>
1236
+ | BodyResponseCallback<Readable>
1237
+ ):
1238
+ | void
1239
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListRegionalInventoriesResponse>>
1240
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1241
+ let params = (paramsOrCallback ||
1242
+ {}) as Params$Resource$Accounts$Products$Regionalinventories$List;
1243
+ let options = (optionsOrCallback || {}) as MethodOptions;
1244
+
1245
+ if (typeof paramsOrCallback === 'function') {
1246
+ callback = paramsOrCallback;
1247
+ params =
1248
+ {} as Params$Resource$Accounts$Products$Regionalinventories$List;
1249
+ options = {};
1250
+ }
1251
+
1252
+ if (typeof optionsOrCallback === 'function') {
1253
+ callback = optionsOrCallback;
1254
+ options = {};
1255
+ }
1256
+
1257
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
1258
+ const parameters = {
1259
+ options: Object.assign(
1260
+ {
1261
+ url: (
1262
+ rootUrl + '/inventories/v1/{+parent}/regionalInventories'
1263
+ ).replace(/([^:]\/)\/+/g, '$1'),
1264
+ method: 'GET',
1265
+ apiVersion: '',
1266
+ },
1267
+ options
1268
+ ),
1269
+ params,
1270
+ requiredParams: ['parent'],
1271
+ pathParams: ['parent'],
1272
+ context: this.context,
1273
+ };
1274
+ if (callback) {
1275
+ createAPIRequest<Schema$ListRegionalInventoriesResponse>(
1276
+ parameters,
1277
+ callback as BodyResponseCallback<unknown>
1278
+ );
1279
+ } else {
1280
+ return createAPIRequest<Schema$ListRegionalInventoriesResponse>(
1281
+ parameters
1282
+ );
1283
+ }
1284
+ }
1285
+ }
1286
+
1287
+ export interface Params$Resource$Accounts$Products$Regionalinventories$Delete
1288
+ extends StandardParameters {
1289
+ /**
1290
+ * Required. The name of the `RegionalInventory` resource to delete. Format: `accounts/{account\}/products/{product\}/regionalInventories/{region\}`
1291
+ */
1292
+ name?: string;
1293
+ }
1294
+ export interface Params$Resource$Accounts$Products$Regionalinventories$Insert
1295
+ extends StandardParameters {
1296
+ /**
1297
+ * Required. The account and product where this inventory will be inserted. Format: `accounts/{account\}/products/{product\}`
1298
+ */
1299
+ parent?: string;
1300
+
1301
+ /**
1302
+ * Request body metadata
1303
+ */
1304
+ requestBody?: Schema$RegionalInventory;
1305
+ }
1306
+ export interface Params$Resource$Accounts$Products$Regionalinventories$List
1307
+ extends StandardParameters {
1308
+ /**
1309
+ * 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.
1310
+ */
1311
+ pageSize?: number;
1312
+ /**
1313
+ * 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.
1314
+ */
1315
+ pageToken?: string;
1316
+ /**
1317
+ * Required. The `name` of the parent product to list `RegionalInventory` resources for. Format: `accounts/{account\}/products/{product\}`
1318
+ */
1319
+ parent?: string;
1320
+ }
1321
+ }