@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,1284 @@
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_conversions_v1 {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'conversions_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('conversions_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
+ * Represents attribution settings for conversion sources receiving pre-attribution data.
129
+ */
130
+ export interface Schema$AttributionSettings {
131
+ /**
132
+ * Required. Lookback window (in days) used for attribution in this source. Supported values are `7`, `30` & `40`.
133
+ */
134
+ attributionLookbackWindowDays?: number | null;
135
+ /**
136
+ * Required. Attribution model.
137
+ */
138
+ attributionModel?: string | null;
139
+ /**
140
+ * Immutable. Unordered list. List of different conversion types a conversion event can be classified as. A standard "purchase" type will be automatically created if this list is empty at creation time.
141
+ */
142
+ conversionType?: Schema$ConversionType[];
143
+ }
144
+ /**
145
+ * Represents a conversion source owned by a Merchant account. A merchant account can have up to 200 conversion sources.
146
+ */
147
+ export interface Schema$ConversionSource {
148
+ /**
149
+ * Output only. Controller of the conversion source.
150
+ */
151
+ controller?: string | null;
152
+ /**
153
+ * Output only. The time when an archived conversion source becomes permanently deleted and is no longer available to undelete.
154
+ */
155
+ expireTime?: string | null;
156
+ /**
157
+ * Immutable. Conversion Source of type "Link to Google Analytics Property".
158
+ */
159
+ googleAnalyticsLink?: Schema$GoogleAnalyticsLink;
160
+ /**
161
+ * Conversion Source of type "Merchant Center Tag Destination".
162
+ */
163
+ merchantCenterDestination?: Schema$MerchantCenterDestination;
164
+ /**
165
+ * Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: `[a-z]{4\}:.+` The four characters before the colon represent the type of conversion source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: * `galk`: For GoogleAnalyticsLink sources. * `mcdn`: For MerchantCenterDestination sources.
166
+ */
167
+ name?: string | null;
168
+ /**
169
+ * Output only. Current state of this conversion source. Can't be edited through the API.
170
+ */
171
+ state?: string | null;
172
+ }
173
+ /**
174
+ * Message representing the type of a conversion event.
175
+ */
176
+ export interface Schema$ConversionType {
177
+ /**
178
+ * Output only. Conversion event name, as it'll be reported by the client.
179
+ */
180
+ name?: string | null;
181
+ /**
182
+ * Output only. Option indicating if the type should be included in Merchant Center reporting.
183
+ */
184
+ report?: boolean | null;
185
+ }
186
+ /**
187
+ * 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); \}
188
+ */
189
+ export interface Schema$Empty {}
190
+ /**
191
+ * "Google Analytics Link" sources can be used to get conversion data from an existing Google Analytics property into the linked Merchant Center account.
192
+ */
193
+ export interface Schema$GoogleAnalyticsLink {
194
+ /**
195
+ * Output only. Attribution settings for the linked Google Analytics property.
196
+ */
197
+ attributionSettings?: Schema$AttributionSettings;
198
+ /**
199
+ * Output only. Name of the Google Analytics property the merchant is linked to.
200
+ */
201
+ property?: string | null;
202
+ /**
203
+ * Required. Immutable. ID of the Google Analytics property the merchant is linked to.
204
+ */
205
+ propertyId?: string | null;
206
+ }
207
+ /**
208
+ * Response message for the ListConversionSources method.
209
+ */
210
+ export interface Schema$ListConversionSourcesResponse {
211
+ /**
212
+ * List of conversion sources.
213
+ */
214
+ conversionSources?: Schema$ConversionSource[];
215
+ /**
216
+ * Token to be used to fetch the next results page.
217
+ */
218
+ nextPageToken?: string | null;
219
+ }
220
+ /**
221
+ * "Merchant Center Destination" sources can be used to send conversion events from an online store using a Google tag directly to a Merchant Center account where the source is created.
222
+ */
223
+ export interface Schema$MerchantCenterDestination {
224
+ /**
225
+ * Required. Attribution settings used for the Merchant Center Destination.
226
+ */
227
+ attributionSettings?: Schema$AttributionSettings;
228
+ /**
229
+ * Required. Three-letter currency code (ISO 4217). The currency code defines in which currency the conversions sent to this destination will be reported in Merchant Center.
230
+ */
231
+ currencyCode?: string | null;
232
+ /**
233
+ * Output only. Merchant Center Destination ID.
234
+ */
235
+ destination?: string | null;
236
+ /**
237
+ * Required. Merchant-specified display name for the destination. This is the name that identifies the conversion source within the Merchant Center UI. The maximum length is 64 characters.
238
+ */
239
+ displayName?: string | null;
240
+ }
241
+ /**
242
+ * The change that happened to the product including old value, new value, country code as the region code and reporting context.
243
+ */
244
+ export interface Schema$ProductChange {
245
+ /**
246
+ * The new value of the changed resource or attribute. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)
247
+ */
248
+ newValue?: string | null;
249
+ /**
250
+ * The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)
251
+ */
252
+ oldValue?: string | null;
253
+ /**
254
+ * Countries that have the change (if applicable). Represented in the ISO 3166 format.
255
+ */
256
+ regionCode?: string | null;
257
+ /**
258
+ * Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)
259
+ */
260
+ reportingContext?: string | null;
261
+ }
262
+ /**
263
+ * The message that the merchant will receive to notify about product status change event
264
+ */
265
+ export interface Schema$ProductStatusChangeMessage {
266
+ /**
267
+ * The target account that owns the entity that changed. Format : `accounts/{merchant_id\}`
268
+ */
269
+ account?: string | null;
270
+ /**
271
+ * The attribute in the resource that changed, in this case it will be always `Status`.
272
+ */
273
+ attribute?: string | null;
274
+ /**
275
+ * A message to describe the change that happened to the product
276
+ */
277
+ changes?: Schema$ProductChange[];
278
+ /**
279
+ * The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.
280
+ */
281
+ eventTime?: string | null;
282
+ /**
283
+ * Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.
284
+ */
285
+ expirationTime?: string | null;
286
+ /**
287
+ * The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id\}`
288
+ */
289
+ managingAccount?: string | null;
290
+ /**
291
+ * The product name. Format: `accounts/{account\}/products/{product\}`
292
+ */
293
+ resource?: string | null;
294
+ /**
295
+ * The product id.
296
+ */
297
+ resourceId?: string | null;
298
+ /**
299
+ * The resource that changed, in this case it will always be `Product`.
300
+ */
301
+ resourceType?: string | null;
302
+ }
303
+ /**
304
+ * Request message for the UndeleteConversionSource method.
305
+ */
306
+ export interface Schema$UndeleteConversionSourceRequest {}
307
+
308
+ export class Resource$Accounts {
309
+ context: APIRequestContext;
310
+ conversionSources: Resource$Accounts$Conversionsources;
311
+ constructor(context: APIRequestContext) {
312
+ this.context = context;
313
+ this.conversionSources = new Resource$Accounts$Conversionsources(
314
+ this.context
315
+ );
316
+ }
317
+ }
318
+
319
+ export class Resource$Accounts$Conversionsources {
320
+ context: APIRequestContext;
321
+ constructor(context: APIRequestContext) {
322
+ this.context = context;
323
+ }
324
+
325
+ /**
326
+ * Creates a new conversion source.
327
+ * @example
328
+ * ```js
329
+ * // Before running the sample:
330
+ * // - Enable the API at:
331
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
332
+ * // - Login into gcloud by running:
333
+ * // ```sh
334
+ * // $ gcloud auth application-default login
335
+ * // ```
336
+ * // - Install the npm module by running:
337
+ * // ```sh
338
+ * // $ npm install googleapis
339
+ * // ```
340
+ *
341
+ * const {google} = require('googleapis');
342
+ * const merchantapi = google.merchantapi('conversions_v1');
343
+ *
344
+ * async function main() {
345
+ * const auth = new google.auth.GoogleAuth({
346
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
347
+ * scopes: ['https://www.googleapis.com/auth/content'],
348
+ * });
349
+ *
350
+ * // Acquire an auth client, and bind it to all future calls
351
+ * const authClient = await auth.getClient();
352
+ * google.options({auth: authClient});
353
+ *
354
+ * // Do the magic
355
+ * const res = await merchantapi.accounts.conversionSources.create({
356
+ * // Required. The merchant account that will own the new conversion source. Format: `accounts/{account\}`
357
+ * parent: 'accounts/my-account',
358
+ *
359
+ * // Request body metadata
360
+ * requestBody: {
361
+ * // request body parameters
362
+ * // {
363
+ * // "controller": "my_controller",
364
+ * // "expireTime": "my_expireTime",
365
+ * // "googleAnalyticsLink": {},
366
+ * // "merchantCenterDestination": {},
367
+ * // "name": "my_name",
368
+ * // "state": "my_state"
369
+ * // }
370
+ * },
371
+ * });
372
+ * console.log(res.data);
373
+ *
374
+ * // Example response
375
+ * // {
376
+ * // "controller": "my_controller",
377
+ * // "expireTime": "my_expireTime",
378
+ * // "googleAnalyticsLink": {},
379
+ * // "merchantCenterDestination": {},
380
+ * // "name": "my_name",
381
+ * // "state": "my_state"
382
+ * // }
383
+ * }
384
+ *
385
+ * main().catch(e => {
386
+ * console.error(e);
387
+ * throw e;
388
+ * });
389
+ *
390
+ * ```
391
+ *
392
+ * @param params - Parameters for request
393
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
394
+ * @param callback - Optional callback that handles the response.
395
+ * @returns A promise if used with async/await, or void if used with a callback.
396
+ */
397
+ create(
398
+ params: Params$Resource$Accounts$Conversionsources$Create,
399
+ options: StreamMethodOptions
400
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
401
+ create(
402
+ params?: Params$Resource$Accounts$Conversionsources$Create,
403
+ options?: MethodOptions
404
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ConversionSource>>;
405
+ create(
406
+ params: Params$Resource$Accounts$Conversionsources$Create,
407
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
408
+ callback: BodyResponseCallback<Readable>
409
+ ): void;
410
+ create(
411
+ params: Params$Resource$Accounts$Conversionsources$Create,
412
+ options: MethodOptions | BodyResponseCallback<Schema$ConversionSource>,
413
+ callback: BodyResponseCallback<Schema$ConversionSource>
414
+ ): void;
415
+ create(
416
+ params: Params$Resource$Accounts$Conversionsources$Create,
417
+ callback: BodyResponseCallback<Schema$ConversionSource>
418
+ ): void;
419
+ create(callback: BodyResponseCallback<Schema$ConversionSource>): void;
420
+ create(
421
+ paramsOrCallback?:
422
+ | Params$Resource$Accounts$Conversionsources$Create
423
+ | BodyResponseCallback<Schema$ConversionSource>
424
+ | BodyResponseCallback<Readable>,
425
+ optionsOrCallback?:
426
+ | MethodOptions
427
+ | StreamMethodOptions
428
+ | BodyResponseCallback<Schema$ConversionSource>
429
+ | BodyResponseCallback<Readable>,
430
+ callback?:
431
+ | BodyResponseCallback<Schema$ConversionSource>
432
+ | BodyResponseCallback<Readable>
433
+ ):
434
+ | void
435
+ | Promise<GaxiosResponseWithHTTP2<Schema$ConversionSource>>
436
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
437
+ let params = (paramsOrCallback ||
438
+ {}) as Params$Resource$Accounts$Conversionsources$Create;
439
+ let options = (optionsOrCallback || {}) as MethodOptions;
440
+
441
+ if (typeof paramsOrCallback === 'function') {
442
+ callback = paramsOrCallback;
443
+ params = {} as Params$Resource$Accounts$Conversionsources$Create;
444
+ options = {};
445
+ }
446
+
447
+ if (typeof optionsOrCallback === 'function') {
448
+ callback = optionsOrCallback;
449
+ options = {};
450
+ }
451
+
452
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
453
+ const parameters = {
454
+ options: Object.assign(
455
+ {
456
+ url: (
457
+ rootUrl + '/conversions/v1/{+parent}/conversionSources'
458
+ ).replace(/([^:]\/)\/+/g, '$1'),
459
+ method: 'POST',
460
+ apiVersion: '',
461
+ },
462
+ options
463
+ ),
464
+ params,
465
+ requiredParams: ['parent'],
466
+ pathParams: ['parent'],
467
+ context: this.context,
468
+ };
469
+ if (callback) {
470
+ createAPIRequest<Schema$ConversionSource>(
471
+ parameters,
472
+ callback as BodyResponseCallback<unknown>
473
+ );
474
+ } else {
475
+ return createAPIRequest<Schema$ConversionSource>(parameters);
476
+ }
477
+ }
478
+
479
+ /**
480
+ * Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.
481
+ * @example
482
+ * ```js
483
+ * // Before running the sample:
484
+ * // - Enable the API at:
485
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
486
+ * // - Login into gcloud by running:
487
+ * // ```sh
488
+ * // $ gcloud auth application-default login
489
+ * // ```
490
+ * // - Install the npm module by running:
491
+ * // ```sh
492
+ * // $ npm install googleapis
493
+ * // ```
494
+ *
495
+ * const {google} = require('googleapis');
496
+ * const merchantapi = google.merchantapi('conversions_v1');
497
+ *
498
+ * async function main() {
499
+ * const auth = new google.auth.GoogleAuth({
500
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
501
+ * scopes: ['https://www.googleapis.com/auth/content'],
502
+ * });
503
+ *
504
+ * // Acquire an auth client, and bind it to all future calls
505
+ * const authClient = await auth.getClient();
506
+ * google.options({auth: authClient});
507
+ *
508
+ * // Do the magic
509
+ * const res = await merchantapi.accounts.conversionSources.delete({
510
+ * // Required. The name of the conversion source to be deleted. Format: `accounts/{account\}/conversionSources/{conversion_source\}`
511
+ * name: 'accounts/my-account/conversionSources/my-conversionSource',
512
+ * });
513
+ * console.log(res.data);
514
+ *
515
+ * // Example response
516
+ * // {}
517
+ * }
518
+ *
519
+ * main().catch(e => {
520
+ * console.error(e);
521
+ * throw e;
522
+ * });
523
+ *
524
+ * ```
525
+ *
526
+ * @param params - Parameters for request
527
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
528
+ * @param callback - Optional callback that handles the response.
529
+ * @returns A promise if used with async/await, or void if used with a callback.
530
+ */
531
+ delete(
532
+ params: Params$Resource$Accounts$Conversionsources$Delete,
533
+ options: StreamMethodOptions
534
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
535
+ delete(
536
+ params?: Params$Resource$Accounts$Conversionsources$Delete,
537
+ options?: MethodOptions
538
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
539
+ delete(
540
+ params: Params$Resource$Accounts$Conversionsources$Delete,
541
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
542
+ callback: BodyResponseCallback<Readable>
543
+ ): void;
544
+ delete(
545
+ params: Params$Resource$Accounts$Conversionsources$Delete,
546
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
547
+ callback: BodyResponseCallback<Schema$Empty>
548
+ ): void;
549
+ delete(
550
+ params: Params$Resource$Accounts$Conversionsources$Delete,
551
+ callback: BodyResponseCallback<Schema$Empty>
552
+ ): void;
553
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
554
+ delete(
555
+ paramsOrCallback?:
556
+ | Params$Resource$Accounts$Conversionsources$Delete
557
+ | BodyResponseCallback<Schema$Empty>
558
+ | BodyResponseCallback<Readable>,
559
+ optionsOrCallback?:
560
+ | MethodOptions
561
+ | StreamMethodOptions
562
+ | BodyResponseCallback<Schema$Empty>
563
+ | BodyResponseCallback<Readable>,
564
+ callback?:
565
+ | BodyResponseCallback<Schema$Empty>
566
+ | BodyResponseCallback<Readable>
567
+ ):
568
+ | void
569
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
570
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
571
+ let params = (paramsOrCallback ||
572
+ {}) as Params$Resource$Accounts$Conversionsources$Delete;
573
+ let options = (optionsOrCallback || {}) as MethodOptions;
574
+
575
+ if (typeof paramsOrCallback === 'function') {
576
+ callback = paramsOrCallback;
577
+ params = {} as Params$Resource$Accounts$Conversionsources$Delete;
578
+ options = {};
579
+ }
580
+
581
+ if (typeof optionsOrCallback === 'function') {
582
+ callback = optionsOrCallback;
583
+ options = {};
584
+ }
585
+
586
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
587
+ const parameters = {
588
+ options: Object.assign(
589
+ {
590
+ url: (rootUrl + '/conversions/v1/{+name}').replace(
591
+ /([^:]\/)\/+/g,
592
+ '$1'
593
+ ),
594
+ method: 'DELETE',
595
+ apiVersion: '',
596
+ },
597
+ options
598
+ ),
599
+ params,
600
+ requiredParams: ['name'],
601
+ pathParams: ['name'],
602
+ context: this.context,
603
+ };
604
+ if (callback) {
605
+ createAPIRequest<Schema$Empty>(
606
+ parameters,
607
+ callback as BodyResponseCallback<unknown>
608
+ );
609
+ } else {
610
+ return createAPIRequest<Schema$Empty>(parameters);
611
+ }
612
+ }
613
+
614
+ /**
615
+ * Fetches a conversion source.
616
+ * @example
617
+ * ```js
618
+ * // Before running the sample:
619
+ * // - Enable the API at:
620
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
621
+ * // - Login into gcloud by running:
622
+ * // ```sh
623
+ * // $ gcloud auth application-default login
624
+ * // ```
625
+ * // - Install the npm module by running:
626
+ * // ```sh
627
+ * // $ npm install googleapis
628
+ * // ```
629
+ *
630
+ * const {google} = require('googleapis');
631
+ * const merchantapi = google.merchantapi('conversions_v1');
632
+ *
633
+ * async function main() {
634
+ * const auth = new google.auth.GoogleAuth({
635
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
636
+ * scopes: ['https://www.googleapis.com/auth/content'],
637
+ * });
638
+ *
639
+ * // Acquire an auth client, and bind it to all future calls
640
+ * const authClient = await auth.getClient();
641
+ * google.options({auth: authClient});
642
+ *
643
+ * // Do the magic
644
+ * const res = await merchantapi.accounts.conversionSources.get({
645
+ * // Required. The name of the conversion source to be fetched. Format: `accounts/{account\}/conversionSources/{conversion_source\}`
646
+ * name: 'accounts/my-account/conversionSources/my-conversionSource',
647
+ * });
648
+ * console.log(res.data);
649
+ *
650
+ * // Example response
651
+ * // {
652
+ * // "controller": "my_controller",
653
+ * // "expireTime": "my_expireTime",
654
+ * // "googleAnalyticsLink": {},
655
+ * // "merchantCenterDestination": {},
656
+ * // "name": "my_name",
657
+ * // "state": "my_state"
658
+ * // }
659
+ * }
660
+ *
661
+ * main().catch(e => {
662
+ * console.error(e);
663
+ * throw e;
664
+ * });
665
+ *
666
+ * ```
667
+ *
668
+ * @param params - Parameters for request
669
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
670
+ * @param callback - Optional callback that handles the response.
671
+ * @returns A promise if used with async/await, or void if used with a callback.
672
+ */
673
+ get(
674
+ params: Params$Resource$Accounts$Conversionsources$Get,
675
+ options: StreamMethodOptions
676
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
677
+ get(
678
+ params?: Params$Resource$Accounts$Conversionsources$Get,
679
+ options?: MethodOptions
680
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ConversionSource>>;
681
+ get(
682
+ params: Params$Resource$Accounts$Conversionsources$Get,
683
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
684
+ callback: BodyResponseCallback<Readable>
685
+ ): void;
686
+ get(
687
+ params: Params$Resource$Accounts$Conversionsources$Get,
688
+ options: MethodOptions | BodyResponseCallback<Schema$ConversionSource>,
689
+ callback: BodyResponseCallback<Schema$ConversionSource>
690
+ ): void;
691
+ get(
692
+ params: Params$Resource$Accounts$Conversionsources$Get,
693
+ callback: BodyResponseCallback<Schema$ConversionSource>
694
+ ): void;
695
+ get(callback: BodyResponseCallback<Schema$ConversionSource>): void;
696
+ get(
697
+ paramsOrCallback?:
698
+ | Params$Resource$Accounts$Conversionsources$Get
699
+ | BodyResponseCallback<Schema$ConversionSource>
700
+ | BodyResponseCallback<Readable>,
701
+ optionsOrCallback?:
702
+ | MethodOptions
703
+ | StreamMethodOptions
704
+ | BodyResponseCallback<Schema$ConversionSource>
705
+ | BodyResponseCallback<Readable>,
706
+ callback?:
707
+ | BodyResponseCallback<Schema$ConversionSource>
708
+ | BodyResponseCallback<Readable>
709
+ ):
710
+ | void
711
+ | Promise<GaxiosResponseWithHTTP2<Schema$ConversionSource>>
712
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
713
+ let params = (paramsOrCallback ||
714
+ {}) as Params$Resource$Accounts$Conversionsources$Get;
715
+ let options = (optionsOrCallback || {}) as MethodOptions;
716
+
717
+ if (typeof paramsOrCallback === 'function') {
718
+ callback = paramsOrCallback;
719
+ params = {} as Params$Resource$Accounts$Conversionsources$Get;
720
+ options = {};
721
+ }
722
+
723
+ if (typeof optionsOrCallback === 'function') {
724
+ callback = optionsOrCallback;
725
+ options = {};
726
+ }
727
+
728
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
729
+ const parameters = {
730
+ options: Object.assign(
731
+ {
732
+ url: (rootUrl + '/conversions/v1/{+name}').replace(
733
+ /([^:]\/)\/+/g,
734
+ '$1'
735
+ ),
736
+ method: 'GET',
737
+ apiVersion: '',
738
+ },
739
+ options
740
+ ),
741
+ params,
742
+ requiredParams: ['name'],
743
+ pathParams: ['name'],
744
+ context: this.context,
745
+ };
746
+ if (callback) {
747
+ createAPIRequest<Schema$ConversionSource>(
748
+ parameters,
749
+ callback as BodyResponseCallback<unknown>
750
+ );
751
+ } else {
752
+ return createAPIRequest<Schema$ConversionSource>(parameters);
753
+ }
754
+ }
755
+
756
+ /**
757
+ * Retrieves the list of conversion sources the caller has access to.
758
+ * @example
759
+ * ```js
760
+ * // Before running the sample:
761
+ * // - Enable the API at:
762
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
763
+ * // - Login into gcloud by running:
764
+ * // ```sh
765
+ * // $ gcloud auth application-default login
766
+ * // ```
767
+ * // - Install the npm module by running:
768
+ * // ```sh
769
+ * // $ npm install googleapis
770
+ * // ```
771
+ *
772
+ * const {google} = require('googleapis');
773
+ * const merchantapi = google.merchantapi('conversions_v1');
774
+ *
775
+ * async function main() {
776
+ * const auth = new google.auth.GoogleAuth({
777
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
778
+ * scopes: ['https://www.googleapis.com/auth/content'],
779
+ * });
780
+ *
781
+ * // Acquire an auth client, and bind it to all future calls
782
+ * const authClient = await auth.getClient();
783
+ * google.options({auth: authClient});
784
+ *
785
+ * // Do the magic
786
+ * const res = await merchantapi.accounts.conversionSources.list({
787
+ * // Optional. The maximum number of conversion sources to return in a page. If no `page_size` is specified, `100` is used as the default value. The maximum value is `200`. Values above `200` will be coerced to `200`. Regardless of pagination, at most `200` conversion sources are returned in total.
788
+ * pageSize: 'placeholder-value',
789
+ * // Optional. Page token.
790
+ * pageToken: 'placeholder-value',
791
+ * // Required. The merchant account who owns the collection of conversion sources. Format: `accounts/{account\}`
792
+ * parent: 'accounts/my-account',
793
+ * // Optional. Show deleted (archived) conversion sources. By default, deleted conversion sources are not returned.
794
+ * showDeleted: 'placeholder-value',
795
+ * });
796
+ * console.log(res.data);
797
+ *
798
+ * // Example response
799
+ * // {
800
+ * // "conversionSources": [],
801
+ * // "nextPageToken": "my_nextPageToken"
802
+ * // }
803
+ * }
804
+ *
805
+ * main().catch(e => {
806
+ * console.error(e);
807
+ * throw e;
808
+ * });
809
+ *
810
+ * ```
811
+ *
812
+ * @param params - Parameters for request
813
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
814
+ * @param callback - Optional callback that handles the response.
815
+ * @returns A promise if used with async/await, or void if used with a callback.
816
+ */
817
+ list(
818
+ params: Params$Resource$Accounts$Conversionsources$List,
819
+ options: StreamMethodOptions
820
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
821
+ list(
822
+ params?: Params$Resource$Accounts$Conversionsources$List,
823
+ options?: MethodOptions
824
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListConversionSourcesResponse>>;
825
+ list(
826
+ params: Params$Resource$Accounts$Conversionsources$List,
827
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
828
+ callback: BodyResponseCallback<Readable>
829
+ ): void;
830
+ list(
831
+ params: Params$Resource$Accounts$Conversionsources$List,
832
+ options:
833
+ | MethodOptions
834
+ | BodyResponseCallback<Schema$ListConversionSourcesResponse>,
835
+ callback: BodyResponseCallback<Schema$ListConversionSourcesResponse>
836
+ ): void;
837
+ list(
838
+ params: Params$Resource$Accounts$Conversionsources$List,
839
+ callback: BodyResponseCallback<Schema$ListConversionSourcesResponse>
840
+ ): void;
841
+ list(
842
+ callback: BodyResponseCallback<Schema$ListConversionSourcesResponse>
843
+ ): void;
844
+ list(
845
+ paramsOrCallback?:
846
+ | Params$Resource$Accounts$Conversionsources$List
847
+ | BodyResponseCallback<Schema$ListConversionSourcesResponse>
848
+ | BodyResponseCallback<Readable>,
849
+ optionsOrCallback?:
850
+ | MethodOptions
851
+ | StreamMethodOptions
852
+ | BodyResponseCallback<Schema$ListConversionSourcesResponse>
853
+ | BodyResponseCallback<Readable>,
854
+ callback?:
855
+ | BodyResponseCallback<Schema$ListConversionSourcesResponse>
856
+ | BodyResponseCallback<Readable>
857
+ ):
858
+ | void
859
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListConversionSourcesResponse>>
860
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
861
+ let params = (paramsOrCallback ||
862
+ {}) as Params$Resource$Accounts$Conversionsources$List;
863
+ let options = (optionsOrCallback || {}) as MethodOptions;
864
+
865
+ if (typeof paramsOrCallback === 'function') {
866
+ callback = paramsOrCallback;
867
+ params = {} as Params$Resource$Accounts$Conversionsources$List;
868
+ options = {};
869
+ }
870
+
871
+ if (typeof optionsOrCallback === 'function') {
872
+ callback = optionsOrCallback;
873
+ options = {};
874
+ }
875
+
876
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
877
+ const parameters = {
878
+ options: Object.assign(
879
+ {
880
+ url: (
881
+ rootUrl + '/conversions/v1/{+parent}/conversionSources'
882
+ ).replace(/([^:]\/)\/+/g, '$1'),
883
+ method: 'GET',
884
+ apiVersion: '',
885
+ },
886
+ options
887
+ ),
888
+ params,
889
+ requiredParams: ['parent'],
890
+ pathParams: ['parent'],
891
+ context: this.context,
892
+ };
893
+ if (callback) {
894
+ createAPIRequest<Schema$ListConversionSourcesResponse>(
895
+ parameters,
896
+ callback as BodyResponseCallback<unknown>
897
+ );
898
+ } else {
899
+ return createAPIRequest<Schema$ListConversionSourcesResponse>(
900
+ parameters
901
+ );
902
+ }
903
+ }
904
+
905
+ /**
906
+ * Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.
907
+ * @example
908
+ * ```js
909
+ * // Before running the sample:
910
+ * // - Enable the API at:
911
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
912
+ * // - Login into gcloud by running:
913
+ * // ```sh
914
+ * // $ gcloud auth application-default login
915
+ * // ```
916
+ * // - Install the npm module by running:
917
+ * // ```sh
918
+ * // $ npm install googleapis
919
+ * // ```
920
+ *
921
+ * const {google} = require('googleapis');
922
+ * const merchantapi = google.merchantapi('conversions_v1');
923
+ *
924
+ * async function main() {
925
+ * const auth = new google.auth.GoogleAuth({
926
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
927
+ * scopes: ['https://www.googleapis.com/auth/content'],
928
+ * });
929
+ *
930
+ * // Acquire an auth client, and bind it to all future calls
931
+ * const authClient = await auth.getClient();
932
+ * google.options({auth: authClient});
933
+ *
934
+ * // Do the magic
935
+ * const res = await merchantapi.accounts.conversionSources.patch({
936
+ * // Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: `[a-z]{4\}:.+` The four characters before the colon represent the type of conversion source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: * `galk`: For GoogleAnalyticsLink sources. * `mcdn`: For MerchantCenterDestination sources.
937
+ * name: 'accounts/my-account/conversionSources/my-conversionSource',
938
+ * // Optional. List of fields being updated.
939
+ * updateMask: 'placeholder-value',
940
+ *
941
+ * // Request body metadata
942
+ * requestBody: {
943
+ * // request body parameters
944
+ * // {
945
+ * // "controller": "my_controller",
946
+ * // "expireTime": "my_expireTime",
947
+ * // "googleAnalyticsLink": {},
948
+ * // "merchantCenterDestination": {},
949
+ * // "name": "my_name",
950
+ * // "state": "my_state"
951
+ * // }
952
+ * },
953
+ * });
954
+ * console.log(res.data);
955
+ *
956
+ * // Example response
957
+ * // {
958
+ * // "controller": "my_controller",
959
+ * // "expireTime": "my_expireTime",
960
+ * // "googleAnalyticsLink": {},
961
+ * // "merchantCenterDestination": {},
962
+ * // "name": "my_name",
963
+ * // "state": "my_state"
964
+ * // }
965
+ * }
966
+ *
967
+ * main().catch(e => {
968
+ * console.error(e);
969
+ * throw e;
970
+ * });
971
+ *
972
+ * ```
973
+ *
974
+ * @param params - Parameters for request
975
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
976
+ * @param callback - Optional callback that handles the response.
977
+ * @returns A promise if used with async/await, or void if used with a callback.
978
+ */
979
+ patch(
980
+ params: Params$Resource$Accounts$Conversionsources$Patch,
981
+ options: StreamMethodOptions
982
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
983
+ patch(
984
+ params?: Params$Resource$Accounts$Conversionsources$Patch,
985
+ options?: MethodOptions
986
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ConversionSource>>;
987
+ patch(
988
+ params: Params$Resource$Accounts$Conversionsources$Patch,
989
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
990
+ callback: BodyResponseCallback<Readable>
991
+ ): void;
992
+ patch(
993
+ params: Params$Resource$Accounts$Conversionsources$Patch,
994
+ options: MethodOptions | BodyResponseCallback<Schema$ConversionSource>,
995
+ callback: BodyResponseCallback<Schema$ConversionSource>
996
+ ): void;
997
+ patch(
998
+ params: Params$Resource$Accounts$Conversionsources$Patch,
999
+ callback: BodyResponseCallback<Schema$ConversionSource>
1000
+ ): void;
1001
+ patch(callback: BodyResponseCallback<Schema$ConversionSource>): void;
1002
+ patch(
1003
+ paramsOrCallback?:
1004
+ | Params$Resource$Accounts$Conversionsources$Patch
1005
+ | BodyResponseCallback<Schema$ConversionSource>
1006
+ | BodyResponseCallback<Readable>,
1007
+ optionsOrCallback?:
1008
+ | MethodOptions
1009
+ | StreamMethodOptions
1010
+ | BodyResponseCallback<Schema$ConversionSource>
1011
+ | BodyResponseCallback<Readable>,
1012
+ callback?:
1013
+ | BodyResponseCallback<Schema$ConversionSource>
1014
+ | BodyResponseCallback<Readable>
1015
+ ):
1016
+ | void
1017
+ | Promise<GaxiosResponseWithHTTP2<Schema$ConversionSource>>
1018
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1019
+ let params = (paramsOrCallback ||
1020
+ {}) as Params$Resource$Accounts$Conversionsources$Patch;
1021
+ let options = (optionsOrCallback || {}) as MethodOptions;
1022
+
1023
+ if (typeof paramsOrCallback === 'function') {
1024
+ callback = paramsOrCallback;
1025
+ params = {} as Params$Resource$Accounts$Conversionsources$Patch;
1026
+ options = {};
1027
+ }
1028
+
1029
+ if (typeof optionsOrCallback === 'function') {
1030
+ callback = optionsOrCallback;
1031
+ options = {};
1032
+ }
1033
+
1034
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
1035
+ const parameters = {
1036
+ options: Object.assign(
1037
+ {
1038
+ url: (rootUrl + '/conversions/v1/{+name}').replace(
1039
+ /([^:]\/)\/+/g,
1040
+ '$1'
1041
+ ),
1042
+ method: 'PATCH',
1043
+ apiVersion: '',
1044
+ },
1045
+ options
1046
+ ),
1047
+ params,
1048
+ requiredParams: ['name'],
1049
+ pathParams: ['name'],
1050
+ context: this.context,
1051
+ };
1052
+ if (callback) {
1053
+ createAPIRequest<Schema$ConversionSource>(
1054
+ parameters,
1055
+ callback as BodyResponseCallback<unknown>
1056
+ );
1057
+ } else {
1058
+ return createAPIRequest<Schema$ConversionSource>(parameters);
1059
+ }
1060
+ }
1061
+
1062
+ /**
1063
+ * Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources.
1064
+ * @example
1065
+ * ```js
1066
+ * // Before running the sample:
1067
+ * // - Enable the API at:
1068
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
1069
+ * // - Login into gcloud by running:
1070
+ * // ```sh
1071
+ * // $ gcloud auth application-default login
1072
+ * // ```
1073
+ * // - Install the npm module by running:
1074
+ * // ```sh
1075
+ * // $ npm install googleapis
1076
+ * // ```
1077
+ *
1078
+ * const {google} = require('googleapis');
1079
+ * const merchantapi = google.merchantapi('conversions_v1');
1080
+ *
1081
+ * async function main() {
1082
+ * const auth = new google.auth.GoogleAuth({
1083
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1084
+ * scopes: ['https://www.googleapis.com/auth/content'],
1085
+ * });
1086
+ *
1087
+ * // Acquire an auth client, and bind it to all future calls
1088
+ * const authClient = await auth.getClient();
1089
+ * google.options({auth: authClient});
1090
+ *
1091
+ * // Do the magic
1092
+ * const res = await merchantapi.accounts.conversionSources.undelete({
1093
+ * // Required. The name of the conversion source to be undeleted. Format: `accounts/{account\}/conversionSources/{conversion_source\}`
1094
+ * name: 'accounts/my-account/conversionSources/my-conversionSource',
1095
+ *
1096
+ * // Request body metadata
1097
+ * requestBody: {
1098
+ * // request body parameters
1099
+ * // {}
1100
+ * },
1101
+ * });
1102
+ * console.log(res.data);
1103
+ *
1104
+ * // Example response
1105
+ * // {
1106
+ * // "controller": "my_controller",
1107
+ * // "expireTime": "my_expireTime",
1108
+ * // "googleAnalyticsLink": {},
1109
+ * // "merchantCenterDestination": {},
1110
+ * // "name": "my_name",
1111
+ * // "state": "my_state"
1112
+ * // }
1113
+ * }
1114
+ *
1115
+ * main().catch(e => {
1116
+ * console.error(e);
1117
+ * throw e;
1118
+ * });
1119
+ *
1120
+ * ```
1121
+ *
1122
+ * @param params - Parameters for request
1123
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1124
+ * @param callback - Optional callback that handles the response.
1125
+ * @returns A promise if used with async/await, or void if used with a callback.
1126
+ */
1127
+ undelete(
1128
+ params: Params$Resource$Accounts$Conversionsources$Undelete,
1129
+ options: StreamMethodOptions
1130
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1131
+ undelete(
1132
+ params?: Params$Resource$Accounts$Conversionsources$Undelete,
1133
+ options?: MethodOptions
1134
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ConversionSource>>;
1135
+ undelete(
1136
+ params: Params$Resource$Accounts$Conversionsources$Undelete,
1137
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1138
+ callback: BodyResponseCallback<Readable>
1139
+ ): void;
1140
+ undelete(
1141
+ params: Params$Resource$Accounts$Conversionsources$Undelete,
1142
+ options: MethodOptions | BodyResponseCallback<Schema$ConversionSource>,
1143
+ callback: BodyResponseCallback<Schema$ConversionSource>
1144
+ ): void;
1145
+ undelete(
1146
+ params: Params$Resource$Accounts$Conversionsources$Undelete,
1147
+ callback: BodyResponseCallback<Schema$ConversionSource>
1148
+ ): void;
1149
+ undelete(callback: BodyResponseCallback<Schema$ConversionSource>): void;
1150
+ undelete(
1151
+ paramsOrCallback?:
1152
+ | Params$Resource$Accounts$Conversionsources$Undelete
1153
+ | BodyResponseCallback<Schema$ConversionSource>
1154
+ | BodyResponseCallback<Readable>,
1155
+ optionsOrCallback?:
1156
+ | MethodOptions
1157
+ | StreamMethodOptions
1158
+ | BodyResponseCallback<Schema$ConversionSource>
1159
+ | BodyResponseCallback<Readable>,
1160
+ callback?:
1161
+ | BodyResponseCallback<Schema$ConversionSource>
1162
+ | BodyResponseCallback<Readable>
1163
+ ):
1164
+ | void
1165
+ | Promise<GaxiosResponseWithHTTP2<Schema$ConversionSource>>
1166
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1167
+ let params = (paramsOrCallback ||
1168
+ {}) as Params$Resource$Accounts$Conversionsources$Undelete;
1169
+ let options = (optionsOrCallback || {}) as MethodOptions;
1170
+
1171
+ if (typeof paramsOrCallback === 'function') {
1172
+ callback = paramsOrCallback;
1173
+ params = {} as Params$Resource$Accounts$Conversionsources$Undelete;
1174
+ options = {};
1175
+ }
1176
+
1177
+ if (typeof optionsOrCallback === 'function') {
1178
+ callback = optionsOrCallback;
1179
+ options = {};
1180
+ }
1181
+
1182
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
1183
+ const parameters = {
1184
+ options: Object.assign(
1185
+ {
1186
+ url: (rootUrl + '/conversions/v1/{+name}:undelete').replace(
1187
+ /([^:]\/)\/+/g,
1188
+ '$1'
1189
+ ),
1190
+ method: 'POST',
1191
+ apiVersion: '',
1192
+ },
1193
+ options
1194
+ ),
1195
+ params,
1196
+ requiredParams: ['name'],
1197
+ pathParams: ['name'],
1198
+ context: this.context,
1199
+ };
1200
+ if (callback) {
1201
+ createAPIRequest<Schema$ConversionSource>(
1202
+ parameters,
1203
+ callback as BodyResponseCallback<unknown>
1204
+ );
1205
+ } else {
1206
+ return createAPIRequest<Schema$ConversionSource>(parameters);
1207
+ }
1208
+ }
1209
+ }
1210
+
1211
+ export interface Params$Resource$Accounts$Conversionsources$Create
1212
+ extends StandardParameters {
1213
+ /**
1214
+ * Required. The merchant account that will own the new conversion source. Format: `accounts/{account\}`
1215
+ */
1216
+ parent?: string;
1217
+
1218
+ /**
1219
+ * Request body metadata
1220
+ */
1221
+ requestBody?: Schema$ConversionSource;
1222
+ }
1223
+ export interface Params$Resource$Accounts$Conversionsources$Delete
1224
+ extends StandardParameters {
1225
+ /**
1226
+ * Required. The name of the conversion source to be deleted. Format: `accounts/{account\}/conversionSources/{conversion_source\}`
1227
+ */
1228
+ name?: string;
1229
+ }
1230
+ export interface Params$Resource$Accounts$Conversionsources$Get
1231
+ extends StandardParameters {
1232
+ /**
1233
+ * Required. The name of the conversion source to be fetched. Format: `accounts/{account\}/conversionSources/{conversion_source\}`
1234
+ */
1235
+ name?: string;
1236
+ }
1237
+ export interface Params$Resource$Accounts$Conversionsources$List
1238
+ extends StandardParameters {
1239
+ /**
1240
+ * Optional. The maximum number of conversion sources to return in a page. If no `page_size` is specified, `100` is used as the default value. The maximum value is `200`. Values above `200` will be coerced to `200`. Regardless of pagination, at most `200` conversion sources are returned in total.
1241
+ */
1242
+ pageSize?: number;
1243
+ /**
1244
+ * Optional. Page token.
1245
+ */
1246
+ pageToken?: string;
1247
+ /**
1248
+ * Required. The merchant account who owns the collection of conversion sources. Format: `accounts/{account\}`
1249
+ */
1250
+ parent?: string;
1251
+ /**
1252
+ * Optional. Show deleted (archived) conversion sources. By default, deleted conversion sources are not returned.
1253
+ */
1254
+ showDeleted?: boolean;
1255
+ }
1256
+ export interface Params$Resource$Accounts$Conversionsources$Patch
1257
+ extends StandardParameters {
1258
+ /**
1259
+ * Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: `[a-z]{4\}:.+` The four characters before the colon represent the type of conversion source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: * `galk`: For GoogleAnalyticsLink sources. * `mcdn`: For MerchantCenterDestination sources.
1260
+ */
1261
+ name?: string;
1262
+ /**
1263
+ * Optional. List of fields being updated.
1264
+ */
1265
+ updateMask?: string;
1266
+
1267
+ /**
1268
+ * Request body metadata
1269
+ */
1270
+ requestBody?: Schema$ConversionSource;
1271
+ }
1272
+ export interface Params$Resource$Accounts$Conversionsources$Undelete
1273
+ extends StandardParameters {
1274
+ /**
1275
+ * Required. The name of the conversion source to be undeleted. Format: `accounts/{account\}/conversionSources/{conversion_source\}`
1276
+ */
1277
+ name?: string;
1278
+
1279
+ /**
1280
+ * Request body metadata
1281
+ */
1282
+ requestBody?: Schema$UndeleteConversionSourceRequest;
1283
+ }
1284
+ }