@googleapis/merchantapi 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +28 -0
  3. package/accounts_v1beta.ts +5692 -0
  4. package/build/accounts_v1beta.d.ts +2492 -0
  5. package/build/accounts_v1beta.js +1421 -0
  6. package/build/accounts_v1beta.js.map +1 -0
  7. package/build/conversions_v1beta.d.ts +406 -0
  8. package/build/conversions_v1beta.js +251 -0
  9. package/build/conversions_v1beta.js.map +1 -0
  10. package/build/datasources_v1beta.d.ts +502 -0
  11. package/build/datasources_v1beta.js +251 -0
  12. package/build/datasources_v1beta.js.map +1 -0
  13. package/build/index.d.ts +57 -0
  14. package/build/index.js +58 -0
  15. package/build/index.js.map +1 -0
  16. package/build/inventories_v1beta.d.ts +456 -0
  17. package/build/inventories_v1beta.js +272 -0
  18. package/build/inventories_v1beta.js.map +1 -0
  19. package/build/lfp_v1beta.d.ts +486 -0
  20. package/build/lfp_v1beta.js +265 -0
  21. package/build/lfp_v1beta.js.map +1 -0
  22. package/build/notifications_v1beta.d.ts +301 -0
  23. package/build/notifications_v1beta.js +224 -0
  24. package/build/notifications_v1beta.js.map +1 -0
  25. package/build/products_v1beta.d.ts +1204 -0
  26. package/build/products_v1beta.js +194 -0
  27. package/build/products_v1beta.js.map +1 -0
  28. package/build/promotions_v1beta.d.ts +524 -0
  29. package/build/promotions_v1beta.js +155 -0
  30. package/build/promotions_v1beta.js.map +1 -0
  31. package/build/quota_v1beta.d.ts +225 -0
  32. package/build/quota_v1beta.js +91 -0
  33. package/build/quota_v1beta.js.map +1 -0
  34. package/build/reports_v1beta.d.ts +1001 -0
  35. package/build/reports_v1beta.js +91 -0
  36. package/build/reports_v1beta.js.map +1 -0
  37. package/conversions_v1beta.ts +926 -0
  38. package/datasources_v1beta.ts +1016 -0
  39. package/index.ts +161 -0
  40. package/inventories_v1beta.ts +1002 -0
  41. package/lfp_v1beta.ts +1012 -0
  42. package/notifications_v1beta.ts +768 -0
  43. package/package.json +43 -0
  44. package/products_v1beta.ts +1573 -0
  45. package/promotions_v1beta.ts +814 -0
  46. package/quota_v1beta.ts +365 -0
  47. package/reports_v1beta.ts +1137 -0
  48. package/tsconfig.json +10 -0
  49. package/webpack.config.js +79 -0
@@ -0,0 +1,926 @@
1
+ // Copyright 2020 Google LLC
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ /* eslint-disable @typescript-eslint/no-explicit-any */
15
+ /* eslint-disable @typescript-eslint/no-unused-vars */
16
+ /* eslint-disable @typescript-eslint/no-empty-interface */
17
+ /* eslint-disable @typescript-eslint/no-namespace */
18
+ /* eslint-disable no-irregular-whitespace */
19
+
20
+ import {
21
+ OAuth2Client,
22
+ JWT,
23
+ Compute,
24
+ UserRefreshClient,
25
+ BaseExternalAccountClient,
26
+ GaxiosPromise,
27
+ GoogleConfigurable,
28
+ createAPIRequest,
29
+ MethodOptions,
30
+ StreamMethodOptions,
31
+ GlobalOptions,
32
+ GoogleAuth,
33
+ BodyResponseCallback,
34
+ APIRequestContext,
35
+ } from 'googleapis-common';
36
+ import {Readable} from 'stream';
37
+
38
+ export namespace merchantapi_conversions_v1beta {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'conversions_v1beta';
41
+ }
42
+
43
+ interface StandardParameters {
44
+ /**
45
+ * Auth client or API Key for the request
46
+ */
47
+ auth?:
48
+ | string
49
+ | OAuth2Client
50
+ | JWT
51
+ | Compute
52
+ | UserRefreshClient
53
+ | BaseExternalAccountClient
54
+ | GoogleAuth;
55
+
56
+ /**
57
+ * V1 error format.
58
+ */
59
+ '$.xgafv'?: string;
60
+ /**
61
+ * OAuth access token.
62
+ */
63
+ access_token?: string;
64
+ /**
65
+ * Data format for response.
66
+ */
67
+ alt?: string;
68
+ /**
69
+ * JSONP
70
+ */
71
+ callback?: string;
72
+ /**
73
+ * Selector specifying which fields to include in a partial response.
74
+ */
75
+ fields?: string;
76
+ /**
77
+ * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
78
+ */
79
+ key?: string;
80
+ /**
81
+ * OAuth 2.0 token for the current user.
82
+ */
83
+ oauth_token?: string;
84
+ /**
85
+ * Returns response with indentations and line breaks.
86
+ */
87
+ prettyPrint?: boolean;
88
+ /**
89
+ * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
90
+ */
91
+ quotaUser?: string;
92
+ /**
93
+ * Legacy upload protocol for media (e.g. "media", "multipart").
94
+ */
95
+ uploadType?: string;
96
+ /**
97
+ * Upload protocol for media (e.g. "raw", "multipart").
98
+ */
99
+ upload_protocol?: string;
100
+ }
101
+
102
+ /**
103
+ * Merchant API
104
+ *
105
+ * Programmatically manage your Merchant Center Accounts.
106
+ *
107
+ * @example
108
+ * ```js
109
+ * const {google} = require('googleapis');
110
+ * const merchantapi = google.merchantapi('conversions_v1beta');
111
+ * ```
112
+ */
113
+ export class Merchantapi {
114
+ context: APIRequestContext;
115
+ accounts: Resource$Accounts;
116
+
117
+ constructor(options: GlobalOptions, google?: GoogleConfigurable) {
118
+ this.context = {
119
+ _options: options || {},
120
+ google,
121
+ };
122
+
123
+ this.accounts = new Resource$Accounts(this.context);
124
+ }
125
+ }
126
+
127
+ /**
128
+ * Represents attribution settings for conversion sources receiving pre-attribution data.
129
+ */
130
+ export interface Schema$AttributionSettings {
131
+ /**
132
+ * Required. Lookback windows (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 conversio 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 a types of conversion events
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 being 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. Limited to 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.
247
+ */
248
+ newValue?: string | null;
249
+ /**
250
+ * The old value of the changed resource or attribute.
251
+ */
252
+ oldValue?: string | null;
253
+ /**
254
+ * Countries that have the change (if applicable)
255
+ */
256
+ regionCode?: string | null;
257
+ /**
258
+ * Reporting contexts that have the change (if applicable)
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 account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id\}`
280
+ */
281
+ managingAccount?: string | null;
282
+ /**
283
+ * The product name. Format: `{product.name=accounts/{account\}/products/{product\}\}`
284
+ */
285
+ resource?: string | null;
286
+ /**
287
+ * The product id.
288
+ */
289
+ resourceId?: string | null;
290
+ /**
291
+ * The resource that changed, in this case it will always be `Product`.
292
+ */
293
+ resourceType?: string | null;
294
+ }
295
+ /**
296
+ * Request message for the UndeleteConversionSource method.
297
+ */
298
+ export interface Schema$UndeleteConversionSourceRequest {}
299
+
300
+ export class Resource$Accounts {
301
+ context: APIRequestContext;
302
+ conversionSources: Resource$Accounts$Conversionsources;
303
+ constructor(context: APIRequestContext) {
304
+ this.context = context;
305
+ this.conversionSources = new Resource$Accounts$Conversionsources(
306
+ this.context
307
+ );
308
+ }
309
+ }
310
+
311
+ export class Resource$Accounts$Conversionsources {
312
+ context: APIRequestContext;
313
+ constructor(context: APIRequestContext) {
314
+ this.context = context;
315
+ }
316
+
317
+ /**
318
+ * Creates a new conversion source.
319
+ *
320
+ * @param params - Parameters for request
321
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
322
+ * @param callback - Optional callback that handles the response.
323
+ * @returns A promise if used with async/await, or void if used with a callback.
324
+ */
325
+ create(
326
+ params: Params$Resource$Accounts$Conversionsources$Create,
327
+ options: StreamMethodOptions
328
+ ): GaxiosPromise<Readable>;
329
+ create(
330
+ params?: Params$Resource$Accounts$Conversionsources$Create,
331
+ options?: MethodOptions
332
+ ): GaxiosPromise<Schema$ConversionSource>;
333
+ create(
334
+ params: Params$Resource$Accounts$Conversionsources$Create,
335
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
336
+ callback: BodyResponseCallback<Readable>
337
+ ): void;
338
+ create(
339
+ params: Params$Resource$Accounts$Conversionsources$Create,
340
+ options: MethodOptions | BodyResponseCallback<Schema$ConversionSource>,
341
+ callback: BodyResponseCallback<Schema$ConversionSource>
342
+ ): void;
343
+ create(
344
+ params: Params$Resource$Accounts$Conversionsources$Create,
345
+ callback: BodyResponseCallback<Schema$ConversionSource>
346
+ ): void;
347
+ create(callback: BodyResponseCallback<Schema$ConversionSource>): void;
348
+ create(
349
+ paramsOrCallback?:
350
+ | Params$Resource$Accounts$Conversionsources$Create
351
+ | BodyResponseCallback<Schema$ConversionSource>
352
+ | BodyResponseCallback<Readable>,
353
+ optionsOrCallback?:
354
+ | MethodOptions
355
+ | StreamMethodOptions
356
+ | BodyResponseCallback<Schema$ConversionSource>
357
+ | BodyResponseCallback<Readable>,
358
+ callback?:
359
+ | BodyResponseCallback<Schema$ConversionSource>
360
+ | BodyResponseCallback<Readable>
361
+ ): void | GaxiosPromise<Schema$ConversionSource> | GaxiosPromise<Readable> {
362
+ let params = (paramsOrCallback ||
363
+ {}) as Params$Resource$Accounts$Conversionsources$Create;
364
+ let options = (optionsOrCallback || {}) as MethodOptions;
365
+
366
+ if (typeof paramsOrCallback === 'function') {
367
+ callback = paramsOrCallback;
368
+ params = {} as Params$Resource$Accounts$Conversionsources$Create;
369
+ options = {};
370
+ }
371
+
372
+ if (typeof optionsOrCallback === 'function') {
373
+ callback = optionsOrCallback;
374
+ options = {};
375
+ }
376
+
377
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
378
+ const parameters = {
379
+ options: Object.assign(
380
+ {
381
+ url: (
382
+ rootUrl + '/conversions/v1beta/{+parent}/conversionSources'
383
+ ).replace(/([^:]\/)\/+/g, '$1'),
384
+ method: 'POST',
385
+ apiVersion: '',
386
+ },
387
+ options
388
+ ),
389
+ params,
390
+ requiredParams: ['parent'],
391
+ pathParams: ['parent'],
392
+ context: this.context,
393
+ };
394
+ if (callback) {
395
+ createAPIRequest<Schema$ConversionSource>(
396
+ parameters,
397
+ callback as BodyResponseCallback<unknown>
398
+ );
399
+ } else {
400
+ return createAPIRequest<Schema$ConversionSource>(parameters);
401
+ }
402
+ }
403
+
404
+ /**
405
+ * 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.
406
+ *
407
+ * @param params - Parameters for request
408
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
409
+ * @param callback - Optional callback that handles the response.
410
+ * @returns A promise if used with async/await, or void if used with a callback.
411
+ */
412
+ delete(
413
+ params: Params$Resource$Accounts$Conversionsources$Delete,
414
+ options: StreamMethodOptions
415
+ ): GaxiosPromise<Readable>;
416
+ delete(
417
+ params?: Params$Resource$Accounts$Conversionsources$Delete,
418
+ options?: MethodOptions
419
+ ): GaxiosPromise<Schema$Empty>;
420
+ delete(
421
+ params: Params$Resource$Accounts$Conversionsources$Delete,
422
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
423
+ callback: BodyResponseCallback<Readable>
424
+ ): void;
425
+ delete(
426
+ params: Params$Resource$Accounts$Conversionsources$Delete,
427
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
428
+ callback: BodyResponseCallback<Schema$Empty>
429
+ ): void;
430
+ delete(
431
+ params: Params$Resource$Accounts$Conversionsources$Delete,
432
+ callback: BodyResponseCallback<Schema$Empty>
433
+ ): void;
434
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
435
+ delete(
436
+ paramsOrCallback?:
437
+ | Params$Resource$Accounts$Conversionsources$Delete
438
+ | BodyResponseCallback<Schema$Empty>
439
+ | BodyResponseCallback<Readable>,
440
+ optionsOrCallback?:
441
+ | MethodOptions
442
+ | StreamMethodOptions
443
+ | BodyResponseCallback<Schema$Empty>
444
+ | BodyResponseCallback<Readable>,
445
+ callback?:
446
+ | BodyResponseCallback<Schema$Empty>
447
+ | BodyResponseCallback<Readable>
448
+ ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
449
+ let params = (paramsOrCallback ||
450
+ {}) as Params$Resource$Accounts$Conversionsources$Delete;
451
+ let options = (optionsOrCallback || {}) as MethodOptions;
452
+
453
+ if (typeof paramsOrCallback === 'function') {
454
+ callback = paramsOrCallback;
455
+ params = {} as Params$Resource$Accounts$Conversionsources$Delete;
456
+ options = {};
457
+ }
458
+
459
+ if (typeof optionsOrCallback === 'function') {
460
+ callback = optionsOrCallback;
461
+ options = {};
462
+ }
463
+
464
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
465
+ const parameters = {
466
+ options: Object.assign(
467
+ {
468
+ url: (rootUrl + '/conversions/v1beta/{+name}').replace(
469
+ /([^:]\/)\/+/g,
470
+ '$1'
471
+ ),
472
+ method: 'DELETE',
473
+ apiVersion: '',
474
+ },
475
+ options
476
+ ),
477
+ params,
478
+ requiredParams: ['name'],
479
+ pathParams: ['name'],
480
+ context: this.context,
481
+ };
482
+ if (callback) {
483
+ createAPIRequest<Schema$Empty>(
484
+ parameters,
485
+ callback as BodyResponseCallback<unknown>
486
+ );
487
+ } else {
488
+ return createAPIRequest<Schema$Empty>(parameters);
489
+ }
490
+ }
491
+
492
+ /**
493
+ * Fetches a conversion source.
494
+ *
495
+ * @param params - Parameters for request
496
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
497
+ * @param callback - Optional callback that handles the response.
498
+ * @returns A promise if used with async/await, or void if used with a callback.
499
+ */
500
+ get(
501
+ params: Params$Resource$Accounts$Conversionsources$Get,
502
+ options: StreamMethodOptions
503
+ ): GaxiosPromise<Readable>;
504
+ get(
505
+ params?: Params$Resource$Accounts$Conversionsources$Get,
506
+ options?: MethodOptions
507
+ ): GaxiosPromise<Schema$ConversionSource>;
508
+ get(
509
+ params: Params$Resource$Accounts$Conversionsources$Get,
510
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
511
+ callback: BodyResponseCallback<Readable>
512
+ ): void;
513
+ get(
514
+ params: Params$Resource$Accounts$Conversionsources$Get,
515
+ options: MethodOptions | BodyResponseCallback<Schema$ConversionSource>,
516
+ callback: BodyResponseCallback<Schema$ConversionSource>
517
+ ): void;
518
+ get(
519
+ params: Params$Resource$Accounts$Conversionsources$Get,
520
+ callback: BodyResponseCallback<Schema$ConversionSource>
521
+ ): void;
522
+ get(callback: BodyResponseCallback<Schema$ConversionSource>): void;
523
+ get(
524
+ paramsOrCallback?:
525
+ | Params$Resource$Accounts$Conversionsources$Get
526
+ | BodyResponseCallback<Schema$ConversionSource>
527
+ | BodyResponseCallback<Readable>,
528
+ optionsOrCallback?:
529
+ | MethodOptions
530
+ | StreamMethodOptions
531
+ | BodyResponseCallback<Schema$ConversionSource>
532
+ | BodyResponseCallback<Readable>,
533
+ callback?:
534
+ | BodyResponseCallback<Schema$ConversionSource>
535
+ | BodyResponseCallback<Readable>
536
+ ): void | GaxiosPromise<Schema$ConversionSource> | GaxiosPromise<Readable> {
537
+ let params = (paramsOrCallback ||
538
+ {}) as Params$Resource$Accounts$Conversionsources$Get;
539
+ let options = (optionsOrCallback || {}) as MethodOptions;
540
+
541
+ if (typeof paramsOrCallback === 'function') {
542
+ callback = paramsOrCallback;
543
+ params = {} as Params$Resource$Accounts$Conversionsources$Get;
544
+ options = {};
545
+ }
546
+
547
+ if (typeof optionsOrCallback === 'function') {
548
+ callback = optionsOrCallback;
549
+ options = {};
550
+ }
551
+
552
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
553
+ const parameters = {
554
+ options: Object.assign(
555
+ {
556
+ url: (rootUrl + '/conversions/v1beta/{+name}').replace(
557
+ /([^:]\/)\/+/g,
558
+ '$1'
559
+ ),
560
+ method: 'GET',
561
+ apiVersion: '',
562
+ },
563
+ options
564
+ ),
565
+ params,
566
+ requiredParams: ['name'],
567
+ pathParams: ['name'],
568
+ context: this.context,
569
+ };
570
+ if (callback) {
571
+ createAPIRequest<Schema$ConversionSource>(
572
+ parameters,
573
+ callback as BodyResponseCallback<unknown>
574
+ );
575
+ } else {
576
+ return createAPIRequest<Schema$ConversionSource>(parameters);
577
+ }
578
+ }
579
+
580
+ /**
581
+ * Retrieves the list of conversion sources the caller has access to.
582
+ *
583
+ * @param params - Parameters for request
584
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
585
+ * @param callback - Optional callback that handles the response.
586
+ * @returns A promise if used with async/await, or void if used with a callback.
587
+ */
588
+ list(
589
+ params: Params$Resource$Accounts$Conversionsources$List,
590
+ options: StreamMethodOptions
591
+ ): GaxiosPromise<Readable>;
592
+ list(
593
+ params?: Params$Resource$Accounts$Conversionsources$List,
594
+ options?: MethodOptions
595
+ ): GaxiosPromise<Schema$ListConversionSourcesResponse>;
596
+ list(
597
+ params: Params$Resource$Accounts$Conversionsources$List,
598
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
599
+ callback: BodyResponseCallback<Readable>
600
+ ): void;
601
+ list(
602
+ params: Params$Resource$Accounts$Conversionsources$List,
603
+ options:
604
+ | MethodOptions
605
+ | BodyResponseCallback<Schema$ListConversionSourcesResponse>,
606
+ callback: BodyResponseCallback<Schema$ListConversionSourcesResponse>
607
+ ): void;
608
+ list(
609
+ params: Params$Resource$Accounts$Conversionsources$List,
610
+ callback: BodyResponseCallback<Schema$ListConversionSourcesResponse>
611
+ ): void;
612
+ list(
613
+ callback: BodyResponseCallback<Schema$ListConversionSourcesResponse>
614
+ ): void;
615
+ list(
616
+ paramsOrCallback?:
617
+ | Params$Resource$Accounts$Conversionsources$List
618
+ | BodyResponseCallback<Schema$ListConversionSourcesResponse>
619
+ | BodyResponseCallback<Readable>,
620
+ optionsOrCallback?:
621
+ | MethodOptions
622
+ | StreamMethodOptions
623
+ | BodyResponseCallback<Schema$ListConversionSourcesResponse>
624
+ | BodyResponseCallback<Readable>,
625
+ callback?:
626
+ | BodyResponseCallback<Schema$ListConversionSourcesResponse>
627
+ | BodyResponseCallback<Readable>
628
+ ):
629
+ | void
630
+ | GaxiosPromise<Schema$ListConversionSourcesResponse>
631
+ | GaxiosPromise<Readable> {
632
+ let params = (paramsOrCallback ||
633
+ {}) as Params$Resource$Accounts$Conversionsources$List;
634
+ let options = (optionsOrCallback || {}) as MethodOptions;
635
+
636
+ if (typeof paramsOrCallback === 'function') {
637
+ callback = paramsOrCallback;
638
+ params = {} as Params$Resource$Accounts$Conversionsources$List;
639
+ options = {};
640
+ }
641
+
642
+ if (typeof optionsOrCallback === 'function') {
643
+ callback = optionsOrCallback;
644
+ options = {};
645
+ }
646
+
647
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
648
+ const parameters = {
649
+ options: Object.assign(
650
+ {
651
+ url: (
652
+ rootUrl + '/conversions/v1beta/{+parent}/conversionSources'
653
+ ).replace(/([^:]\/)\/+/g, '$1'),
654
+ method: 'GET',
655
+ apiVersion: '',
656
+ },
657
+ options
658
+ ),
659
+ params,
660
+ requiredParams: ['parent'],
661
+ pathParams: ['parent'],
662
+ context: this.context,
663
+ };
664
+ if (callback) {
665
+ createAPIRequest<Schema$ListConversionSourcesResponse>(
666
+ parameters,
667
+ callback as BodyResponseCallback<unknown>
668
+ );
669
+ } else {
670
+ return createAPIRequest<Schema$ListConversionSourcesResponse>(
671
+ parameters
672
+ );
673
+ }
674
+ }
675
+
676
+ /**
677
+ * Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.
678
+ *
679
+ * @param params - Parameters for request
680
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
681
+ * @param callback - Optional callback that handles the response.
682
+ * @returns A promise if used with async/await, or void if used with a callback.
683
+ */
684
+ patch(
685
+ params: Params$Resource$Accounts$Conversionsources$Patch,
686
+ options: StreamMethodOptions
687
+ ): GaxiosPromise<Readable>;
688
+ patch(
689
+ params?: Params$Resource$Accounts$Conversionsources$Patch,
690
+ options?: MethodOptions
691
+ ): GaxiosPromise<Schema$ConversionSource>;
692
+ patch(
693
+ params: Params$Resource$Accounts$Conversionsources$Patch,
694
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
695
+ callback: BodyResponseCallback<Readable>
696
+ ): void;
697
+ patch(
698
+ params: Params$Resource$Accounts$Conversionsources$Patch,
699
+ options: MethodOptions | BodyResponseCallback<Schema$ConversionSource>,
700
+ callback: BodyResponseCallback<Schema$ConversionSource>
701
+ ): void;
702
+ patch(
703
+ params: Params$Resource$Accounts$Conversionsources$Patch,
704
+ callback: BodyResponseCallback<Schema$ConversionSource>
705
+ ): void;
706
+ patch(callback: BodyResponseCallback<Schema$ConversionSource>): void;
707
+ patch(
708
+ paramsOrCallback?:
709
+ | Params$Resource$Accounts$Conversionsources$Patch
710
+ | BodyResponseCallback<Schema$ConversionSource>
711
+ | BodyResponseCallback<Readable>,
712
+ optionsOrCallback?:
713
+ | MethodOptions
714
+ | StreamMethodOptions
715
+ | BodyResponseCallback<Schema$ConversionSource>
716
+ | BodyResponseCallback<Readable>,
717
+ callback?:
718
+ | BodyResponseCallback<Schema$ConversionSource>
719
+ | BodyResponseCallback<Readable>
720
+ ): void | GaxiosPromise<Schema$ConversionSource> | GaxiosPromise<Readable> {
721
+ let params = (paramsOrCallback ||
722
+ {}) as Params$Resource$Accounts$Conversionsources$Patch;
723
+ let options = (optionsOrCallback || {}) as MethodOptions;
724
+
725
+ if (typeof paramsOrCallback === 'function') {
726
+ callback = paramsOrCallback;
727
+ params = {} as Params$Resource$Accounts$Conversionsources$Patch;
728
+ options = {};
729
+ }
730
+
731
+ if (typeof optionsOrCallback === 'function') {
732
+ callback = optionsOrCallback;
733
+ options = {};
734
+ }
735
+
736
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
737
+ const parameters = {
738
+ options: Object.assign(
739
+ {
740
+ url: (rootUrl + '/conversions/v1beta/{+name}').replace(
741
+ /([^:]\/)\/+/g,
742
+ '$1'
743
+ ),
744
+ method: 'PATCH',
745
+ apiVersion: '',
746
+ },
747
+ options
748
+ ),
749
+ params,
750
+ requiredParams: ['name'],
751
+ pathParams: ['name'],
752
+ context: this.context,
753
+ };
754
+ if (callback) {
755
+ createAPIRequest<Schema$ConversionSource>(
756
+ parameters,
757
+ callback as BodyResponseCallback<unknown>
758
+ );
759
+ } else {
760
+ return createAPIRequest<Schema$ConversionSource>(parameters);
761
+ }
762
+ }
763
+
764
+ /**
765
+ * Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources.
766
+ *
767
+ * @param params - Parameters for request
768
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
769
+ * @param callback - Optional callback that handles the response.
770
+ * @returns A promise if used with async/await, or void if used with a callback.
771
+ */
772
+ undelete(
773
+ params: Params$Resource$Accounts$Conversionsources$Undelete,
774
+ options: StreamMethodOptions
775
+ ): GaxiosPromise<Readable>;
776
+ undelete(
777
+ params?: Params$Resource$Accounts$Conversionsources$Undelete,
778
+ options?: MethodOptions
779
+ ): GaxiosPromise<Schema$ConversionSource>;
780
+ undelete(
781
+ params: Params$Resource$Accounts$Conversionsources$Undelete,
782
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
783
+ callback: BodyResponseCallback<Readable>
784
+ ): void;
785
+ undelete(
786
+ params: Params$Resource$Accounts$Conversionsources$Undelete,
787
+ options: MethodOptions | BodyResponseCallback<Schema$ConversionSource>,
788
+ callback: BodyResponseCallback<Schema$ConversionSource>
789
+ ): void;
790
+ undelete(
791
+ params: Params$Resource$Accounts$Conversionsources$Undelete,
792
+ callback: BodyResponseCallback<Schema$ConversionSource>
793
+ ): void;
794
+ undelete(callback: BodyResponseCallback<Schema$ConversionSource>): void;
795
+ undelete(
796
+ paramsOrCallback?:
797
+ | Params$Resource$Accounts$Conversionsources$Undelete
798
+ | BodyResponseCallback<Schema$ConversionSource>
799
+ | BodyResponseCallback<Readable>,
800
+ optionsOrCallback?:
801
+ | MethodOptions
802
+ | StreamMethodOptions
803
+ | BodyResponseCallback<Schema$ConversionSource>
804
+ | BodyResponseCallback<Readable>,
805
+ callback?:
806
+ | BodyResponseCallback<Schema$ConversionSource>
807
+ | BodyResponseCallback<Readable>
808
+ ): void | GaxiosPromise<Schema$ConversionSource> | GaxiosPromise<Readable> {
809
+ let params = (paramsOrCallback ||
810
+ {}) as Params$Resource$Accounts$Conversionsources$Undelete;
811
+ let options = (optionsOrCallback || {}) as MethodOptions;
812
+
813
+ if (typeof paramsOrCallback === 'function') {
814
+ callback = paramsOrCallback;
815
+ params = {} as Params$Resource$Accounts$Conversionsources$Undelete;
816
+ options = {};
817
+ }
818
+
819
+ if (typeof optionsOrCallback === 'function') {
820
+ callback = optionsOrCallback;
821
+ options = {};
822
+ }
823
+
824
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
825
+ const parameters = {
826
+ options: Object.assign(
827
+ {
828
+ url: (rootUrl + '/conversions/v1beta/{+name}:undelete').replace(
829
+ /([^:]\/)\/+/g,
830
+ '$1'
831
+ ),
832
+ method: 'POST',
833
+ apiVersion: '',
834
+ },
835
+ options
836
+ ),
837
+ params,
838
+ requiredParams: ['name'],
839
+ pathParams: ['name'],
840
+ context: this.context,
841
+ };
842
+ if (callback) {
843
+ createAPIRequest<Schema$ConversionSource>(
844
+ parameters,
845
+ callback as BodyResponseCallback<unknown>
846
+ );
847
+ } else {
848
+ return createAPIRequest<Schema$ConversionSource>(parameters);
849
+ }
850
+ }
851
+ }
852
+
853
+ export interface Params$Resource$Accounts$Conversionsources$Create
854
+ extends StandardParameters {
855
+ /**
856
+ * Required. The merchant account that will own the new conversion source. Format: accounts/{account\}
857
+ */
858
+ parent?: string;
859
+
860
+ /**
861
+ * Request body metadata
862
+ */
863
+ requestBody?: Schema$ConversionSource;
864
+ }
865
+ export interface Params$Resource$Accounts$Conversionsources$Delete
866
+ extends StandardParameters {
867
+ /**
868
+ * Required. The name of the conversion source to be deleted. Format: accounts/{account\}/conversionSources/{conversion_source\}
869
+ */
870
+ name?: string;
871
+ }
872
+ export interface Params$Resource$Accounts$Conversionsources$Get
873
+ extends StandardParameters {
874
+ /**
875
+ * Required. The name of the conversion source to be fetched. Format: accounts/{account\}/conversionsources/{conversion_source\}
876
+ */
877
+ name?: string;
878
+ }
879
+ export interface Params$Resource$Accounts$Conversionsources$List
880
+ extends StandardParameters {
881
+ /**
882
+ * 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.
883
+ */
884
+ pageSize?: number;
885
+ /**
886
+ * Optional. Page token.
887
+ */
888
+ pageToken?: string;
889
+ /**
890
+ * Required. The merchant account who owns the collection of conversion sources. Format: accounts/{account\}
891
+ */
892
+ parent?: string;
893
+ /**
894
+ * Optional. Show deleted (archived) option.
895
+ */
896
+ showDeleted?: boolean;
897
+ }
898
+ export interface Params$Resource$Accounts$Conversionsources$Patch
899
+ extends StandardParameters {
900
+ /**
901
+ * 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 conversio 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.
902
+ */
903
+ name?: string;
904
+ /**
905
+ * Required. List of fields being updated.
906
+ */
907
+ updateMask?: string;
908
+
909
+ /**
910
+ * Request body metadata
911
+ */
912
+ requestBody?: Schema$ConversionSource;
913
+ }
914
+ export interface Params$Resource$Accounts$Conversionsources$Undelete
915
+ extends StandardParameters {
916
+ /**
917
+ * Required. The name of the conversion source to be undeleted. Format: accounts/{account\}/conversionSources/{conversion_source\}
918
+ */
919
+ name?: string;
920
+
921
+ /**
922
+ * Request body metadata
923
+ */
924
+ requestBody?: Schema$UndeleteConversionSourceRequest;
925
+ }
926
+ }