@googleapis/merchantapi 10.1.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 (101) hide show
  1. package/CHANGELOG.md +232 -0
  2. package/accounts_v1.ts +13566 -0
  3. package/accounts_v1beta.ts +7 -7
  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 +7 -8
  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 +6 -7
  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 +6 -3
  53. package/build/ordertracking_v1beta.js +8 -3
  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 +13 -14
  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 +5 -6
  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/inventories_v1beta.ts +6 -6
  88. package/issueresolution_v1.ts +1425 -0
  89. package/lfp_v1.ts +1666 -0
  90. package/lfp_v1beta.ts +1 -1
  91. package/notifications_v1.ts +1052 -0
  92. package/ordertracking_v1.ts +599 -0
  93. package/ordertracking_v1beta.ts +8 -4
  94. package/package.json +4 -4
  95. package/products_v1.ts +2013 -0
  96. package/products_v1beta.ts +13 -13
  97. package/promotions_v1.ts +995 -0
  98. package/promotions_v1beta.ts +5 -5
  99. package/quota_v1.ts +424 -0
  100. package/reports_v1.ts +1205 -0
  101. package/reports_v1beta.ts +1 -1
@@ -0,0 +1,1052 @@
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_notifications_v1 {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'notifications_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('notifications_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
+ * 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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)
175
+ */
176
+ newValue?: string | null;
177
+ /**
178
+ * 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`, ``)
179
+ */
180
+ oldValue?: string | null;
181
+ /**
182
+ * Countries that have the change (if applicable). Represented in the ISO 3166 format.
183
+ */
184
+ regionCode?: string | null;
185
+ /**
186
+ * 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)
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 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.
208
+ */
209
+ eventTime?: string | null;
210
+ /**
211
+ * Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.
212
+ */
213
+ expirationTime?: string | null;
214
+ /**
215
+ * 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\}`
216
+ */
217
+ managingAccount?: string | null;
218
+ /**
219
+ * The product name. Format: `accounts/{account\}/products/{product\}`
220
+ */
221
+ resource?: string | null;
222
+ /**
223
+ * The product id.
224
+ */
225
+ resourceId?: string | null;
226
+ /**
227
+ * The resource that changed, in this case it will always be `Product`.
228
+ */
229
+ resourceType?: string | null;
230
+ }
231
+
232
+ export class Resource$Accounts {
233
+ context: APIRequestContext;
234
+ notificationsubscriptions: Resource$Accounts$Notificationsubscriptions;
235
+ constructor(context: APIRequestContext) {
236
+ this.context = context;
237
+ this.notificationsubscriptions =
238
+ new Resource$Accounts$Notificationsubscriptions(this.context);
239
+ }
240
+ }
241
+
242
+ export class Resource$Accounts$Notificationsubscriptions {
243
+ context: APIRequestContext;
244
+ constructor(context: APIRequestContext) {
245
+ this.context = context;
246
+ }
247
+
248
+ /**
249
+ * Creates a notification subscription for a business. For standalone or subaccounts accounts, the business can create a subscription for self. For MCAs, the business can create a subscription for all managed accounts or for a specific subaccount. We will allow the following types of notification subscriptions to exist together (per business 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 business as a subscriber per event type): 1. Multiple self subscriptions. 2. Multiple "all managed accounts" subscriptions. 3. "All managed accounts" subscription and partial subscriptions at the same time. 4. Multiple partial subscriptions for the same target account.
250
+ * @example
251
+ * ```js
252
+ * // Before running the sample:
253
+ * // - Enable the API at:
254
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
255
+ * // - Login into gcloud by running:
256
+ * // ```sh
257
+ * // $ gcloud auth application-default login
258
+ * // ```
259
+ * // - Install the npm module by running:
260
+ * // ```sh
261
+ * // $ npm install googleapis
262
+ * // ```
263
+ *
264
+ * const {google} = require('googleapis');
265
+ * const merchantapi = google.merchantapi('notifications_v1');
266
+ *
267
+ * async function main() {
268
+ * const auth = new google.auth.GoogleAuth({
269
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
270
+ * scopes: ['https://www.googleapis.com/auth/content'],
271
+ * });
272
+ *
273
+ * // Acquire an auth client, and bind it to all future calls
274
+ * const authClient = await auth.getClient();
275
+ * google.options({auth: authClient});
276
+ *
277
+ * // Do the magic
278
+ * const res = await merchantapi.accounts.notificationsubscriptions.create({
279
+ * // Required. The merchant account that owns the new notification subscription. Format: `accounts/{account\}`
280
+ * parent: 'accounts/my-account',
281
+ *
282
+ * // Request body metadata
283
+ * requestBody: {
284
+ * // request body parameters
285
+ * // {
286
+ * // "allManagedAccounts": false,
287
+ * // "callBackUri": "my_callBackUri",
288
+ * // "name": "my_name",
289
+ * // "registeredEvent": "my_registeredEvent",
290
+ * // "targetAccount": "my_targetAccount"
291
+ * // }
292
+ * },
293
+ * });
294
+ * console.log(res.data);
295
+ *
296
+ * // Example response
297
+ * // {
298
+ * // "allManagedAccounts": false,
299
+ * // "callBackUri": "my_callBackUri",
300
+ * // "name": "my_name",
301
+ * // "registeredEvent": "my_registeredEvent",
302
+ * // "targetAccount": "my_targetAccount"
303
+ * // }
304
+ * }
305
+ *
306
+ * main().catch(e => {
307
+ * console.error(e);
308
+ * throw e;
309
+ * });
310
+ *
311
+ * ```
312
+ *
313
+ * @param params - Parameters for request
314
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
315
+ * @param callback - Optional callback that handles the response.
316
+ * @returns A promise if used with async/await, or void if used with a callback.
317
+ */
318
+ create(
319
+ params: Params$Resource$Accounts$Notificationsubscriptions$Create,
320
+ options: StreamMethodOptions
321
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
322
+ create(
323
+ params?: Params$Resource$Accounts$Notificationsubscriptions$Create,
324
+ options?: MethodOptions
325
+ ): Promise<GaxiosResponseWithHTTP2<Schema$NotificationSubscription>>;
326
+ create(
327
+ params: Params$Resource$Accounts$Notificationsubscriptions$Create,
328
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
329
+ callback: BodyResponseCallback<Readable>
330
+ ): void;
331
+ create(
332
+ params: Params$Resource$Accounts$Notificationsubscriptions$Create,
333
+ options:
334
+ | MethodOptions
335
+ | BodyResponseCallback<Schema$NotificationSubscription>,
336
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
337
+ ): void;
338
+ create(
339
+ params: Params$Resource$Accounts$Notificationsubscriptions$Create,
340
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
341
+ ): void;
342
+ create(
343
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
344
+ ): void;
345
+ create(
346
+ paramsOrCallback?:
347
+ | Params$Resource$Accounts$Notificationsubscriptions$Create
348
+ | BodyResponseCallback<Schema$NotificationSubscription>
349
+ | BodyResponseCallback<Readable>,
350
+ optionsOrCallback?:
351
+ | MethodOptions
352
+ | StreamMethodOptions
353
+ | BodyResponseCallback<Schema$NotificationSubscription>
354
+ | BodyResponseCallback<Readable>,
355
+ callback?:
356
+ | BodyResponseCallback<Schema$NotificationSubscription>
357
+ | BodyResponseCallback<Readable>
358
+ ):
359
+ | void
360
+ | Promise<GaxiosResponseWithHTTP2<Schema$NotificationSubscription>>
361
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
362
+ let params = (paramsOrCallback ||
363
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$Create;
364
+ let options = (optionsOrCallback || {}) as MethodOptions;
365
+
366
+ if (typeof paramsOrCallback === 'function') {
367
+ callback = paramsOrCallback;
368
+ params =
369
+ {} as Params$Resource$Accounts$Notificationsubscriptions$Create;
370
+ options = {};
371
+ }
372
+
373
+ if (typeof optionsOrCallback === 'function') {
374
+ callback = optionsOrCallback;
375
+ options = {};
376
+ }
377
+
378
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
379
+ const parameters = {
380
+ options: Object.assign(
381
+ {
382
+ url: (
383
+ rootUrl + '/notifications/v1/{+parent}/notificationsubscriptions'
384
+ ).replace(/([^:]\/)\/+/g, '$1'),
385
+ method: 'POST',
386
+ apiVersion: '',
387
+ },
388
+ options
389
+ ),
390
+ params,
391
+ requiredParams: ['parent'],
392
+ pathParams: ['parent'],
393
+ context: this.context,
394
+ };
395
+ if (callback) {
396
+ createAPIRequest<Schema$NotificationSubscription>(
397
+ parameters,
398
+ callback as BodyResponseCallback<unknown>
399
+ );
400
+ } else {
401
+ return createAPIRequest<Schema$NotificationSubscription>(parameters);
402
+ }
403
+ }
404
+
405
+ /**
406
+ * Deletes a notification subscription for a merchant.
407
+ * @example
408
+ * ```js
409
+ * // Before running the sample:
410
+ * // - Enable the API at:
411
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
412
+ * // - Login into gcloud by running:
413
+ * // ```sh
414
+ * // $ gcloud auth application-default login
415
+ * // ```
416
+ * // - Install the npm module by running:
417
+ * // ```sh
418
+ * // $ npm install googleapis
419
+ * // ```
420
+ *
421
+ * const {google} = require('googleapis');
422
+ * const merchantapi = google.merchantapi('notifications_v1');
423
+ *
424
+ * async function main() {
425
+ * const auth = new google.auth.GoogleAuth({
426
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
427
+ * scopes: ['https://www.googleapis.com/auth/content'],
428
+ * });
429
+ *
430
+ * // Acquire an auth client, and bind it to all future calls
431
+ * const authClient = await auth.getClient();
432
+ * google.options({auth: authClient});
433
+ *
434
+ * // Do the magic
435
+ * const res = await merchantapi.accounts.notificationsubscriptions.delete({
436
+ * // Required. The name of the notification subscription to be deleted.
437
+ * name: 'accounts/my-account/notificationsubscriptions/my-notificationsubscription',
438
+ * });
439
+ * console.log(res.data);
440
+ *
441
+ * // Example response
442
+ * // {}
443
+ * }
444
+ *
445
+ * main().catch(e => {
446
+ * console.error(e);
447
+ * throw e;
448
+ * });
449
+ *
450
+ * ```
451
+ *
452
+ * @param params - Parameters for request
453
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
454
+ * @param callback - Optional callback that handles the response.
455
+ * @returns A promise if used with async/await, or void if used with a callback.
456
+ */
457
+ delete(
458
+ params: Params$Resource$Accounts$Notificationsubscriptions$Delete,
459
+ options: StreamMethodOptions
460
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
461
+ delete(
462
+ params?: Params$Resource$Accounts$Notificationsubscriptions$Delete,
463
+ options?: MethodOptions
464
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
465
+ delete(
466
+ params: Params$Resource$Accounts$Notificationsubscriptions$Delete,
467
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
468
+ callback: BodyResponseCallback<Readable>
469
+ ): void;
470
+ delete(
471
+ params: Params$Resource$Accounts$Notificationsubscriptions$Delete,
472
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
473
+ callback: BodyResponseCallback<Schema$Empty>
474
+ ): void;
475
+ delete(
476
+ params: Params$Resource$Accounts$Notificationsubscriptions$Delete,
477
+ callback: BodyResponseCallback<Schema$Empty>
478
+ ): void;
479
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
480
+ delete(
481
+ paramsOrCallback?:
482
+ | Params$Resource$Accounts$Notificationsubscriptions$Delete
483
+ | BodyResponseCallback<Schema$Empty>
484
+ | BodyResponseCallback<Readable>,
485
+ optionsOrCallback?:
486
+ | MethodOptions
487
+ | StreamMethodOptions
488
+ | BodyResponseCallback<Schema$Empty>
489
+ | BodyResponseCallback<Readable>,
490
+ callback?:
491
+ | BodyResponseCallback<Schema$Empty>
492
+ | BodyResponseCallback<Readable>
493
+ ):
494
+ | void
495
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
496
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
497
+ let params = (paramsOrCallback ||
498
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$Delete;
499
+ let options = (optionsOrCallback || {}) as MethodOptions;
500
+
501
+ if (typeof paramsOrCallback === 'function') {
502
+ callback = paramsOrCallback;
503
+ params =
504
+ {} as Params$Resource$Accounts$Notificationsubscriptions$Delete;
505
+ options = {};
506
+ }
507
+
508
+ if (typeof optionsOrCallback === 'function') {
509
+ callback = optionsOrCallback;
510
+ options = {};
511
+ }
512
+
513
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
514
+ const parameters = {
515
+ options: Object.assign(
516
+ {
517
+ url: (rootUrl + '/notifications/v1/{+name}').replace(
518
+ /([^:]\/)\/+/g,
519
+ '$1'
520
+ ),
521
+ method: 'DELETE',
522
+ apiVersion: '',
523
+ },
524
+ options
525
+ ),
526
+ params,
527
+ requiredParams: ['name'],
528
+ pathParams: ['name'],
529
+ context: this.context,
530
+ };
531
+ if (callback) {
532
+ createAPIRequest<Schema$Empty>(
533
+ parameters,
534
+ callback as BodyResponseCallback<unknown>
535
+ );
536
+ } else {
537
+ return createAPIRequest<Schema$Empty>(parameters);
538
+ }
539
+ }
540
+
541
+ /**
542
+ * Gets notification subscriptions for an account.
543
+ * @example
544
+ * ```js
545
+ * // Before running the sample:
546
+ * // - Enable the API at:
547
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
548
+ * // - Login into gcloud by running:
549
+ * // ```sh
550
+ * // $ gcloud auth application-default login
551
+ * // ```
552
+ * // - Install the npm module by running:
553
+ * // ```sh
554
+ * // $ npm install googleapis
555
+ * // ```
556
+ *
557
+ * const {google} = require('googleapis');
558
+ * const merchantapi = google.merchantapi('notifications_v1');
559
+ *
560
+ * async function main() {
561
+ * const auth = new google.auth.GoogleAuth({
562
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
563
+ * scopes: ['https://www.googleapis.com/auth/content'],
564
+ * });
565
+ *
566
+ * // Acquire an auth client, and bind it to all future calls
567
+ * const authClient = await auth.getClient();
568
+ * google.options({auth: authClient});
569
+ *
570
+ * // Do the magic
571
+ * const res = await merchantapi.accounts.notificationsubscriptions.get({
572
+ * // Required. The `name` of the notification subscription.
573
+ * name: 'accounts/my-account/notificationsubscriptions/my-notificationsubscription',
574
+ * });
575
+ * console.log(res.data);
576
+ *
577
+ * // Example response
578
+ * // {
579
+ * // "allManagedAccounts": false,
580
+ * // "callBackUri": "my_callBackUri",
581
+ * // "name": "my_name",
582
+ * // "registeredEvent": "my_registeredEvent",
583
+ * // "targetAccount": "my_targetAccount"
584
+ * // }
585
+ * }
586
+ *
587
+ * main().catch(e => {
588
+ * console.error(e);
589
+ * throw e;
590
+ * });
591
+ *
592
+ * ```
593
+ *
594
+ * @param params - Parameters for request
595
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
596
+ * @param callback - Optional callback that handles the response.
597
+ * @returns A promise if used with async/await, or void if used with a callback.
598
+ */
599
+ get(
600
+ params: Params$Resource$Accounts$Notificationsubscriptions$Get,
601
+ options: StreamMethodOptions
602
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
603
+ get(
604
+ params?: Params$Resource$Accounts$Notificationsubscriptions$Get,
605
+ options?: MethodOptions
606
+ ): Promise<GaxiosResponseWithHTTP2<Schema$NotificationSubscription>>;
607
+ get(
608
+ params: Params$Resource$Accounts$Notificationsubscriptions$Get,
609
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
610
+ callback: BodyResponseCallback<Readable>
611
+ ): void;
612
+ get(
613
+ params: Params$Resource$Accounts$Notificationsubscriptions$Get,
614
+ options:
615
+ | MethodOptions
616
+ | BodyResponseCallback<Schema$NotificationSubscription>,
617
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
618
+ ): void;
619
+ get(
620
+ params: Params$Resource$Accounts$Notificationsubscriptions$Get,
621
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
622
+ ): void;
623
+ get(callback: BodyResponseCallback<Schema$NotificationSubscription>): void;
624
+ get(
625
+ paramsOrCallback?:
626
+ | Params$Resource$Accounts$Notificationsubscriptions$Get
627
+ | BodyResponseCallback<Schema$NotificationSubscription>
628
+ | BodyResponseCallback<Readable>,
629
+ optionsOrCallback?:
630
+ | MethodOptions
631
+ | StreamMethodOptions
632
+ | BodyResponseCallback<Schema$NotificationSubscription>
633
+ | BodyResponseCallback<Readable>,
634
+ callback?:
635
+ | BodyResponseCallback<Schema$NotificationSubscription>
636
+ | BodyResponseCallback<Readable>
637
+ ):
638
+ | void
639
+ | Promise<GaxiosResponseWithHTTP2<Schema$NotificationSubscription>>
640
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
641
+ let params = (paramsOrCallback ||
642
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$Get;
643
+ let options = (optionsOrCallback || {}) as MethodOptions;
644
+
645
+ if (typeof paramsOrCallback === 'function') {
646
+ callback = paramsOrCallback;
647
+ params = {} as Params$Resource$Accounts$Notificationsubscriptions$Get;
648
+ options = {};
649
+ }
650
+
651
+ if (typeof optionsOrCallback === 'function') {
652
+ callback = optionsOrCallback;
653
+ options = {};
654
+ }
655
+
656
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
657
+ const parameters = {
658
+ options: Object.assign(
659
+ {
660
+ url: (rootUrl + '/notifications/v1/{+name}').replace(
661
+ /([^:]\/)\/+/g,
662
+ '$1'
663
+ ),
664
+ method: 'GET',
665
+ apiVersion: '',
666
+ },
667
+ options
668
+ ),
669
+ params,
670
+ requiredParams: ['name'],
671
+ pathParams: ['name'],
672
+ context: this.context,
673
+ };
674
+ if (callback) {
675
+ createAPIRequest<Schema$NotificationSubscription>(
676
+ parameters,
677
+ callback as BodyResponseCallback<unknown>
678
+ );
679
+ } else {
680
+ return createAPIRequest<Schema$NotificationSubscription>(parameters);
681
+ }
682
+ }
683
+
684
+ /**
685
+ * Gets all the notification subscriptions for a merchant.
686
+ * @example
687
+ * ```js
688
+ * // Before running the sample:
689
+ * // - Enable the API at:
690
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
691
+ * // - Login into gcloud by running:
692
+ * // ```sh
693
+ * // $ gcloud auth application-default login
694
+ * // ```
695
+ * // - Install the npm module by running:
696
+ * // ```sh
697
+ * // $ npm install googleapis
698
+ * // ```
699
+ *
700
+ * const {google} = require('googleapis');
701
+ * const merchantapi = google.merchantapi('notifications_v1');
702
+ *
703
+ * async function main() {
704
+ * const auth = new google.auth.GoogleAuth({
705
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
706
+ * scopes: ['https://www.googleapis.com/auth/content'],
707
+ * });
708
+ *
709
+ * // Acquire an auth client, and bind it to all future calls
710
+ * const authClient = await auth.getClient();
711
+ * google.options({auth: authClient});
712
+ *
713
+ * // Do the magic
714
+ * const res = await merchantapi.accounts.notificationsubscriptions.list({
715
+ * // 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`.
716
+ * pageSize: 'placeholder-value',
717
+ * // Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token.
718
+ * pageToken: 'placeholder-value',
719
+ * // Required. The merchant account who owns the notification subscriptions. Format: `accounts/{account\}`
720
+ * parent: 'accounts/my-account',
721
+ * });
722
+ * console.log(res.data);
723
+ *
724
+ * // Example response
725
+ * // {
726
+ * // "nextPageToken": "my_nextPageToken",
727
+ * // "notificationSubscriptions": []
728
+ * // }
729
+ * }
730
+ *
731
+ * main().catch(e => {
732
+ * console.error(e);
733
+ * throw e;
734
+ * });
735
+ *
736
+ * ```
737
+ *
738
+ * @param params - Parameters for request
739
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
740
+ * @param callback - Optional callback that handles the response.
741
+ * @returns A promise if used with async/await, or void if used with a callback.
742
+ */
743
+ list(
744
+ params: Params$Resource$Accounts$Notificationsubscriptions$List,
745
+ options: StreamMethodOptions
746
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
747
+ list(
748
+ params?: Params$Resource$Accounts$Notificationsubscriptions$List,
749
+ options?: MethodOptions
750
+ ): Promise<
751
+ GaxiosResponseWithHTTP2<Schema$ListNotificationSubscriptionsResponse>
752
+ >;
753
+ list(
754
+ params: Params$Resource$Accounts$Notificationsubscriptions$List,
755
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
756
+ callback: BodyResponseCallback<Readable>
757
+ ): void;
758
+ list(
759
+ params: Params$Resource$Accounts$Notificationsubscriptions$List,
760
+ options:
761
+ | MethodOptions
762
+ | BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>,
763
+ callback: BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
764
+ ): void;
765
+ list(
766
+ params: Params$Resource$Accounts$Notificationsubscriptions$List,
767
+ callback: BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
768
+ ): void;
769
+ list(
770
+ callback: BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
771
+ ): void;
772
+ list(
773
+ paramsOrCallback?:
774
+ | Params$Resource$Accounts$Notificationsubscriptions$List
775
+ | BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
776
+ | BodyResponseCallback<Readable>,
777
+ optionsOrCallback?:
778
+ | MethodOptions
779
+ | StreamMethodOptions
780
+ | BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
781
+ | BodyResponseCallback<Readable>,
782
+ callback?:
783
+ | BodyResponseCallback<Schema$ListNotificationSubscriptionsResponse>
784
+ | BodyResponseCallback<Readable>
785
+ ):
786
+ | void
787
+ | Promise<
788
+ GaxiosResponseWithHTTP2<Schema$ListNotificationSubscriptionsResponse>
789
+ >
790
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
791
+ let params = (paramsOrCallback ||
792
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$List;
793
+ let options = (optionsOrCallback || {}) as MethodOptions;
794
+
795
+ if (typeof paramsOrCallback === 'function') {
796
+ callback = paramsOrCallback;
797
+ params = {} as Params$Resource$Accounts$Notificationsubscriptions$List;
798
+ options = {};
799
+ }
800
+
801
+ if (typeof optionsOrCallback === 'function') {
802
+ callback = optionsOrCallback;
803
+ options = {};
804
+ }
805
+
806
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
807
+ const parameters = {
808
+ options: Object.assign(
809
+ {
810
+ url: (
811
+ rootUrl + '/notifications/v1/{+parent}/notificationsubscriptions'
812
+ ).replace(/([^:]\/)\/+/g, '$1'),
813
+ method: 'GET',
814
+ apiVersion: '',
815
+ },
816
+ options
817
+ ),
818
+ params,
819
+ requiredParams: ['parent'],
820
+ pathParams: ['parent'],
821
+ context: this.context,
822
+ };
823
+ if (callback) {
824
+ createAPIRequest<Schema$ListNotificationSubscriptionsResponse>(
825
+ parameters,
826
+ callback as BodyResponseCallback<unknown>
827
+ );
828
+ } else {
829
+ return createAPIRequest<Schema$ListNotificationSubscriptionsResponse>(
830
+ parameters
831
+ );
832
+ }
833
+ }
834
+
835
+ /**
836
+ * Updates an existing notification subscription for a merchant.
837
+ * @example
838
+ * ```js
839
+ * // Before running the sample:
840
+ * // - Enable the API at:
841
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
842
+ * // - Login into gcloud by running:
843
+ * // ```sh
844
+ * // $ gcloud auth application-default login
845
+ * // ```
846
+ * // - Install the npm module by running:
847
+ * // ```sh
848
+ * // $ npm install googleapis
849
+ * // ```
850
+ *
851
+ * const {google} = require('googleapis');
852
+ * const merchantapi = google.merchantapi('notifications_v1');
853
+ *
854
+ * async function main() {
855
+ * const auth = new google.auth.GoogleAuth({
856
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
857
+ * scopes: ['https://www.googleapis.com/auth/content'],
858
+ * });
859
+ *
860
+ * // Acquire an auth client, and bind it to all future calls
861
+ * const authClient = await auth.getClient();
862
+ * google.options({auth: authClient});
863
+ *
864
+ * // Do the magic
865
+ * const res = await merchantapi.accounts.notificationsubscriptions.patch({
866
+ * // 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\}`
867
+ * name: 'accounts/my-account/notificationsubscriptions/my-notificationsubscription',
868
+ * // List of fields being updated.
869
+ * updateMask: 'placeholder-value',
870
+ *
871
+ * // Request body metadata
872
+ * requestBody: {
873
+ * // request body parameters
874
+ * // {
875
+ * // "allManagedAccounts": false,
876
+ * // "callBackUri": "my_callBackUri",
877
+ * // "name": "my_name",
878
+ * // "registeredEvent": "my_registeredEvent",
879
+ * // "targetAccount": "my_targetAccount"
880
+ * // }
881
+ * },
882
+ * });
883
+ * console.log(res.data);
884
+ *
885
+ * // Example response
886
+ * // {
887
+ * // "allManagedAccounts": false,
888
+ * // "callBackUri": "my_callBackUri",
889
+ * // "name": "my_name",
890
+ * // "registeredEvent": "my_registeredEvent",
891
+ * // "targetAccount": "my_targetAccount"
892
+ * // }
893
+ * }
894
+ *
895
+ * main().catch(e => {
896
+ * console.error(e);
897
+ * throw e;
898
+ * });
899
+ *
900
+ * ```
901
+ *
902
+ * @param params - Parameters for request
903
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
904
+ * @param callback - Optional callback that handles the response.
905
+ * @returns A promise if used with async/await, or void if used with a callback.
906
+ */
907
+ patch(
908
+ params: Params$Resource$Accounts$Notificationsubscriptions$Patch,
909
+ options: StreamMethodOptions
910
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
911
+ patch(
912
+ params?: Params$Resource$Accounts$Notificationsubscriptions$Patch,
913
+ options?: MethodOptions
914
+ ): Promise<GaxiosResponseWithHTTP2<Schema$NotificationSubscription>>;
915
+ patch(
916
+ params: Params$Resource$Accounts$Notificationsubscriptions$Patch,
917
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
918
+ callback: BodyResponseCallback<Readable>
919
+ ): void;
920
+ patch(
921
+ params: Params$Resource$Accounts$Notificationsubscriptions$Patch,
922
+ options:
923
+ | MethodOptions
924
+ | BodyResponseCallback<Schema$NotificationSubscription>,
925
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
926
+ ): void;
927
+ patch(
928
+ params: Params$Resource$Accounts$Notificationsubscriptions$Patch,
929
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
930
+ ): void;
931
+ patch(
932
+ callback: BodyResponseCallback<Schema$NotificationSubscription>
933
+ ): void;
934
+ patch(
935
+ paramsOrCallback?:
936
+ | Params$Resource$Accounts$Notificationsubscriptions$Patch
937
+ | BodyResponseCallback<Schema$NotificationSubscription>
938
+ | BodyResponseCallback<Readable>,
939
+ optionsOrCallback?:
940
+ | MethodOptions
941
+ | StreamMethodOptions
942
+ | BodyResponseCallback<Schema$NotificationSubscription>
943
+ | BodyResponseCallback<Readable>,
944
+ callback?:
945
+ | BodyResponseCallback<Schema$NotificationSubscription>
946
+ | BodyResponseCallback<Readable>
947
+ ):
948
+ | void
949
+ | Promise<GaxiosResponseWithHTTP2<Schema$NotificationSubscription>>
950
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
951
+ let params = (paramsOrCallback ||
952
+ {}) as Params$Resource$Accounts$Notificationsubscriptions$Patch;
953
+ let options = (optionsOrCallback || {}) as MethodOptions;
954
+
955
+ if (typeof paramsOrCallback === 'function') {
956
+ callback = paramsOrCallback;
957
+ params = {} as Params$Resource$Accounts$Notificationsubscriptions$Patch;
958
+ options = {};
959
+ }
960
+
961
+ if (typeof optionsOrCallback === 'function') {
962
+ callback = optionsOrCallback;
963
+ options = {};
964
+ }
965
+
966
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
967
+ const parameters = {
968
+ options: Object.assign(
969
+ {
970
+ url: (rootUrl + '/notifications/v1/{+name}').replace(
971
+ /([^:]\/)\/+/g,
972
+ '$1'
973
+ ),
974
+ method: 'PATCH',
975
+ apiVersion: '',
976
+ },
977
+ options
978
+ ),
979
+ params,
980
+ requiredParams: ['name'],
981
+ pathParams: ['name'],
982
+ context: this.context,
983
+ };
984
+ if (callback) {
985
+ createAPIRequest<Schema$NotificationSubscription>(
986
+ parameters,
987
+ callback as BodyResponseCallback<unknown>
988
+ );
989
+ } else {
990
+ return createAPIRequest<Schema$NotificationSubscription>(parameters);
991
+ }
992
+ }
993
+ }
994
+
995
+ export interface Params$Resource$Accounts$Notificationsubscriptions$Create
996
+ extends StandardParameters {
997
+ /**
998
+ * Required. The merchant account that owns the new notification subscription. Format: `accounts/{account\}`
999
+ */
1000
+ parent?: string;
1001
+
1002
+ /**
1003
+ * Request body metadata
1004
+ */
1005
+ requestBody?: Schema$NotificationSubscription;
1006
+ }
1007
+ export interface Params$Resource$Accounts$Notificationsubscriptions$Delete
1008
+ extends StandardParameters {
1009
+ /**
1010
+ * Required. The name of the notification subscription to be deleted.
1011
+ */
1012
+ name?: string;
1013
+ }
1014
+ export interface Params$Resource$Accounts$Notificationsubscriptions$Get
1015
+ extends StandardParameters {
1016
+ /**
1017
+ * Required. The `name` of the notification subscription.
1018
+ */
1019
+ name?: string;
1020
+ }
1021
+ export interface Params$Resource$Accounts$Notificationsubscriptions$List
1022
+ extends StandardParameters {
1023
+ /**
1024
+ * 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`.
1025
+ */
1026
+ pageSize?: number;
1027
+ /**
1028
+ * Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token.
1029
+ */
1030
+ pageToken?: string;
1031
+ /**
1032
+ * Required. The merchant account who owns the notification subscriptions. Format: `accounts/{account\}`
1033
+ */
1034
+ parent?: string;
1035
+ }
1036
+ export interface Params$Resource$Accounts$Notificationsubscriptions$Patch
1037
+ extends StandardParameters {
1038
+ /**
1039
+ * 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\}`
1040
+ */
1041
+ name?: string;
1042
+ /**
1043
+ * List of fields being updated.
1044
+ */
1045
+ updateMask?: string;
1046
+
1047
+ /**
1048
+ * Request body metadata
1049
+ */
1050
+ requestBody?: Schema$NotificationSubscription;
1051
+ }
1052
+ }