@googleapis/merchantapi 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +28 -0
  3. package/accounts_v1beta.ts +5692 -0
  4. package/build/accounts_v1beta.d.ts +2492 -0
  5. package/build/accounts_v1beta.js +1421 -0
  6. package/build/accounts_v1beta.js.map +1 -0
  7. package/build/conversions_v1beta.d.ts +406 -0
  8. package/build/conversions_v1beta.js +251 -0
  9. package/build/conversions_v1beta.js.map +1 -0
  10. package/build/datasources_v1beta.d.ts +502 -0
  11. package/build/datasources_v1beta.js +251 -0
  12. package/build/datasources_v1beta.js.map +1 -0
  13. package/build/index.d.ts +57 -0
  14. package/build/index.js +58 -0
  15. package/build/index.js.map +1 -0
  16. package/build/inventories_v1beta.d.ts +456 -0
  17. package/build/inventories_v1beta.js +272 -0
  18. package/build/inventories_v1beta.js.map +1 -0
  19. package/build/lfp_v1beta.d.ts +486 -0
  20. package/build/lfp_v1beta.js +265 -0
  21. package/build/lfp_v1beta.js.map +1 -0
  22. package/build/notifications_v1beta.d.ts +301 -0
  23. package/build/notifications_v1beta.js +224 -0
  24. package/build/notifications_v1beta.js.map +1 -0
  25. package/build/products_v1beta.d.ts +1204 -0
  26. package/build/products_v1beta.js +194 -0
  27. package/build/products_v1beta.js.map +1 -0
  28. package/build/promotions_v1beta.d.ts +524 -0
  29. package/build/promotions_v1beta.js +155 -0
  30. package/build/promotions_v1beta.js.map +1 -0
  31. package/build/quota_v1beta.d.ts +225 -0
  32. package/build/quota_v1beta.js +91 -0
  33. package/build/quota_v1beta.js.map +1 -0
  34. package/build/reports_v1beta.d.ts +1001 -0
  35. package/build/reports_v1beta.js +91 -0
  36. package/build/reports_v1beta.js.map +1 -0
  37. package/conversions_v1beta.ts +926 -0
  38. package/datasources_v1beta.ts +1016 -0
  39. package/index.ts +161 -0
  40. package/inventories_v1beta.ts +1002 -0
  41. package/lfp_v1beta.ts +1012 -0
  42. package/notifications_v1beta.ts +768 -0
  43. package/package.json +43 -0
  44. package/products_v1beta.ts +1573 -0
  45. package/promotions_v1beta.ts +814 -0
  46. package/quota_v1beta.ts +365 -0
  47. package/reports_v1beta.ts +1137 -0
  48. package/tsconfig.json +10 -0
  49. package/webpack.config.js +79 -0
@@ -0,0 +1,768 @@
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_notifications_v1beta {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'notifications_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('notifications_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
+ * Response message for the ListNotificationSubscription method.
133
+ */
134
+ export interface Schema$ListNotificationSubscriptionsResponse {
135
+ /**
136
+ * A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
137
+ */
138
+ nextPageToken?: string | null;
139
+ /**
140
+ * The list of notification subscriptions requested by the merchant.
141
+ */
142
+ notificationSubscriptions?: Schema$NotificationSubscription[];
143
+ }
144
+ /**
145
+ * Represents a notification subscription owned by a Merchant account.
146
+ */
147
+ export interface Schema$NotificationSubscription {
148
+ /**
149
+ * If this value is true, the requesting account is notified of the specified event for all managed accounts (can be subaccounts or other linked accounts) including newly added accounts on a daily basis.
150
+ */
151
+ allManagedAccounts?: boolean | null;
152
+ /**
153
+ * URL to be used to push the notification to the merchant.
154
+ */
155
+ callBackUri?: string | null;
156
+ /**
157
+ * Output only. The `name` of the notification configuration. Generated by the Content API upon creation of a new `NotificationSubscription`. The `account` represents the merchant ID of the merchant that owns the configuration. Format: `accounts/{account\}/notificationsubscriptions/{notification_subscription\}`
158
+ */
159
+ name?: string | null;
160
+ /**
161
+ * The event that the merchant wants to be notified about.
162
+ */
163
+ registeredEvent?: string | null;
164
+ /**
165
+ * The `name` of the account you want to receive notifications for. Format: `accounts/{account\}`
166
+ */
167
+ targetAccount?: string | null;
168
+ }
169
+ /**
170
+ * The change that happened to the product including old value, new value, country code as the region code and reporting context.
171
+ */
172
+ export interface Schema$ProductChange {
173
+ /**
174
+ * The new value of the changed resource or attribute.
175
+ */
176
+ newValue?: string | null;
177
+ /**
178
+ * The old value of the changed resource or attribute.
179
+ */
180
+ oldValue?: string | null;
181
+ /**
182
+ * Countries that have the change (if applicable)
183
+ */
184
+ regionCode?: string | null;
185
+ /**
186
+ * Reporting contexts that have the change (if applicable)
187
+ */
188
+ reportingContext?: string | null;
189
+ }
190
+ /**
191
+ * The message that the merchant will receive to notify about product status change event
192
+ */
193
+ export interface Schema$ProductStatusChangeMessage {
194
+ /**
195
+ * The target account that owns the entity that changed. Format : `accounts/{merchant_id\}`
196
+ */
197
+ account?: string | null;
198
+ /**
199
+ * The attribute in the resource that changed, in this case it will be always `Status`.
200
+ */
201
+ attribute?: string | null;
202
+ /**
203
+ * A message to describe the change that happened to the product
204
+ */
205
+ changes?: Schema$ProductChange[];
206
+ /**
207
+ * 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\}`
208
+ */
209
+ managingAccount?: string | null;
210
+ /**
211
+ * The product name. Format: `{product.name=accounts/{account\}/products/{product\}\}`
212
+ */
213
+ resource?: string | null;
214
+ /**
215
+ * The product id.
216
+ */
217
+ resourceId?: string | null;
218
+ /**
219
+ * The resource that changed, in this case it will always be `Product`.
220
+ */
221
+ resourceType?: string | null;
222
+ }
223
+
224
+ export class Resource$Accounts {
225
+ context: APIRequestContext;
226
+ notificationsubscriptions: Resource$Accounts$Notificationsubscriptions;
227
+ constructor(context: APIRequestContext) {
228
+ this.context = context;
229
+ this.notificationsubscriptions =
230
+ new Resource$Accounts$Notificationsubscriptions(this.context);
231
+ }
232
+ }
233
+
234
+ export class Resource$Accounts$Notificationsubscriptions {
235
+ context: APIRequestContext;
236
+ constructor(context: APIRequestContext) {
237
+ this.context = context;
238
+ }
239
+
240
+ /**
241
+ * Creates a notification subscription for a merchant. We will allow the following types of notification subscriptions to exist together (per merchant as a subscriber per event type): 1. Subscription for all managed accounts + subscription for self 2. Multiple "partial" subscriptions for managed accounts + subscription for self we will not allow (per merchant as a subscriber per event type): 1. multiple self subscriptions. 2. multiple "all managed accounts" subscriptions. 3. all and partial subscriptions at the same time. 4. multiple partial subscriptions for the same target account
242
+ *
243
+ * @param params - Parameters for request
244
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
245
+ * @param callback - Optional callback that handles the response.
246
+ * @returns A promise if used with async/await, or void if used with a callback.
247
+ */
248
+ create(
249
+ params: Params$Resource$Accounts$Notificationsubscriptions$Create,
250
+ options: StreamMethodOptions
251
+ ): GaxiosPromise<Readable>;
252
+ create(
253
+ params?: Params$Resource$Accounts$Notificationsubscriptions$Create,
254
+ options?: MethodOptions
255
+ ): GaxiosPromise<Schema$NotificationSubscription>;
256
+ create(
257
+ params: Params$Resource$Accounts$Notificationsubscriptions$Create,
258
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
259
+ callback: BodyResponseCallback<Readable>
260
+ ): void;
261
+ create(
262
+ params: Params$Resource$Accounts$Notificationsubscriptions$Create,
263
+ options:
264
+ | MethodOptions
265
+ | BodyResponseCallback<Schema$NotificationSubscription>,
266
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
267
+ ): void;
268
+ create(
269
+ params: Params$Resource$Accounts$Notificationsubscriptions$Create,
270
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
271
+ ): void;
272
+ create(
273
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
274
+ ): void;
275
+ create(
276
+ paramsOrCallback?:
277
+ | Params$Resource$Accounts$Notificationsubscriptions$Create
278
+ | BodyResponseCallback<Schema$NotificationSubscription>
279
+ | BodyResponseCallback<Readable>,
280
+ optionsOrCallback?:
281
+ | MethodOptions
282
+ | StreamMethodOptions
283
+ | BodyResponseCallback<Schema$NotificationSubscription>
284
+ | BodyResponseCallback<Readable>,
285
+ callback?:
286
+ | BodyResponseCallback<Schema$NotificationSubscription>
287
+ | BodyResponseCallback<Readable>
288
+ ):
289
+ | void
290
+ | GaxiosPromise<Schema$NotificationSubscription>
291
+ | GaxiosPromise<Readable> {
292
+ let params = (paramsOrCallback ||
293
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$Create;
294
+ let options = (optionsOrCallback || {}) as MethodOptions;
295
+
296
+ if (typeof paramsOrCallback === 'function') {
297
+ callback = paramsOrCallback;
298
+ params =
299
+ {} as Params$Resource$Accounts$Notificationsubscriptions$Create;
300
+ options = {};
301
+ }
302
+
303
+ if (typeof optionsOrCallback === 'function') {
304
+ callback = optionsOrCallback;
305
+ options = {};
306
+ }
307
+
308
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
309
+ const parameters = {
310
+ options: Object.assign(
311
+ {
312
+ url: (
313
+ rootUrl +
314
+ '/notifications/v1beta/{+parent}/notificationsubscriptions'
315
+ ).replace(/([^:]\/)\/+/g, '$1'),
316
+ method: 'POST',
317
+ apiVersion: '',
318
+ },
319
+ options
320
+ ),
321
+ params,
322
+ requiredParams: ['parent'],
323
+ pathParams: ['parent'],
324
+ context: this.context,
325
+ };
326
+ if (callback) {
327
+ createAPIRequest<Schema$NotificationSubscription>(
328
+ parameters,
329
+ callback as BodyResponseCallback<unknown>
330
+ );
331
+ } else {
332
+ return createAPIRequest<Schema$NotificationSubscription>(parameters);
333
+ }
334
+ }
335
+
336
+ /**
337
+ * Deletes a notification subscription for a merchant.
338
+ *
339
+ * @param params - Parameters for request
340
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
341
+ * @param callback - Optional callback that handles the response.
342
+ * @returns A promise if used with async/await, or void if used with a callback.
343
+ */
344
+ delete(
345
+ params: Params$Resource$Accounts$Notificationsubscriptions$Delete,
346
+ options: StreamMethodOptions
347
+ ): GaxiosPromise<Readable>;
348
+ delete(
349
+ params?: Params$Resource$Accounts$Notificationsubscriptions$Delete,
350
+ options?: MethodOptions
351
+ ): GaxiosPromise<Schema$Empty>;
352
+ delete(
353
+ params: Params$Resource$Accounts$Notificationsubscriptions$Delete,
354
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
355
+ callback: BodyResponseCallback<Readable>
356
+ ): void;
357
+ delete(
358
+ params: Params$Resource$Accounts$Notificationsubscriptions$Delete,
359
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
360
+ callback: BodyResponseCallback<Schema$Empty>
361
+ ): void;
362
+ delete(
363
+ params: Params$Resource$Accounts$Notificationsubscriptions$Delete,
364
+ callback: BodyResponseCallback<Schema$Empty>
365
+ ): void;
366
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
367
+ delete(
368
+ paramsOrCallback?:
369
+ | Params$Resource$Accounts$Notificationsubscriptions$Delete
370
+ | BodyResponseCallback<Schema$Empty>
371
+ | BodyResponseCallback<Readable>,
372
+ optionsOrCallback?:
373
+ | MethodOptions
374
+ | StreamMethodOptions
375
+ | BodyResponseCallback<Schema$Empty>
376
+ | BodyResponseCallback<Readable>,
377
+ callback?:
378
+ | BodyResponseCallback<Schema$Empty>
379
+ | BodyResponseCallback<Readable>
380
+ ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
381
+ let params = (paramsOrCallback ||
382
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$Delete;
383
+ let options = (optionsOrCallback || {}) as MethodOptions;
384
+
385
+ if (typeof paramsOrCallback === 'function') {
386
+ callback = paramsOrCallback;
387
+ params =
388
+ {} as Params$Resource$Accounts$Notificationsubscriptions$Delete;
389
+ options = {};
390
+ }
391
+
392
+ if (typeof optionsOrCallback === 'function') {
393
+ callback = optionsOrCallback;
394
+ options = {};
395
+ }
396
+
397
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
398
+ const parameters = {
399
+ options: Object.assign(
400
+ {
401
+ url: (rootUrl + '/notifications/v1beta/{+name}').replace(
402
+ /([^:]\/)\/+/g,
403
+ '$1'
404
+ ),
405
+ method: 'DELETE',
406
+ apiVersion: '',
407
+ },
408
+ options
409
+ ),
410
+ params,
411
+ requiredParams: ['name'],
412
+ pathParams: ['name'],
413
+ context: this.context,
414
+ };
415
+ if (callback) {
416
+ createAPIRequest<Schema$Empty>(
417
+ parameters,
418
+ callback as BodyResponseCallback<unknown>
419
+ );
420
+ } else {
421
+ return createAPIRequest<Schema$Empty>(parameters);
422
+ }
423
+ }
424
+
425
+ /**
426
+ * Gets notification subscriptions for an account.
427
+ *
428
+ * @param params - Parameters for request
429
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
430
+ * @param callback - Optional callback that handles the response.
431
+ * @returns A promise if used with async/await, or void if used with a callback.
432
+ */
433
+ get(
434
+ params: Params$Resource$Accounts$Notificationsubscriptions$Get,
435
+ options: StreamMethodOptions
436
+ ): GaxiosPromise<Readable>;
437
+ get(
438
+ params?: Params$Resource$Accounts$Notificationsubscriptions$Get,
439
+ options?: MethodOptions
440
+ ): GaxiosPromise<Schema$NotificationSubscription>;
441
+ get(
442
+ params: Params$Resource$Accounts$Notificationsubscriptions$Get,
443
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
444
+ callback: BodyResponseCallback<Readable>
445
+ ): void;
446
+ get(
447
+ params: Params$Resource$Accounts$Notificationsubscriptions$Get,
448
+ options:
449
+ | MethodOptions
450
+ | BodyResponseCallback<Schema$NotificationSubscription>,
451
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
452
+ ): void;
453
+ get(
454
+ params: Params$Resource$Accounts$Notificationsubscriptions$Get,
455
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
456
+ ): void;
457
+ get(callback: BodyResponseCallback<Schema$NotificationSubscription>): void;
458
+ get(
459
+ paramsOrCallback?:
460
+ | Params$Resource$Accounts$Notificationsubscriptions$Get
461
+ | BodyResponseCallback<Schema$NotificationSubscription>
462
+ | BodyResponseCallback<Readable>,
463
+ optionsOrCallback?:
464
+ | MethodOptions
465
+ | StreamMethodOptions
466
+ | BodyResponseCallback<Schema$NotificationSubscription>
467
+ | BodyResponseCallback<Readable>,
468
+ callback?:
469
+ | BodyResponseCallback<Schema$NotificationSubscription>
470
+ | BodyResponseCallback<Readable>
471
+ ):
472
+ | void
473
+ | GaxiosPromise<Schema$NotificationSubscription>
474
+ | GaxiosPromise<Readable> {
475
+ let params = (paramsOrCallback ||
476
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$Get;
477
+ let options = (optionsOrCallback || {}) as MethodOptions;
478
+
479
+ if (typeof paramsOrCallback === 'function') {
480
+ callback = paramsOrCallback;
481
+ params = {} as Params$Resource$Accounts$Notificationsubscriptions$Get;
482
+ options = {};
483
+ }
484
+
485
+ if (typeof optionsOrCallback === 'function') {
486
+ callback = optionsOrCallback;
487
+ options = {};
488
+ }
489
+
490
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
491
+ const parameters = {
492
+ options: Object.assign(
493
+ {
494
+ url: (rootUrl + '/notifications/v1beta/{+name}').replace(
495
+ /([^:]\/)\/+/g,
496
+ '$1'
497
+ ),
498
+ method: 'GET',
499
+ apiVersion: '',
500
+ },
501
+ options
502
+ ),
503
+ params,
504
+ requiredParams: ['name'],
505
+ pathParams: ['name'],
506
+ context: this.context,
507
+ };
508
+ if (callback) {
509
+ createAPIRequest<Schema$NotificationSubscription>(
510
+ parameters,
511
+ callback as BodyResponseCallback<unknown>
512
+ );
513
+ } else {
514
+ return createAPIRequest<Schema$NotificationSubscription>(parameters);
515
+ }
516
+ }
517
+
518
+ /**
519
+ * Gets all the notification subscriptions for a merchant.
520
+ *
521
+ * @param params - Parameters for request
522
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
523
+ * @param callback - Optional callback that handles the response.
524
+ * @returns A promise if used with async/await, or void if used with a callback.
525
+ */
526
+ list(
527
+ params: Params$Resource$Accounts$Notificationsubscriptions$List,
528
+ options: StreamMethodOptions
529
+ ): GaxiosPromise<Readable>;
530
+ list(
531
+ params?: Params$Resource$Accounts$Notificationsubscriptions$List,
532
+ options?: MethodOptions
533
+ ): GaxiosPromise<Schema$ListNotificationSubscriptionsResponse>;
534
+ list(
535
+ params: Params$Resource$Accounts$Notificationsubscriptions$List,
536
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
537
+ callback: BodyResponseCallback<Readable>
538
+ ): void;
539
+ list(
540
+ params: Params$Resource$Accounts$Notificationsubscriptions$List,
541
+ options:
542
+ | MethodOptions
543
+ | BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>,
544
+ callback: BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
545
+ ): void;
546
+ list(
547
+ params: Params$Resource$Accounts$Notificationsubscriptions$List,
548
+ callback: BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
549
+ ): void;
550
+ list(
551
+ callback: BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
552
+ ): void;
553
+ list(
554
+ paramsOrCallback?:
555
+ | Params$Resource$Accounts$Notificationsubscriptions$List
556
+ | BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
557
+ | BodyResponseCallback<Readable>,
558
+ optionsOrCallback?:
559
+ | MethodOptions
560
+ | StreamMethodOptions
561
+ | BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
562
+ | BodyResponseCallback<Readable>,
563
+ callback?:
564
+ | BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
565
+ | BodyResponseCallback<Readable>
566
+ ):
567
+ | void
568
+ | GaxiosPromise<Schema$ListNotificationSubscriptionsResponse>
569
+ | GaxiosPromise<Readable> {
570
+ let params = (paramsOrCallback ||
571
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$List;
572
+ let options = (optionsOrCallback || {}) as MethodOptions;
573
+
574
+ if (typeof paramsOrCallback === 'function') {
575
+ callback = paramsOrCallback;
576
+ params = {} as Params$Resource$Accounts$Notificationsubscriptions$List;
577
+ options = {};
578
+ }
579
+
580
+ if (typeof optionsOrCallback === 'function') {
581
+ callback = optionsOrCallback;
582
+ options = {};
583
+ }
584
+
585
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
586
+ const parameters = {
587
+ options: Object.assign(
588
+ {
589
+ url: (
590
+ rootUrl +
591
+ '/notifications/v1beta/{+parent}/notificationsubscriptions'
592
+ ).replace(/([^:]\/)\/+/g, '$1'),
593
+ method: 'GET',
594
+ apiVersion: '',
595
+ },
596
+ options
597
+ ),
598
+ params,
599
+ requiredParams: ['parent'],
600
+ pathParams: ['parent'],
601
+ context: this.context,
602
+ };
603
+ if (callback) {
604
+ createAPIRequest<Schema$ListNotificationSubscriptionsResponse>(
605
+ parameters,
606
+ callback as BodyResponseCallback<unknown>
607
+ );
608
+ } else {
609
+ return createAPIRequest<Schema$ListNotificationSubscriptionsResponse>(
610
+ parameters
611
+ );
612
+ }
613
+ }
614
+
615
+ /**
616
+ * Updates an existing notification subscription for a merchant.
617
+ *
618
+ * @param params - Parameters for request
619
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
620
+ * @param callback - Optional callback that handles the response.
621
+ * @returns A promise if used with async/await, or void if used with a callback.
622
+ */
623
+ patch(
624
+ params: Params$Resource$Accounts$Notificationsubscriptions$Patch,
625
+ options: StreamMethodOptions
626
+ ): GaxiosPromise<Readable>;
627
+ patch(
628
+ params?: Params$Resource$Accounts$Notificationsubscriptions$Patch,
629
+ options?: MethodOptions
630
+ ): GaxiosPromise<Schema$NotificationSubscription>;
631
+ patch(
632
+ params: Params$Resource$Accounts$Notificationsubscriptions$Patch,
633
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
634
+ callback: BodyResponseCallback<Readable>
635
+ ): void;
636
+ patch(
637
+ params: Params$Resource$Accounts$Notificationsubscriptions$Patch,
638
+ options:
639
+ | MethodOptions
640
+ | BodyResponseCallback<Schema$NotificationSubscription>,
641
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
642
+ ): void;
643
+ patch(
644
+ params: Params$Resource$Accounts$Notificationsubscriptions$Patch,
645
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
646
+ ): void;
647
+ patch(
648
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
649
+ ): void;
650
+ patch(
651
+ paramsOrCallback?:
652
+ | Params$Resource$Accounts$Notificationsubscriptions$Patch
653
+ | BodyResponseCallback<Schema$NotificationSubscription>
654
+ | BodyResponseCallback<Readable>,
655
+ optionsOrCallback?:
656
+ | MethodOptions
657
+ | StreamMethodOptions
658
+ | BodyResponseCallback<Schema$NotificationSubscription>
659
+ | BodyResponseCallback<Readable>,
660
+ callback?:
661
+ | BodyResponseCallback<Schema$NotificationSubscription>
662
+ | BodyResponseCallback<Readable>
663
+ ):
664
+ | void
665
+ | GaxiosPromise<Schema$NotificationSubscription>
666
+ | GaxiosPromise<Readable> {
667
+ let params = (paramsOrCallback ||
668
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$Patch;
669
+ let options = (optionsOrCallback || {}) as MethodOptions;
670
+
671
+ if (typeof paramsOrCallback === 'function') {
672
+ callback = paramsOrCallback;
673
+ params = {} as Params$Resource$Accounts$Notificationsubscriptions$Patch;
674
+ options = {};
675
+ }
676
+
677
+ if (typeof optionsOrCallback === 'function') {
678
+ callback = optionsOrCallback;
679
+ options = {};
680
+ }
681
+
682
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
683
+ const parameters = {
684
+ options: Object.assign(
685
+ {
686
+ url: (rootUrl + '/notifications/v1beta/{+name}').replace(
687
+ /([^:]\/)\/+/g,
688
+ '$1'
689
+ ),
690
+ method: 'PATCH',
691
+ apiVersion: '',
692
+ },
693
+ options
694
+ ),
695
+ params,
696
+ requiredParams: ['name'],
697
+ pathParams: ['name'],
698
+ context: this.context,
699
+ };
700
+ if (callback) {
701
+ createAPIRequest<Schema$NotificationSubscription>(
702
+ parameters,
703
+ callback as BodyResponseCallback<unknown>
704
+ );
705
+ } else {
706
+ return createAPIRequest<Schema$NotificationSubscription>(parameters);
707
+ }
708
+ }
709
+ }
710
+
711
+ export interface Params$Resource$Accounts$Notificationsubscriptions$Create
712
+ extends StandardParameters {
713
+ /**
714
+ * Required. The merchant account that owns the new notification subscription. Format: `accounts/{account\}`
715
+ */
716
+ parent?: string;
717
+
718
+ /**
719
+ * Request body metadata
720
+ */
721
+ requestBody?: Schema$NotificationSubscription;
722
+ }
723
+ export interface Params$Resource$Accounts$Notificationsubscriptions$Delete
724
+ extends StandardParameters {
725
+ /**
726
+ * Required. The name of the notification subscription to be deleted.
727
+ */
728
+ name?: string;
729
+ }
730
+ export interface Params$Resource$Accounts$Notificationsubscriptions$Get
731
+ extends StandardParameters {
732
+ /**
733
+ * Required. The `name` of the notification subscription.
734
+ */
735
+ name?: string;
736
+ }
737
+ export interface Params$Resource$Accounts$Notificationsubscriptions$List
738
+ extends StandardParameters {
739
+ /**
740
+ * The maximum number of notification subscriptions to return in a page. The default value for `page_size` is 100. The maximum value is `200`. Values above `200` will be coerced to `200`.
741
+ */
742
+ pageSize?: number;
743
+ /**
744
+ * Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token.
745
+ */
746
+ pageToken?: string;
747
+ /**
748
+ * Required. The merchant account who owns the notification subscriptions. Format: `accounts/{account\}`
749
+ */
750
+ parent?: string;
751
+ }
752
+ export interface Params$Resource$Accounts$Notificationsubscriptions$Patch
753
+ extends StandardParameters {
754
+ /**
755
+ * Output only. The `name` of the notification configuration. Generated by the Content API upon creation of a new `NotificationSubscription`. The `account` represents the merchant ID of the merchant that owns the configuration. Format: `accounts/{account\}/notificationsubscriptions/{notification_subscription\}`
756
+ */
757
+ name?: string;
758
+ /**
759
+ * List of fields being updated.
760
+ */
761
+ updateMask?: string;
762
+
763
+ /**
764
+ * Request body metadata
765
+ */
766
+ requestBody?: Schema$NotificationSubscription;
767
+ }
768
+ }