@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
package/lfp_v1beta.ts ADDED
@@ -0,0 +1,1012 @@
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_lfp_v1beta {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'lfp_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('lfp_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 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
+ * Local Inventory for the merchant.
133
+ */
134
+ export interface Schema$LfpInventory {
135
+ /**
136
+ * Required. 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)
137
+ */
138
+ availability?: string | null;
139
+ /**
140
+ * Optional. The time when the inventory is collected. If not set, it will be set to the time when the inventory is submitted.
141
+ */
142
+ collectionTime?: string | null;
143
+ /**
144
+ * Required. The two-letter ISO 639-1 language code for the item.
145
+ */
146
+ contentLanguage?: string | null;
147
+ /**
148
+ * Optional. The [feed label](https://developers.google.com/shopping-content/guides/products/feed-labels) for the product. If this is not set, it will default to `regionCode`.
149
+ */
150
+ feedLabel?: string | null;
151
+ /**
152
+ * Optional. The Global Trade Item Number of the product.
153
+ */
154
+ gtin?: string | null;
155
+ /**
156
+ * Output only. Identifier. The name for the `LfpInventory` resource. Format: `accounts/{account\}/lfpInventories/{target_merchant\}~{store_code\}~{offer\}`
157
+ */
158
+ name?: string | null;
159
+ /**
160
+ * Required. Immutable. A unique identifier for the product. If both inventories and sales are submitted for a merchant, this id should match for the same product. **Note**: if the merchant sells the same product new and used, they should have different IDs.
161
+ */
162
+ offerId?: string | null;
163
+ /**
164
+ * Optional. Supported pickup method for this offer. 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).
165
+ */
166
+ pickupMethod?: string | null;
167
+ /**
168
+ * Optional. Expected date that an order will be ready for pickup relative to the order date. Must be submitted together with `pickupMethod`. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342).
169
+ */
170
+ pickupSla?: string | null;
171
+ /**
172
+ * Optional. The current price of the product.
173
+ */
174
+ price?: Schema$Price;
175
+ /**
176
+ * Optional. Quantity of the product available at this store. Must be greater than or equal to zero.
177
+ */
178
+ quantity?: string | null;
179
+ /**
180
+ * Required. The [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the country where the product is sold.
181
+ */
182
+ regionCode?: string | null;
183
+ /**
184
+ * Required. The identifier of the merchant's store. Either the store code inserted through `InsertLfpStore` or the store code in the Business Profile.
185
+ */
186
+ storeCode?: string | null;
187
+ /**
188
+ * Required. The Merchant Center ID of the merchant to submit the inventory for.
189
+ */
190
+ targetAccount?: string | null;
191
+ }
192
+ /**
193
+ * A sale for the merchant.
194
+ */
195
+ export interface Schema$LfpSale {
196
+ /**
197
+ * Required. The two-letter ISO 639-1 language code for the item.
198
+ */
199
+ contentLanguage?: string | null;
200
+ /**
201
+ * Optional. The [feed label](https://developers.google.com/shopping-content/guides/products/feed-labels) for the product. If this is not set, it will default to `regionCode`.
202
+ */
203
+ feedLabel?: string | null;
204
+ /**
205
+ * Required. The Global Trade Item Number of the sold product.
206
+ */
207
+ gtin?: string | null;
208
+ /**
209
+ * Output only. Identifier. The name of the `LfpSale` resource. Format: `accounts/{account\}/lfpSales/{sale\}`
210
+ */
211
+ name?: string | null;
212
+ /**
213
+ * Required. A unique identifier for the product. If both inventories and sales are submitted for a merchant, this id should match for the same product. **Note**: if the merchant sells the same product new and used, they should have different IDs.
214
+ */
215
+ offerId?: string | null;
216
+ /**
217
+ * Required. The unit price of the product.
218
+ */
219
+ price?: Schema$Price;
220
+ /**
221
+ * Required. The relative change of the available quantity. Negative for items returned.
222
+ */
223
+ quantity?: string | null;
224
+ /**
225
+ * Required. The [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the country where the product is sold.
226
+ */
227
+ regionCode?: string | null;
228
+ /**
229
+ * Required. The timestamp for the sale.
230
+ */
231
+ saleTime?: string | null;
232
+ /**
233
+ * Required. The identifier of the merchant's store. Either a `storeCode` inserted through the API or the code of the store in the Business Profile.
234
+ */
235
+ storeCode?: string | null;
236
+ /**
237
+ * Required. The Merchant Center ID of the merchant to submit the sale for.
238
+ */
239
+ targetAccount?: string | null;
240
+ /**
241
+ * Output only. System generated globally unique ID for the `LfpSale`.
242
+ */
243
+ uid?: string | null;
244
+ }
245
+ /**
246
+ * A store for the merchant. This will be used to match to a store under the Google Business Profile of the target merchant. If a matching store can't be found, the inventories or sales submitted with the store code will not be used.
247
+ */
248
+ export interface Schema$LfpStore {
249
+ /**
250
+ * Optional. [Google My Business category id](https://gcid-explorer.corp.google.com/static/gcid.html).
251
+ */
252
+ gcidCategory?: string[] | null;
253
+ /**
254
+ * Optional. Output only. The state of matching to a Google Business Profile. See matchingStateHint for further details if no match is found.
255
+ */
256
+ matchingState?: string | null;
257
+ /**
258
+ * Optional. Output only. The hint of why the matching has failed. This is only set when matchingState=`STORE_MATCHING_STATE_FAILED`. Possible values are: - "`linked-store-not-found`": There aren't any Google Business Profile stores available for matching. - "`store-match-not-found`": The provided `LfpStore` couldn't be matched to any of the connected Google Business Profile stores. Merchant Center account is connected correctly and stores are available on Google Business Profile, but the `LfpStore` location address does not match with Google Business Profile stores' addresses. Update the `LfpStore` address or Google Business Profile store address to match correctly. - "`store-match-unverified`": The provided `LfpStore` couldn't be matched to any of the connected Google Business Profile stores, as the matched Google Business Profile store is unverified. Go through the Google Business Profile verification process to match correctly.
259
+ */
260
+ matchingStateHint?: string | null;
261
+ /**
262
+ * Output only. Identifier. The name of the `LfpStore` resource. Format: `accounts/{account\}/lfpStores/{target_merchant\}~{store_code\}`
263
+ */
264
+ name?: string | null;
265
+ /**
266
+ * Optional. The store phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. Example: `+15556767888`
267
+ */
268
+ phoneNumber?: string | null;
269
+ /**
270
+ * Optional. The [Google Place Id](https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview) of the store location.
271
+ */
272
+ placeId?: string | null;
273
+ /**
274
+ * Required. The street address of the store. Example: 1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA.
275
+ */
276
+ storeAddress?: string | null;
277
+ /**
278
+ * Required. Immutable. A store identifier that is unique for the target merchant.
279
+ */
280
+ storeCode?: string | null;
281
+ /**
282
+ * Optional. The merchant or store name.
283
+ */
284
+ storeName?: string | null;
285
+ /**
286
+ * Required. The Merchant Center id of the merchant to submit the store for.
287
+ */
288
+ targetAccount?: string | null;
289
+ /**
290
+ * Optional. The website URL for the store or merchant.
291
+ */
292
+ websiteUri?: string | null;
293
+ }
294
+ /**
295
+ * Response message for the ListLfpStores method.
296
+ */
297
+ export interface Schema$ListLfpStoresResponse {
298
+ /**
299
+ * The stores from the specified merchant.
300
+ */
301
+ lfpStores?: Schema$LfpStore[];
302
+ /**
303
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.
304
+ */
305
+ nextPageToken?: string | null;
306
+ }
307
+ /**
308
+ * The price represented as a number and currency.
309
+ */
310
+ export interface Schema$Price {
311
+ /**
312
+ * 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).
313
+ */
314
+ amountMicros?: string | null;
315
+ /**
316
+ * The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217).
317
+ */
318
+ currencyCode?: string | null;
319
+ }
320
+ /**
321
+ * The change that happened to the product including old value, new value, country code as the region code and reporting context.
322
+ */
323
+ export interface Schema$ProductChange {
324
+ /**
325
+ * The new value of the changed resource or attribute.
326
+ */
327
+ newValue?: string | null;
328
+ /**
329
+ * The old value of the changed resource or attribute.
330
+ */
331
+ oldValue?: string | null;
332
+ /**
333
+ * Countries that have the change (if applicable)
334
+ */
335
+ regionCode?: string | null;
336
+ /**
337
+ * Reporting contexts that have the change (if applicable)
338
+ */
339
+ reportingContext?: string | null;
340
+ }
341
+ /**
342
+ * The message that the merchant will receive to notify about product status change event
343
+ */
344
+ export interface Schema$ProductStatusChangeMessage {
345
+ /**
346
+ * The target account that owns the entity that changed. Format : `accounts/{merchant_id\}`
347
+ */
348
+ account?: string | null;
349
+ /**
350
+ * The attribute in the resource that changed, in this case it will be always `Status`.
351
+ */
352
+ attribute?: string | null;
353
+ /**
354
+ * A message to describe the change that happened to the product
355
+ */
356
+ changes?: Schema$ProductChange[];
357
+ /**
358
+ * 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\}`
359
+ */
360
+ managingAccount?: string | null;
361
+ /**
362
+ * The product name. Format: `{product.name=accounts/{account\}/products/{product\}\}`
363
+ */
364
+ resource?: string | null;
365
+ /**
366
+ * The product id.
367
+ */
368
+ resourceId?: string | null;
369
+ /**
370
+ * The resource that changed, in this case it will always be `Product`.
371
+ */
372
+ resourceType?: string | null;
373
+ }
374
+
375
+ export class Resource$Accounts {
376
+ context: APIRequestContext;
377
+ lfpInventories: Resource$Accounts$Lfpinventories;
378
+ lfpSales: Resource$Accounts$Lfpsales;
379
+ lfpStores: Resource$Accounts$Lfpstores;
380
+ constructor(context: APIRequestContext) {
381
+ this.context = context;
382
+ this.lfpInventories = new Resource$Accounts$Lfpinventories(this.context);
383
+ this.lfpSales = new Resource$Accounts$Lfpsales(this.context);
384
+ this.lfpStores = new Resource$Accounts$Lfpstores(this.context);
385
+ }
386
+ }
387
+
388
+ export class Resource$Accounts$Lfpinventories {
389
+ context: APIRequestContext;
390
+ constructor(context: APIRequestContext) {
391
+ this.context = context;
392
+ }
393
+
394
+ /**
395
+ * Inserts a `LfpInventory` resource for the given target merchant account. If the resource already exists, it will be replaced. The inventory automatically expires after 30 days.
396
+ *
397
+ * @param params - Parameters for request
398
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
399
+ * @param callback - Optional callback that handles the response.
400
+ * @returns A promise if used with async/await, or void if used with a callback.
401
+ */
402
+ insert(
403
+ params: Params$Resource$Accounts$Lfpinventories$Insert,
404
+ options: StreamMethodOptions
405
+ ): GaxiosPromise<Readable>;
406
+ insert(
407
+ params?: Params$Resource$Accounts$Lfpinventories$Insert,
408
+ options?: MethodOptions
409
+ ): GaxiosPromise<Schema$LfpInventory>;
410
+ insert(
411
+ params: Params$Resource$Accounts$Lfpinventories$Insert,
412
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
413
+ callback: BodyResponseCallback<Readable>
414
+ ): void;
415
+ insert(
416
+ params: Params$Resource$Accounts$Lfpinventories$Insert,
417
+ options: MethodOptions | BodyResponseCallback<Schema$LfpInventory>,
418
+ callback: BodyResponseCallback<Schema$LfpInventory>
419
+ ): void;
420
+ insert(
421
+ params: Params$Resource$Accounts$Lfpinventories$Insert,
422
+ callback: BodyResponseCallback<Schema$LfpInventory>
423
+ ): void;
424
+ insert(callback: BodyResponseCallback<Schema$LfpInventory>): void;
425
+ insert(
426
+ paramsOrCallback?:
427
+ | Params$Resource$Accounts$Lfpinventories$Insert
428
+ | BodyResponseCallback<Schema$LfpInventory>
429
+ | BodyResponseCallback<Readable>,
430
+ optionsOrCallback?:
431
+ | MethodOptions
432
+ | StreamMethodOptions
433
+ | BodyResponseCallback<Schema$LfpInventory>
434
+ | BodyResponseCallback<Readable>,
435
+ callback?:
436
+ | BodyResponseCallback<Schema$LfpInventory>
437
+ | BodyResponseCallback<Readable>
438
+ ): void | GaxiosPromise<Schema$LfpInventory> | GaxiosPromise<Readable> {
439
+ let params = (paramsOrCallback ||
440
+ {}) as Params$Resource$Accounts$Lfpinventories$Insert;
441
+ let options = (optionsOrCallback || {}) as MethodOptions;
442
+
443
+ if (typeof paramsOrCallback === 'function') {
444
+ callback = paramsOrCallback;
445
+ params = {} as Params$Resource$Accounts$Lfpinventories$Insert;
446
+ options = {};
447
+ }
448
+
449
+ if (typeof optionsOrCallback === 'function') {
450
+ callback = optionsOrCallback;
451
+ options = {};
452
+ }
453
+
454
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
455
+ const parameters = {
456
+ options: Object.assign(
457
+ {
458
+ url: (
459
+ rootUrl + '/lfp/v1beta/{+parent}/lfpInventories:insert'
460
+ ).replace(/([^:]\/)\/+/g, '$1'),
461
+ method: 'POST',
462
+ apiVersion: '',
463
+ },
464
+ options
465
+ ),
466
+ params,
467
+ requiredParams: ['parent'],
468
+ pathParams: ['parent'],
469
+ context: this.context,
470
+ };
471
+ if (callback) {
472
+ createAPIRequest<Schema$LfpInventory>(
473
+ parameters,
474
+ callback as BodyResponseCallback<unknown>
475
+ );
476
+ } else {
477
+ return createAPIRequest<Schema$LfpInventory>(parameters);
478
+ }
479
+ }
480
+ }
481
+
482
+ export interface Params$Resource$Accounts$Lfpinventories$Insert
483
+ extends StandardParameters {
484
+ /**
485
+ * Required. The LFP provider account. Format: `accounts/{account\}`
486
+ */
487
+ parent?: string;
488
+
489
+ /**
490
+ * Request body metadata
491
+ */
492
+ requestBody?: Schema$LfpInventory;
493
+ }
494
+
495
+ export class Resource$Accounts$Lfpsales {
496
+ context: APIRequestContext;
497
+ constructor(context: APIRequestContext) {
498
+ this.context = context;
499
+ }
500
+
501
+ /**
502
+ * Inserts a `LfpSale` for the given merchant.
503
+ *
504
+ * @param params - Parameters for request
505
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
506
+ * @param callback - Optional callback that handles the response.
507
+ * @returns A promise if used with async/await, or void if used with a callback.
508
+ */
509
+ insert(
510
+ params: Params$Resource$Accounts$Lfpsales$Insert,
511
+ options: StreamMethodOptions
512
+ ): GaxiosPromise<Readable>;
513
+ insert(
514
+ params?: Params$Resource$Accounts$Lfpsales$Insert,
515
+ options?: MethodOptions
516
+ ): GaxiosPromise<Schema$LfpSale>;
517
+ insert(
518
+ params: Params$Resource$Accounts$Lfpsales$Insert,
519
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
520
+ callback: BodyResponseCallback<Readable>
521
+ ): void;
522
+ insert(
523
+ params: Params$Resource$Accounts$Lfpsales$Insert,
524
+ options: MethodOptions | BodyResponseCallback<Schema$LfpSale>,
525
+ callback: BodyResponseCallback<Schema$LfpSale>
526
+ ): void;
527
+ insert(
528
+ params: Params$Resource$Accounts$Lfpsales$Insert,
529
+ callback: BodyResponseCallback<Schema$LfpSale>
530
+ ): void;
531
+ insert(callback: BodyResponseCallback<Schema$LfpSale>): void;
532
+ insert(
533
+ paramsOrCallback?:
534
+ | Params$Resource$Accounts$Lfpsales$Insert
535
+ | BodyResponseCallback<Schema$LfpSale>
536
+ | BodyResponseCallback<Readable>,
537
+ optionsOrCallback?:
538
+ | MethodOptions
539
+ | StreamMethodOptions
540
+ | BodyResponseCallback<Schema$LfpSale>
541
+ | BodyResponseCallback<Readable>,
542
+ callback?:
543
+ | BodyResponseCallback<Schema$LfpSale>
544
+ | BodyResponseCallback<Readable>
545
+ ): void | GaxiosPromise<Schema$LfpSale> | GaxiosPromise<Readable> {
546
+ let params = (paramsOrCallback ||
547
+ {}) as Params$Resource$Accounts$Lfpsales$Insert;
548
+ let options = (optionsOrCallback || {}) as MethodOptions;
549
+
550
+ if (typeof paramsOrCallback === 'function') {
551
+ callback = paramsOrCallback;
552
+ params = {} as Params$Resource$Accounts$Lfpsales$Insert;
553
+ options = {};
554
+ }
555
+
556
+ if (typeof optionsOrCallback === 'function') {
557
+ callback = optionsOrCallback;
558
+ options = {};
559
+ }
560
+
561
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
562
+ const parameters = {
563
+ options: Object.assign(
564
+ {
565
+ url: (rootUrl + '/lfp/v1beta/{+parent}/lfpSales:insert').replace(
566
+ /([^:]\/)\/+/g,
567
+ '$1'
568
+ ),
569
+ method: 'POST',
570
+ apiVersion: '',
571
+ },
572
+ options
573
+ ),
574
+ params,
575
+ requiredParams: ['parent'],
576
+ pathParams: ['parent'],
577
+ context: this.context,
578
+ };
579
+ if (callback) {
580
+ createAPIRequest<Schema$LfpSale>(
581
+ parameters,
582
+ callback as BodyResponseCallback<unknown>
583
+ );
584
+ } else {
585
+ return createAPIRequest<Schema$LfpSale>(parameters);
586
+ }
587
+ }
588
+ }
589
+
590
+ export interface Params$Resource$Accounts$Lfpsales$Insert
591
+ extends StandardParameters {
592
+ /**
593
+ * Required. The LFP provider account. Format: `accounts/{lfp_partner\}`
594
+ */
595
+ parent?: string;
596
+
597
+ /**
598
+ * Request body metadata
599
+ */
600
+ requestBody?: Schema$LfpSale;
601
+ }
602
+
603
+ export class Resource$Accounts$Lfpstores {
604
+ context: APIRequestContext;
605
+ constructor(context: APIRequestContext) {
606
+ this.context = context;
607
+ }
608
+
609
+ /**
610
+ * Deletes a store for a target merchant.
611
+ *
612
+ * @param params - Parameters for request
613
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
614
+ * @param callback - Optional callback that handles the response.
615
+ * @returns A promise if used with async/await, or void if used with a callback.
616
+ */
617
+ delete(
618
+ params: Params$Resource$Accounts$Lfpstores$Delete,
619
+ options: StreamMethodOptions
620
+ ): GaxiosPromise<Readable>;
621
+ delete(
622
+ params?: Params$Resource$Accounts$Lfpstores$Delete,
623
+ options?: MethodOptions
624
+ ): GaxiosPromise<Schema$Empty>;
625
+ delete(
626
+ params: Params$Resource$Accounts$Lfpstores$Delete,
627
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
628
+ callback: BodyResponseCallback<Readable>
629
+ ): void;
630
+ delete(
631
+ params: Params$Resource$Accounts$Lfpstores$Delete,
632
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
633
+ callback: BodyResponseCallback<Schema$Empty>
634
+ ): void;
635
+ delete(
636
+ params: Params$Resource$Accounts$Lfpstores$Delete,
637
+ callback: BodyResponseCallback<Schema$Empty>
638
+ ): void;
639
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
640
+ delete(
641
+ paramsOrCallback?:
642
+ | Params$Resource$Accounts$Lfpstores$Delete
643
+ | BodyResponseCallback<Schema$Empty>
644
+ | BodyResponseCallback<Readable>,
645
+ optionsOrCallback?:
646
+ | MethodOptions
647
+ | StreamMethodOptions
648
+ | BodyResponseCallback<Schema$Empty>
649
+ | BodyResponseCallback<Readable>,
650
+ callback?:
651
+ | BodyResponseCallback<Schema$Empty>
652
+ | BodyResponseCallback<Readable>
653
+ ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
654
+ let params = (paramsOrCallback ||
655
+ {}) as Params$Resource$Accounts$Lfpstores$Delete;
656
+ let options = (optionsOrCallback || {}) as MethodOptions;
657
+
658
+ if (typeof paramsOrCallback === 'function') {
659
+ callback = paramsOrCallback;
660
+ params = {} as Params$Resource$Accounts$Lfpstores$Delete;
661
+ options = {};
662
+ }
663
+
664
+ if (typeof optionsOrCallback === 'function') {
665
+ callback = optionsOrCallback;
666
+ options = {};
667
+ }
668
+
669
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
670
+ const parameters = {
671
+ options: Object.assign(
672
+ {
673
+ url: (rootUrl + '/lfp/v1beta/{+name}').replace(
674
+ /([^:]\/)\/+/g,
675
+ '$1'
676
+ ),
677
+ method: 'DELETE',
678
+ apiVersion: '',
679
+ },
680
+ options
681
+ ),
682
+ params,
683
+ requiredParams: ['name'],
684
+ pathParams: ['name'],
685
+ context: this.context,
686
+ };
687
+ if (callback) {
688
+ createAPIRequest<Schema$Empty>(
689
+ parameters,
690
+ callback as BodyResponseCallback<unknown>
691
+ );
692
+ } else {
693
+ return createAPIRequest<Schema$Empty>(parameters);
694
+ }
695
+ }
696
+
697
+ /**
698
+ * Retrieves information about a store.
699
+ *
700
+ * @param params - Parameters for request
701
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
702
+ * @param callback - Optional callback that handles the response.
703
+ * @returns A promise if used with async/await, or void if used with a callback.
704
+ */
705
+ get(
706
+ params: Params$Resource$Accounts$Lfpstores$Get,
707
+ options: StreamMethodOptions
708
+ ): GaxiosPromise<Readable>;
709
+ get(
710
+ params?: Params$Resource$Accounts$Lfpstores$Get,
711
+ options?: MethodOptions
712
+ ): GaxiosPromise<Schema$LfpStore>;
713
+ get(
714
+ params: Params$Resource$Accounts$Lfpstores$Get,
715
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
716
+ callback: BodyResponseCallback<Readable>
717
+ ): void;
718
+ get(
719
+ params: Params$Resource$Accounts$Lfpstores$Get,
720
+ options: MethodOptions | BodyResponseCallback<Schema$LfpStore>,
721
+ callback: BodyResponseCallback<Schema$LfpStore>
722
+ ): void;
723
+ get(
724
+ params: Params$Resource$Accounts$Lfpstores$Get,
725
+ callback: BodyResponseCallback<Schema$LfpStore>
726
+ ): void;
727
+ get(callback: BodyResponseCallback<Schema$LfpStore>): void;
728
+ get(
729
+ paramsOrCallback?:
730
+ | Params$Resource$Accounts$Lfpstores$Get
731
+ | BodyResponseCallback<Schema$LfpStore>
732
+ | BodyResponseCallback<Readable>,
733
+ optionsOrCallback?:
734
+ | MethodOptions
735
+ | StreamMethodOptions
736
+ | BodyResponseCallback<Schema$LfpStore>
737
+ | BodyResponseCallback<Readable>,
738
+ callback?:
739
+ | BodyResponseCallback<Schema$LfpStore>
740
+ | BodyResponseCallback<Readable>
741
+ ): void | GaxiosPromise<Schema$LfpStore> | GaxiosPromise<Readable> {
742
+ let params = (paramsOrCallback ||
743
+ {}) as Params$Resource$Accounts$Lfpstores$Get;
744
+ let options = (optionsOrCallback || {}) as MethodOptions;
745
+
746
+ if (typeof paramsOrCallback === 'function') {
747
+ callback = paramsOrCallback;
748
+ params = {} as Params$Resource$Accounts$Lfpstores$Get;
749
+ options = {};
750
+ }
751
+
752
+ if (typeof optionsOrCallback === 'function') {
753
+ callback = optionsOrCallback;
754
+ options = {};
755
+ }
756
+
757
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
758
+ const parameters = {
759
+ options: Object.assign(
760
+ {
761
+ url: (rootUrl + '/lfp/v1beta/{+name}').replace(
762
+ /([^:]\/)\/+/g,
763
+ '$1'
764
+ ),
765
+ method: 'GET',
766
+ apiVersion: '',
767
+ },
768
+ options
769
+ ),
770
+ params,
771
+ requiredParams: ['name'],
772
+ pathParams: ['name'],
773
+ context: this.context,
774
+ };
775
+ if (callback) {
776
+ createAPIRequest<Schema$LfpStore>(
777
+ parameters,
778
+ callback as BodyResponseCallback<unknown>
779
+ );
780
+ } else {
781
+ return createAPIRequest<Schema$LfpStore>(parameters);
782
+ }
783
+ }
784
+
785
+ /**
786
+ * Inserts a store for the target merchant. If the store with the same store code already exists, it will be replaced.
787
+ *
788
+ * @param params - Parameters for request
789
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
790
+ * @param callback - Optional callback that handles the response.
791
+ * @returns A promise if used with async/await, or void if used with a callback.
792
+ */
793
+ insert(
794
+ params: Params$Resource$Accounts$Lfpstores$Insert,
795
+ options: StreamMethodOptions
796
+ ): GaxiosPromise<Readable>;
797
+ insert(
798
+ params?: Params$Resource$Accounts$Lfpstores$Insert,
799
+ options?: MethodOptions
800
+ ): GaxiosPromise<Schema$LfpStore>;
801
+ insert(
802
+ params: Params$Resource$Accounts$Lfpstores$Insert,
803
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
804
+ callback: BodyResponseCallback<Readable>
805
+ ): void;
806
+ insert(
807
+ params: Params$Resource$Accounts$Lfpstores$Insert,
808
+ options: MethodOptions | BodyResponseCallback<Schema$LfpStore>,
809
+ callback: BodyResponseCallback<Schema$LfpStore>
810
+ ): void;
811
+ insert(
812
+ params: Params$Resource$Accounts$Lfpstores$Insert,
813
+ callback: BodyResponseCallback<Schema$LfpStore>
814
+ ): void;
815
+ insert(callback: BodyResponseCallback<Schema$LfpStore>): void;
816
+ insert(
817
+ paramsOrCallback?:
818
+ | Params$Resource$Accounts$Lfpstores$Insert
819
+ | BodyResponseCallback<Schema$LfpStore>
820
+ | BodyResponseCallback<Readable>,
821
+ optionsOrCallback?:
822
+ | MethodOptions
823
+ | StreamMethodOptions
824
+ | BodyResponseCallback<Schema$LfpStore>
825
+ | BodyResponseCallback<Readable>,
826
+ callback?:
827
+ | BodyResponseCallback<Schema$LfpStore>
828
+ | BodyResponseCallback<Readable>
829
+ ): void | GaxiosPromise<Schema$LfpStore> | GaxiosPromise<Readable> {
830
+ let params = (paramsOrCallback ||
831
+ {}) as Params$Resource$Accounts$Lfpstores$Insert;
832
+ let options = (optionsOrCallback || {}) as MethodOptions;
833
+
834
+ if (typeof paramsOrCallback === 'function') {
835
+ callback = paramsOrCallback;
836
+ params = {} as Params$Resource$Accounts$Lfpstores$Insert;
837
+ options = {};
838
+ }
839
+
840
+ if (typeof optionsOrCallback === 'function') {
841
+ callback = optionsOrCallback;
842
+ options = {};
843
+ }
844
+
845
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
846
+ const parameters = {
847
+ options: Object.assign(
848
+ {
849
+ url: (rootUrl + '/lfp/v1beta/{+parent}/lfpStores:insert').replace(
850
+ /([^:]\/)\/+/g,
851
+ '$1'
852
+ ),
853
+ method: 'POST',
854
+ apiVersion: '',
855
+ },
856
+ options
857
+ ),
858
+ params,
859
+ requiredParams: ['parent'],
860
+ pathParams: ['parent'],
861
+ context: this.context,
862
+ };
863
+ if (callback) {
864
+ createAPIRequest<Schema$LfpStore>(
865
+ parameters,
866
+ callback as BodyResponseCallback<unknown>
867
+ );
868
+ } else {
869
+ return createAPIRequest<Schema$LfpStore>(parameters);
870
+ }
871
+ }
872
+
873
+ /**
874
+ * Lists the stores of the target merchant, specified by the filter in `ListLfpStoresRequest`.
875
+ *
876
+ * @param params - Parameters for request
877
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
878
+ * @param callback - Optional callback that handles the response.
879
+ * @returns A promise if used with async/await, or void if used with a callback.
880
+ */
881
+ list(
882
+ params: Params$Resource$Accounts$Lfpstores$List,
883
+ options: StreamMethodOptions
884
+ ): GaxiosPromise<Readable>;
885
+ list(
886
+ params?: Params$Resource$Accounts$Lfpstores$List,
887
+ options?: MethodOptions
888
+ ): GaxiosPromise<Schema$ListLfpStoresResponse>;
889
+ list(
890
+ params: Params$Resource$Accounts$Lfpstores$List,
891
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
892
+ callback: BodyResponseCallback<Readable>
893
+ ): void;
894
+ list(
895
+ params: Params$Resource$Accounts$Lfpstores$List,
896
+ options:
897
+ | MethodOptions
898
+ | BodyResponseCallback<Schema$ListLfpStoresResponse>,
899
+ callback: BodyResponseCallback<Schema$ListLfpStoresResponse>
900
+ ): void;
901
+ list(
902
+ params: Params$Resource$Accounts$Lfpstores$List,
903
+ callback: BodyResponseCallback<Schema$ListLfpStoresResponse>
904
+ ): void;
905
+ list(callback: BodyResponseCallback<Schema$ListLfpStoresResponse>): void;
906
+ list(
907
+ paramsOrCallback?:
908
+ | Params$Resource$Accounts$Lfpstores$List
909
+ | BodyResponseCallback<Schema$ListLfpStoresResponse>
910
+ | BodyResponseCallback<Readable>,
911
+ optionsOrCallback?:
912
+ | MethodOptions
913
+ | StreamMethodOptions
914
+ | BodyResponseCallback<Schema$ListLfpStoresResponse>
915
+ | BodyResponseCallback<Readable>,
916
+ callback?:
917
+ | BodyResponseCallback<Schema$ListLfpStoresResponse>
918
+ | BodyResponseCallback<Readable>
919
+ ):
920
+ | void
921
+ | GaxiosPromise<Schema$ListLfpStoresResponse>
922
+ | GaxiosPromise<Readable> {
923
+ let params = (paramsOrCallback ||
924
+ {}) as Params$Resource$Accounts$Lfpstores$List;
925
+ let options = (optionsOrCallback || {}) as MethodOptions;
926
+
927
+ if (typeof paramsOrCallback === 'function') {
928
+ callback = paramsOrCallback;
929
+ params = {} as Params$Resource$Accounts$Lfpstores$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: (rootUrl + '/lfp/v1beta/{+parent}/lfpStores').replace(
943
+ /([^:]\/)\/+/g,
944
+ '$1'
945
+ ),
946
+ method: 'GET',
947
+ apiVersion: '',
948
+ },
949
+ options
950
+ ),
951
+ params,
952
+ requiredParams: ['parent'],
953
+ pathParams: ['parent'],
954
+ context: this.context,
955
+ };
956
+ if (callback) {
957
+ createAPIRequest<Schema$ListLfpStoresResponse>(
958
+ parameters,
959
+ callback as BodyResponseCallback<unknown>
960
+ );
961
+ } else {
962
+ return createAPIRequest<Schema$ListLfpStoresResponse>(parameters);
963
+ }
964
+ }
965
+ }
966
+
967
+ export interface Params$Resource$Accounts$Lfpstores$Delete
968
+ extends StandardParameters {
969
+ /**
970
+ * Required. The name of the store to delete for the target merchant account. Format: `accounts/{account\}/lfpStores/{target_merchant\}~{store_code\}`
971
+ */
972
+ name?: string;
973
+ }
974
+ export interface Params$Resource$Accounts$Lfpstores$Get
975
+ extends StandardParameters {
976
+ /**
977
+ * Required. The name of the store to retrieve. Format: `accounts/{account\}/lfpStores/{target_merchant\}~{store_code\}`
978
+ */
979
+ name?: string;
980
+ }
981
+ export interface Params$Resource$Accounts$Lfpstores$Insert
982
+ extends StandardParameters {
983
+ /**
984
+ * Required. The LFP provider account Format: `accounts/{account\}`
985
+ */
986
+ parent?: string;
987
+
988
+ /**
989
+ * Request body metadata
990
+ */
991
+ requestBody?: Schema$LfpStore;
992
+ }
993
+ export interface Params$Resource$Accounts$Lfpstores$List
994
+ extends StandardParameters {
995
+ /**
996
+ * Optional. The maximum number of `LfpStore` resources for the given account to return. The service returns fewer than this value if the number of stores for the given account is less than the `pageSize`. The default value is 250. The maximum value is 1000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum.
997
+ */
998
+ pageSize?: number;
999
+ /**
1000
+ * Optional. A page token, received from a previous `ListLfpStoresRequest` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListLfpStoresRequest` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.
1001
+ */
1002
+ pageToken?: string;
1003
+ /**
1004
+ * Required. The LFP partner. Format: `accounts/{account\}`
1005
+ */
1006
+ parent?: string;
1007
+ /**
1008
+ * Required. The Merchant Center id of the merchant to list stores for.
1009
+ */
1010
+ targetAccount?: string;
1011
+ }
1012
+ }