@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,1690 @@
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_datasources_v1 {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'datasources_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('datasources_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
+ * The [data source](/merchant/api/guides/data-sources/overview) for the Merchant Center account.
129
+ */
130
+ export interface Schema$DataSource {
131
+ /**
132
+ * Output only. The data source id.
133
+ */
134
+ dataSourceId?: string | null;
135
+ /**
136
+ * Required. The displayed data source name in the Merchant Center UI.
137
+ */
138
+ displayName?: string | null;
139
+ /**
140
+ * Optional. The field is used only when data is managed through a file.
141
+ */
142
+ fileInput?: Schema$FileInput;
143
+ /**
144
+ * Output only. Determines the type of input to the data source. Based on the input some settings might not work. Only generic data sources can be created through the API.
145
+ */
146
+ input?: string | null;
147
+ /**
148
+ * The [local inventory](https://support.google.com/merchants/answer/7023001) data source.
149
+ */
150
+ localInventoryDataSource?: Schema$LocalInventoryDataSource;
151
+ /**
152
+ * The [merchant review](https://support.google.com/merchants/answer/7045996) data source.
153
+ */
154
+ merchantReviewDataSource?: Schema$MerchantReviewDataSource;
155
+ /**
156
+ * Required. Identifier. The name of the data source. Format: `accounts/{account\}/dataSources/{datasource\}`
157
+ */
158
+ name?: string | null;
159
+ /**
160
+ * The [primary data source](https://support.google.com/merchants/answer/7439058) for local and online products.
161
+ */
162
+ primaryProductDataSource?: Schema$PrimaryProductDataSource;
163
+ /**
164
+ * The [product review](https://support.google.com/merchants/answer/7045996) data source.
165
+ */
166
+ productReviewDataSource?: Schema$ProductReviewDataSource;
167
+ /**
168
+ * The [promotion](https://support.google.com/merchants/answer/2906014) data source.
169
+ */
170
+ promotionDataSource?: Schema$PromotionDataSource;
171
+ /**
172
+ * The [regional inventory](https://support.google.com/merchants/answer/7439058) data source.
173
+ */
174
+ regionalInventoryDataSource?: Schema$RegionalInventoryDataSource;
175
+ /**
176
+ * The [supplemental data source](https://support.google.com/merchants/answer/7439058) for local and online products.
177
+ */
178
+ supplementalProductDataSource?: Schema$SupplementalProductDataSource;
179
+ }
180
+ /**
181
+ * Data source reference can be used to manage related data sources within the data source service.
182
+ */
183
+ export interface Schema$DataSourceReference {
184
+ /**
185
+ * Optional. The name of the primary data source. Format: `accounts/{account\}/dataSources/{datasource\}`
186
+ */
187
+ primaryDataSourceName?: string | null;
188
+ /**
189
+ * Self should be used to reference the primary data source itself.
190
+ */
191
+ self?: boolean | null;
192
+ /**
193
+ * Optional. The name of the supplemental data source. Format: `accounts/{account\}/dataSources/{datasource\}`
194
+ */
195
+ supplementalDataSourceName?: string | null;
196
+ }
197
+ /**
198
+ * Default rule management of the data source.
199
+ */
200
+ export interface Schema$DefaultRule {
201
+ /**
202
+ * Required. The list of data sources linked in the [default rule](https://support.google.com/merchants/answer/7450276). This list is ordered by the default rule priority of joining the data. It might include none or multiple references to `self` and supplemental data sources. The list must not be empty. To link the data source to the default rule, you need to add a new reference to this list (in sequential order). To unlink the data source from the default rule, you need to remove the given reference from this list. Changing the order of this list will result in changing the priority of data sources in the default rule. For example, providing the following list: [`1001`, `self`] will take attribute values from supplemental data source `1001`, and fallback to `self` if the attribute is not set in `1001`.
203
+ */
204
+ takeFromDataSources?: Schema$DataSourceReference[];
205
+ }
206
+ /**
207
+ * Destinations also known as [Marketing methods](https://support.google.com/merchants/answer/15130232) selections.
208
+ */
209
+ export interface Schema$Destination {
210
+ /**
211
+ * [Marketing methods](https://support.google.com/merchants/answer/15130232) (also known as destination) selections.
212
+ */
213
+ destination?: string | null;
214
+ /**
215
+ * The state of the destination.
216
+ */
217
+ state?: string | null;
218
+ }
219
+ /**
220
+ * 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); \}
221
+ */
222
+ export interface Schema$Empty {}
223
+ /**
224
+ * Request message for the FetchDataSource method.
225
+ */
226
+ export interface Schema$FetchDataSourceRequest {}
227
+ /**
228
+ * Fetch details to deliver the data source.
229
+ */
230
+ export interface Schema$FetchSettings {
231
+ /**
232
+ * Optional. The day of the month when the data source file should be fetched (1-31). This field can only be set for monthly frequency.
233
+ */
234
+ dayOfMonth?: number | null;
235
+ /**
236
+ * Optional. The day of the week when the data source file should be fetched. This field can only be set for weekly frequency.
237
+ */
238
+ dayOfWeek?: string | null;
239
+ /**
240
+ * Optional. Enables or pauses the fetch schedule.
241
+ */
242
+ enabled?: boolean | null;
243
+ /**
244
+ * Optional. The URL where the data source file can be fetched. Google Merchant Center supports automatic scheduled uploads using the HTTP, HTTPS or SFTP protocols, so the value will need to be a valid link using one of those three protocols. Immutable for Google Sheets files.
245
+ */
246
+ fetchUri?: string | null;
247
+ /**
248
+ * Required. The frequency describing fetch schedule.
249
+ */
250
+ frequency?: string | null;
251
+ /**
252
+ * Optional. An optional password for fetch_uri. Used for [submitting data sources through SFTP](https://support.google.com/merchants/answer/13813117).
253
+ */
254
+ password?: string | null;
255
+ /**
256
+ * Optional. The hour of the day when the data source file should be fetched. Minutes and seconds are not supported and will be ignored.
257
+ */
258
+ timeOfDay?: Schema$TimeOfDay;
259
+ /**
260
+ * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by default. For example, "America/Los_Angeles".
261
+ */
262
+ timeZone?: string | null;
263
+ /**
264
+ * Optional. An optional user name for fetch_uri. Used for [submitting data sources through SFTP](https://support.google.com/merchants/answer/13813117).
265
+ */
266
+ username?: string | null;
267
+ }
268
+ /**
269
+ * The data specific for file data sources. This field is empty for other data source inputs.
270
+ */
271
+ export interface Schema$FileInput {
272
+ /**
273
+ * Optional. Fetch details to deliver the data source. It contains settings for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary based on the frequency of fetching.
274
+ */
275
+ fetchSettings?: Schema$FetchSettings;
276
+ /**
277
+ * Output only. The type of file input.
278
+ */
279
+ fileInputType?: string | null;
280
+ /**
281
+ * Optional. The file name of the data source. Required for `UPLOAD` file input type.
282
+ */
283
+ fileName?: string | null;
284
+ }
285
+ /**
286
+ * The file upload of a specific data source, that is, the result of the retrieval of the data source at a certain timestamp computed asynchronously when the data source processing is finished. Only applicable to file data sources.
287
+ */
288
+ export interface Schema$FileUpload {
289
+ /**
290
+ * Output only. The data source id.
291
+ */
292
+ dataSourceId?: string | null;
293
+ /**
294
+ * Output only. The list of issues occurring in the data source.
295
+ */
296
+ issues?: Schema$Issue[];
297
+ /**
298
+ * Output only. The number of items in the data source that were created.
299
+ */
300
+ itemsCreated?: string | null;
301
+ /**
302
+ * Output only. The number of items in the data source that were processed.
303
+ */
304
+ itemsTotal?: string | null;
305
+ /**
306
+ * Output only. The number of items in the data source that were updated.
307
+ */
308
+ itemsUpdated?: string | null;
309
+ /**
310
+ * Identifier. The name of the data source file upload. Format: `{datasource.name=accounts/{account\}/dataSources/{datasource\}/fileUploads/{fileupload\}\}`
311
+ */
312
+ name?: string | null;
313
+ /**
314
+ * Output only. The processing state of the data source.
315
+ */
316
+ processingState?: string | null;
317
+ /**
318
+ * Output only. The date at which the file of the data source was uploaded.
319
+ */
320
+ uploadTime?: string | null;
321
+ }
322
+ /**
323
+ * An error occurring in the data source, like "invalid price".
324
+ */
325
+ export interface Schema$Issue {
326
+ /**
327
+ * Output only. The code of the error, for example, "validation/invalid_value". Returns "?" if the code is unknown.
328
+ */
329
+ code?: string | null;
330
+ /**
331
+ * Output only. The number of occurrences of the error in the file upload.
332
+ */
333
+ count?: string | null;
334
+ /**
335
+ * Output only. The error description, for example, "Your data source contains items which have too many attributes, or are too big. These items will be dropped".
336
+ */
337
+ description?: string | null;
338
+ /**
339
+ * Output only. Link to the documentation explaining the issue in more details, if available.
340
+ */
341
+ documentationUri?: string | null;
342
+ /**
343
+ * Output only. The severity of the issue.
344
+ */
345
+ severity?: string | null;
346
+ /**
347
+ * Output only. The title of the issue, for example, "Item too big".
348
+ */
349
+ title?: string | null;
350
+ }
351
+ /**
352
+ * Response message for the ListDataSources method.
353
+ */
354
+ export interface Schema$ListDataSourcesResponse {
355
+ /**
356
+ * The data sources from the specified account.
357
+ */
358
+ dataSources?: Schema$DataSource[];
359
+ /**
360
+ * A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
361
+ */
362
+ nextPageToken?: string | null;
363
+ }
364
+ /**
365
+ * The local inventory data source type is only available for file inputs and can't be used to create API local inventory data sources.
366
+ */
367
+ export interface Schema$LocalInventoryDataSource {
368
+ /**
369
+ * Required. Immutable. The two-letter ISO 639-1 language of the items to which the local inventory is provided.
370
+ */
371
+ contentLanguage?: string | null;
372
+ /**
373
+ * Required. Immutable. The feed label of the offers to which the local inventory is provided. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). See also [migration to feed labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
374
+ */
375
+ feedLabel?: string | null;
376
+ }
377
+ /**
378
+ * The merchant review data source.
379
+ */
380
+ export interface Schema$MerchantReviewDataSource {}
381
+ /**
382
+ * The primary data source for local and online products.
383
+ */
384
+ export interface Schema$PrimaryProductDataSource {
385
+ /**
386
+ * Optional. Immutable. The two-letter ISO 639-1 language of the items in the data source. `feedLabel` and `contentLanguage` must be either both set or unset. The fields can only be unset for data sources without file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept products without that restriction.
387
+ */
388
+ contentLanguage?: string | null;
389
+ /**
390
+ * Optional. The countries where the items may be displayed. Represented as a [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
391
+ */
392
+ countries?: string[] | null;
393
+ /**
394
+ * Optional. Default rule management of the data source. If set, the linked data sources will be replaced.
395
+ */
396
+ defaultRule?: Schema$DefaultRule;
397
+ /**
398
+ * Optional. A list of destinations describing where products of the data source can be shown. When retrieving the data source, the list contains all the destinations that can be used for the data source, including the ones that are disabled for the data source but enabled for the account. Only destinations that are enabled on the account, for example through program participation, can be enabled on the data source. If unset, during creation, the destinations will be inherited based on the account level program participation. If set, during creation or update, the data source will be set only for the specified destinations. Updating this field requires at least one destination.
399
+ */
400
+ destinations?: Schema$Destination[];
401
+ /**
402
+ * Optional. Immutable. The feed label that is specified on the data source level. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). See also [migration to feed labels](https://developers.google.com/shopping-content/guides/products/feed-labels). `feedLabel` and `contentLanguage` must be either both set or unset for data sources with product content type. They must be set for data sources with a file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept products without that restriction.
403
+ */
404
+ feedLabel?: string | null;
405
+ /**
406
+ * Optional. Immutable. Determines whether the products of this data source are **only** targeting local destinations. Legacy local products are prefixed with `local~` in the product resource ID. For example, `accounts/123/products/local~en~US~sku123`.
407
+ */
408
+ legacyLocal?: boolean | null;
409
+ }
410
+ /**
411
+ * The change that happened to the product including old value, new value, country code as the region code and reporting context.
412
+ */
413
+ export interface Schema$ProductChange {
414
+ /**
415
+ * 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`, ``)
416
+ */
417
+ newValue?: string | null;
418
+ /**
419
+ * 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`, ``)
420
+ */
421
+ oldValue?: string | null;
422
+ /**
423
+ * Countries that have the change (if applicable). Represented in the ISO 3166 format.
424
+ */
425
+ regionCode?: string | null;
426
+ /**
427
+ * 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)
428
+ */
429
+ reportingContext?: string | null;
430
+ }
431
+ /**
432
+ * The product review data source.
433
+ */
434
+ export interface Schema$ProductReviewDataSource {}
435
+ /**
436
+ * The message that the merchant will receive to notify about product status change event
437
+ */
438
+ export interface Schema$ProductStatusChangeMessage {
439
+ /**
440
+ * The target account that owns the entity that changed. Format : `accounts/{merchant_id\}`
441
+ */
442
+ account?: string | null;
443
+ /**
444
+ * The attribute in the resource that changed, in this case it will be always `Status`.
445
+ */
446
+ attribute?: string | null;
447
+ /**
448
+ * A message to describe the change that happened to the product
449
+ */
450
+ changes?: Schema$ProductChange[];
451
+ /**
452
+ * 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.
453
+ */
454
+ eventTime?: string | null;
455
+ /**
456
+ * Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.
457
+ */
458
+ expirationTime?: string | null;
459
+ /**
460
+ * 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\}`
461
+ */
462
+ managingAccount?: string | null;
463
+ /**
464
+ * The product name. Format: `accounts/{account\}/products/{product\}`
465
+ */
466
+ resource?: string | null;
467
+ /**
468
+ * The product id.
469
+ */
470
+ resourceId?: string | null;
471
+ /**
472
+ * The resource that changed, in this case it will always be `Product`.
473
+ */
474
+ resourceType?: string | null;
475
+ }
476
+ /**
477
+ * The promotion data source.
478
+ */
479
+ export interface Schema$PromotionDataSource {
480
+ /**
481
+ * Required. Immutable. The two-letter ISO 639-1 language of the items in the data source.
482
+ */
483
+ contentLanguage?: string | null;
484
+ /**
485
+ * Required. Immutable. The target country used as part of the unique identifier. Represented as a [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). Promotions are only available in selected [countries](https://support.google.com/merchants/answer/4588460).
486
+ */
487
+ targetCountry?: string | null;
488
+ }
489
+ export interface Schema$RegionalInventoryDataSource {
490
+ /**
491
+ * Required. Immutable. The two-letter ISO 639-1 language of the items to which the regional inventory is provided.
492
+ */
493
+ contentLanguage?: string | null;
494
+ /**
495
+ * Required. Immutable. The feed label of the offers to which the regional inventory is provided. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). See also [migration to feed labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
496
+ */
497
+ feedLabel?: string | null;
498
+ }
499
+ /**
500
+ * The supplemental data source for local and online products. After creation, you should make sure to link the supplemental product data source into one or more primary product data sources.
501
+ */
502
+ export interface Schema$SupplementalProductDataSource {
503
+ /**
504
+ * Optional. Immutable. The two-letter ISO 639-1 language of the items in the data source. `feedLabel` and `contentLanguage` must be either both set or unset. The fields can only be unset for data sources without file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept produts without that restriction.
505
+ */
506
+ contentLanguage?: string | null;
507
+ /**
508
+ * Optional. Immutable. The feed label that is specified on the data source level. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). See also [migration to feed labels](https://developers.google.com/shopping-content/guides/products/feed-labels). `feedLabel` and `contentLanguage` must be either both set or unset for data sources with product content type. They must be set for data sources with a file input. The fields must be unset for data sources without file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept produts without that restriction.
509
+ */
510
+ feedLabel?: string | null;
511
+ /**
512
+ * Output only. The (unordered and deduplicated) list of all primary data sources linked to this data source in either default or custom rules. Supplemental data source cannot be deleted before all links are removed.
513
+ */
514
+ referencingPrimaryDataSources?: Schema$DataSourceReference[];
515
+ }
516
+ /**
517
+ * Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.
518
+ */
519
+ export interface Schema$TimeOfDay {
520
+ /**
521
+ * Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.
522
+ */
523
+ hours?: number | null;
524
+ /**
525
+ * Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59.
526
+ */
527
+ minutes?: number | null;
528
+ /**
529
+ * Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999.
530
+ */
531
+ nanos?: number | null;
532
+ /**
533
+ * Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds.
534
+ */
535
+ seconds?: number | null;
536
+ }
537
+
538
+ export class Resource$Accounts {
539
+ context: APIRequestContext;
540
+ dataSources: Resource$Accounts$Datasources;
541
+ constructor(context: APIRequestContext) {
542
+ this.context = context;
543
+ this.dataSources = new Resource$Accounts$Datasources(this.context);
544
+ }
545
+ }
546
+
547
+ export class Resource$Accounts$Datasources {
548
+ context: APIRequestContext;
549
+ fileUploads: Resource$Accounts$Datasources$Fileuploads;
550
+ constructor(context: APIRequestContext) {
551
+ this.context = context;
552
+ this.fileUploads = new Resource$Accounts$Datasources$Fileuploads(
553
+ this.context
554
+ );
555
+ }
556
+
557
+ /**
558
+ * Creates the new data source configuration for the given account. This method always creates a new data source.
559
+ * @example
560
+ * ```js
561
+ * // Before running the sample:
562
+ * // - Enable the API at:
563
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
564
+ * // - Login into gcloud by running:
565
+ * // ```sh
566
+ * // $ gcloud auth application-default login
567
+ * // ```
568
+ * // - Install the npm module by running:
569
+ * // ```sh
570
+ * // $ npm install googleapis
571
+ * // ```
572
+ *
573
+ * const {google} = require('googleapis');
574
+ * const merchantapi = google.merchantapi('datasources_v1');
575
+ *
576
+ * async function main() {
577
+ * const auth = new google.auth.GoogleAuth({
578
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
579
+ * scopes: ['https://www.googleapis.com/auth/content'],
580
+ * });
581
+ *
582
+ * // Acquire an auth client, and bind it to all future calls
583
+ * const authClient = await auth.getClient();
584
+ * google.options({auth: authClient});
585
+ *
586
+ * // Do the magic
587
+ * const res = await merchantapi.accounts.dataSources.create({
588
+ * // Required. The account where this data source will be created. Format: `accounts/{account\}`
589
+ * parent: 'accounts/my-account',
590
+ *
591
+ * // Request body metadata
592
+ * requestBody: {
593
+ * // request body parameters
594
+ * // {
595
+ * // "dataSourceId": "my_dataSourceId",
596
+ * // "displayName": "my_displayName",
597
+ * // "fileInput": {},
598
+ * // "input": "my_input",
599
+ * // "localInventoryDataSource": {},
600
+ * // "merchantReviewDataSource": {},
601
+ * // "name": "my_name",
602
+ * // "primaryProductDataSource": {},
603
+ * // "productReviewDataSource": {},
604
+ * // "promotionDataSource": {},
605
+ * // "regionalInventoryDataSource": {},
606
+ * // "supplementalProductDataSource": {}
607
+ * // }
608
+ * },
609
+ * });
610
+ * console.log(res.data);
611
+ *
612
+ * // Example response
613
+ * // {
614
+ * // "dataSourceId": "my_dataSourceId",
615
+ * // "displayName": "my_displayName",
616
+ * // "fileInput": {},
617
+ * // "input": "my_input",
618
+ * // "localInventoryDataSource": {},
619
+ * // "merchantReviewDataSource": {},
620
+ * // "name": "my_name",
621
+ * // "primaryProductDataSource": {},
622
+ * // "productReviewDataSource": {},
623
+ * // "promotionDataSource": {},
624
+ * // "regionalInventoryDataSource": {},
625
+ * // "supplementalProductDataSource": {}
626
+ * // }
627
+ * }
628
+ *
629
+ * main().catch(e => {
630
+ * console.error(e);
631
+ * throw e;
632
+ * });
633
+ *
634
+ * ```
635
+ *
636
+ * @param params - Parameters for request
637
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
638
+ * @param callback - Optional callback that handles the response.
639
+ * @returns A promise if used with async/await, or void if used with a callback.
640
+ */
641
+ create(
642
+ params: Params$Resource$Accounts$Datasources$Create,
643
+ options: StreamMethodOptions
644
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
645
+ create(
646
+ params?: Params$Resource$Accounts$Datasources$Create,
647
+ options?: MethodOptions
648
+ ): Promise<GaxiosResponseWithHTTP2<Schema$DataSource>>;
649
+ create(
650
+ params: Params$Resource$Accounts$Datasources$Create,
651
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
652
+ callback: BodyResponseCallback<Readable>
653
+ ): void;
654
+ create(
655
+ params: Params$Resource$Accounts$Datasources$Create,
656
+ options: MethodOptions | BodyResponseCallback<Schema$DataSource>,
657
+ callback: BodyResponseCallback<Schema$DataSource>
658
+ ): void;
659
+ create(
660
+ params: Params$Resource$Accounts$Datasources$Create,
661
+ callback: BodyResponseCallback<Schema$DataSource>
662
+ ): void;
663
+ create(callback: BodyResponseCallback<Schema$DataSource>): void;
664
+ create(
665
+ paramsOrCallback?:
666
+ | Params$Resource$Accounts$Datasources$Create
667
+ | BodyResponseCallback<Schema$DataSource>
668
+ | BodyResponseCallback<Readable>,
669
+ optionsOrCallback?:
670
+ | MethodOptions
671
+ | StreamMethodOptions
672
+ | BodyResponseCallback<Schema$DataSource>
673
+ | BodyResponseCallback<Readable>,
674
+ callback?:
675
+ | BodyResponseCallback<Schema$DataSource>
676
+ | BodyResponseCallback<Readable>
677
+ ):
678
+ | void
679
+ | Promise<GaxiosResponseWithHTTP2<Schema$DataSource>>
680
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
681
+ let params = (paramsOrCallback ||
682
+ {}) as Params$Resource$Accounts$Datasources$Create;
683
+ let options = (optionsOrCallback || {}) as MethodOptions;
684
+
685
+ if (typeof paramsOrCallback === 'function') {
686
+ callback = paramsOrCallback;
687
+ params = {} as Params$Resource$Accounts$Datasources$Create;
688
+ options = {};
689
+ }
690
+
691
+ if (typeof optionsOrCallback === 'function') {
692
+ callback = optionsOrCallback;
693
+ options = {};
694
+ }
695
+
696
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
697
+ const parameters = {
698
+ options: Object.assign(
699
+ {
700
+ url: (rootUrl + '/datasources/v1/{+parent}/dataSources').replace(
701
+ /([^:]\/)\/+/g,
702
+ '$1'
703
+ ),
704
+ method: 'POST',
705
+ apiVersion: '',
706
+ },
707
+ options
708
+ ),
709
+ params,
710
+ requiredParams: ['parent'],
711
+ pathParams: ['parent'],
712
+ context: this.context,
713
+ };
714
+ if (callback) {
715
+ createAPIRequest<Schema$DataSource>(
716
+ parameters,
717
+ callback as BodyResponseCallback<unknown>
718
+ );
719
+ } else {
720
+ return createAPIRequest<Schema$DataSource>(parameters);
721
+ }
722
+ }
723
+
724
+ /**
725
+ * Deletes a data source from your Merchant Center account.
726
+ * @example
727
+ * ```js
728
+ * // Before running the sample:
729
+ * // - Enable the API at:
730
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
731
+ * // - Login into gcloud by running:
732
+ * // ```sh
733
+ * // $ gcloud auth application-default login
734
+ * // ```
735
+ * // - Install the npm module by running:
736
+ * // ```sh
737
+ * // $ npm install googleapis
738
+ * // ```
739
+ *
740
+ * const {google} = require('googleapis');
741
+ * const merchantapi = google.merchantapi('datasources_v1');
742
+ *
743
+ * async function main() {
744
+ * const auth = new google.auth.GoogleAuth({
745
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
746
+ * scopes: ['https://www.googleapis.com/auth/content'],
747
+ * });
748
+ *
749
+ * // Acquire an auth client, and bind it to all future calls
750
+ * const authClient = await auth.getClient();
751
+ * google.options({auth: authClient});
752
+ *
753
+ * // Do the magic
754
+ * const res = await merchantapi.accounts.dataSources.delete({
755
+ * // Required. The name of the data source to delete. Format: `accounts/{account\}/dataSources/{datasource\}`
756
+ * name: 'accounts/my-account/dataSources/my-dataSource',
757
+ * });
758
+ * console.log(res.data);
759
+ *
760
+ * // Example response
761
+ * // {}
762
+ * }
763
+ *
764
+ * main().catch(e => {
765
+ * console.error(e);
766
+ * throw e;
767
+ * });
768
+ *
769
+ * ```
770
+ *
771
+ * @param params - Parameters for request
772
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
773
+ * @param callback - Optional callback that handles the response.
774
+ * @returns A promise if used with async/await, or void if used with a callback.
775
+ */
776
+ delete(
777
+ params: Params$Resource$Accounts$Datasources$Delete,
778
+ options: StreamMethodOptions
779
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
780
+ delete(
781
+ params?: Params$Resource$Accounts$Datasources$Delete,
782
+ options?: MethodOptions
783
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
784
+ delete(
785
+ params: Params$Resource$Accounts$Datasources$Delete,
786
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
787
+ callback: BodyResponseCallback<Readable>
788
+ ): void;
789
+ delete(
790
+ params: Params$Resource$Accounts$Datasources$Delete,
791
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
792
+ callback: BodyResponseCallback<Schema$Empty>
793
+ ): void;
794
+ delete(
795
+ params: Params$Resource$Accounts$Datasources$Delete,
796
+ callback: BodyResponseCallback<Schema$Empty>
797
+ ): void;
798
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
799
+ delete(
800
+ paramsOrCallback?:
801
+ | Params$Resource$Accounts$Datasources$Delete
802
+ | BodyResponseCallback<Schema$Empty>
803
+ | BodyResponseCallback<Readable>,
804
+ optionsOrCallback?:
805
+ | MethodOptions
806
+ | StreamMethodOptions
807
+ | BodyResponseCallback<Schema$Empty>
808
+ | BodyResponseCallback<Readable>,
809
+ callback?:
810
+ | BodyResponseCallback<Schema$Empty>
811
+ | BodyResponseCallback<Readable>
812
+ ):
813
+ | void
814
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
815
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
816
+ let params = (paramsOrCallback ||
817
+ {}) as Params$Resource$Accounts$Datasources$Delete;
818
+ let options = (optionsOrCallback || {}) as MethodOptions;
819
+
820
+ if (typeof paramsOrCallback === 'function') {
821
+ callback = paramsOrCallback;
822
+ params = {} as Params$Resource$Accounts$Datasources$Delete;
823
+ options = {};
824
+ }
825
+
826
+ if (typeof optionsOrCallback === 'function') {
827
+ callback = optionsOrCallback;
828
+ options = {};
829
+ }
830
+
831
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
832
+ const parameters = {
833
+ options: Object.assign(
834
+ {
835
+ url: (rootUrl + '/datasources/v1/{+name}').replace(
836
+ /([^:]\/)\/+/g,
837
+ '$1'
838
+ ),
839
+ method: 'DELETE',
840
+ apiVersion: '',
841
+ },
842
+ options
843
+ ),
844
+ params,
845
+ requiredParams: ['name'],
846
+ pathParams: ['name'],
847
+ context: this.context,
848
+ };
849
+ if (callback) {
850
+ createAPIRequest<Schema$Empty>(
851
+ parameters,
852
+ callback as BodyResponseCallback<unknown>
853
+ );
854
+ } else {
855
+ return createAPIRequest<Schema$Empty>(parameters);
856
+ }
857
+ }
858
+
859
+ /**
860
+ * Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account. If you need to call this method more than once per day, you should use the Products service to update your product data instead. This method only works on data sources with a file input set.
861
+ * @example
862
+ * ```js
863
+ * // Before running the sample:
864
+ * // - Enable the API at:
865
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
866
+ * // - Login into gcloud by running:
867
+ * // ```sh
868
+ * // $ gcloud auth application-default login
869
+ * // ```
870
+ * // - Install the npm module by running:
871
+ * // ```sh
872
+ * // $ npm install googleapis
873
+ * // ```
874
+ *
875
+ * const {google} = require('googleapis');
876
+ * const merchantapi = google.merchantapi('datasources_v1');
877
+ *
878
+ * async function main() {
879
+ * const auth = new google.auth.GoogleAuth({
880
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
881
+ * scopes: ['https://www.googleapis.com/auth/content'],
882
+ * });
883
+ *
884
+ * // Acquire an auth client, and bind it to all future calls
885
+ * const authClient = await auth.getClient();
886
+ * google.options({auth: authClient});
887
+ *
888
+ * // Do the magic
889
+ * const res = await merchantapi.accounts.dataSources.fetch({
890
+ * // Required. The name of the data source resource to fetch. Format: `accounts/{account\}/dataSources/{datasource\}`
891
+ * name: 'accounts/my-account/dataSources/my-dataSource',
892
+ *
893
+ * // Request body metadata
894
+ * requestBody: {
895
+ * // request body parameters
896
+ * // {}
897
+ * },
898
+ * });
899
+ * console.log(res.data);
900
+ *
901
+ * // Example response
902
+ * // {}
903
+ * }
904
+ *
905
+ * main().catch(e => {
906
+ * console.error(e);
907
+ * throw e;
908
+ * });
909
+ *
910
+ * ```
911
+ *
912
+ * @param params - Parameters for request
913
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
914
+ * @param callback - Optional callback that handles the response.
915
+ * @returns A promise if used with async/await, or void if used with a callback.
916
+ */
917
+ fetch(
918
+ params: Params$Resource$Accounts$Datasources$Fetch,
919
+ options: StreamMethodOptions
920
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
921
+ fetch(
922
+ params?: Params$Resource$Accounts$Datasources$Fetch,
923
+ options?: MethodOptions
924
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
925
+ fetch(
926
+ params: Params$Resource$Accounts$Datasources$Fetch,
927
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
928
+ callback: BodyResponseCallback<Readable>
929
+ ): void;
930
+ fetch(
931
+ params: Params$Resource$Accounts$Datasources$Fetch,
932
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
933
+ callback: BodyResponseCallback<Schema$Empty>
934
+ ): void;
935
+ fetch(
936
+ params: Params$Resource$Accounts$Datasources$Fetch,
937
+ callback: BodyResponseCallback<Schema$Empty>
938
+ ): void;
939
+ fetch(callback: BodyResponseCallback<Schema$Empty>): void;
940
+ fetch(
941
+ paramsOrCallback?:
942
+ | Params$Resource$Accounts$Datasources$Fetch
943
+ | BodyResponseCallback<Schema$Empty>
944
+ | BodyResponseCallback<Readable>,
945
+ optionsOrCallback?:
946
+ | MethodOptions
947
+ | StreamMethodOptions
948
+ | BodyResponseCallback<Schema$Empty>
949
+ | BodyResponseCallback<Readable>,
950
+ callback?:
951
+ | BodyResponseCallback<Schema$Empty>
952
+ | BodyResponseCallback<Readable>
953
+ ):
954
+ | void
955
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
956
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
957
+ let params = (paramsOrCallback ||
958
+ {}) as Params$Resource$Accounts$Datasources$Fetch;
959
+ let options = (optionsOrCallback || {}) as MethodOptions;
960
+
961
+ if (typeof paramsOrCallback === 'function') {
962
+ callback = paramsOrCallback;
963
+ params = {} as Params$Resource$Accounts$Datasources$Fetch;
964
+ options = {};
965
+ }
966
+
967
+ if (typeof optionsOrCallback === 'function') {
968
+ callback = optionsOrCallback;
969
+ options = {};
970
+ }
971
+
972
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
973
+ const parameters = {
974
+ options: Object.assign(
975
+ {
976
+ url: (rootUrl + '/datasources/v1/{+name}:fetch').replace(
977
+ /([^:]\/)\/+/g,
978
+ '$1'
979
+ ),
980
+ method: 'POST',
981
+ apiVersion: '',
982
+ },
983
+ options
984
+ ),
985
+ params,
986
+ requiredParams: ['name'],
987
+ pathParams: ['name'],
988
+ context: this.context,
989
+ };
990
+ if (callback) {
991
+ createAPIRequest<Schema$Empty>(
992
+ parameters,
993
+ callback as BodyResponseCallback<unknown>
994
+ );
995
+ } else {
996
+ return createAPIRequest<Schema$Empty>(parameters);
997
+ }
998
+ }
999
+
1000
+ /**
1001
+ * Retrieves the data source configuration for the given account.
1002
+ * @example
1003
+ * ```js
1004
+ * // Before running the sample:
1005
+ * // - Enable the API at:
1006
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
1007
+ * // - Login into gcloud by running:
1008
+ * // ```sh
1009
+ * // $ gcloud auth application-default login
1010
+ * // ```
1011
+ * // - Install the npm module by running:
1012
+ * // ```sh
1013
+ * // $ npm install googleapis
1014
+ * // ```
1015
+ *
1016
+ * const {google} = require('googleapis');
1017
+ * const merchantapi = google.merchantapi('datasources_v1');
1018
+ *
1019
+ * async function main() {
1020
+ * const auth = new google.auth.GoogleAuth({
1021
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1022
+ * scopes: ['https://www.googleapis.com/auth/content'],
1023
+ * });
1024
+ *
1025
+ * // Acquire an auth client, and bind it to all future calls
1026
+ * const authClient = await auth.getClient();
1027
+ * google.options({auth: authClient});
1028
+ *
1029
+ * // Do the magic
1030
+ * const res = await merchantapi.accounts.dataSources.get({
1031
+ * // Required. The name of the data source to retrieve. Format: `accounts/{account\}/dataSources/{datasource\}`
1032
+ * name: 'accounts/my-account/dataSources/my-dataSource',
1033
+ * });
1034
+ * console.log(res.data);
1035
+ *
1036
+ * // Example response
1037
+ * // {
1038
+ * // "dataSourceId": "my_dataSourceId",
1039
+ * // "displayName": "my_displayName",
1040
+ * // "fileInput": {},
1041
+ * // "input": "my_input",
1042
+ * // "localInventoryDataSource": {},
1043
+ * // "merchantReviewDataSource": {},
1044
+ * // "name": "my_name",
1045
+ * // "primaryProductDataSource": {},
1046
+ * // "productReviewDataSource": {},
1047
+ * // "promotionDataSource": {},
1048
+ * // "regionalInventoryDataSource": {},
1049
+ * // "supplementalProductDataSource": {}
1050
+ * // }
1051
+ * }
1052
+ *
1053
+ * main().catch(e => {
1054
+ * console.error(e);
1055
+ * throw e;
1056
+ * });
1057
+ *
1058
+ * ```
1059
+ *
1060
+ * @param params - Parameters for request
1061
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1062
+ * @param callback - Optional callback that handles the response.
1063
+ * @returns A promise if used with async/await, or void if used with a callback.
1064
+ */
1065
+ get(
1066
+ params: Params$Resource$Accounts$Datasources$Get,
1067
+ options: StreamMethodOptions
1068
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1069
+ get(
1070
+ params?: Params$Resource$Accounts$Datasources$Get,
1071
+ options?: MethodOptions
1072
+ ): Promise<GaxiosResponseWithHTTP2<Schema$DataSource>>;
1073
+ get(
1074
+ params: Params$Resource$Accounts$Datasources$Get,
1075
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1076
+ callback: BodyResponseCallback<Readable>
1077
+ ): void;
1078
+ get(
1079
+ params: Params$Resource$Accounts$Datasources$Get,
1080
+ options: MethodOptions | BodyResponseCallback<Schema$DataSource>,
1081
+ callback: BodyResponseCallback<Schema$DataSource>
1082
+ ): void;
1083
+ get(
1084
+ params: Params$Resource$Accounts$Datasources$Get,
1085
+ callback: BodyResponseCallback<Schema$DataSource>
1086
+ ): void;
1087
+ get(callback: BodyResponseCallback<Schema$DataSource>): void;
1088
+ get(
1089
+ paramsOrCallback?:
1090
+ | Params$Resource$Accounts$Datasources$Get
1091
+ | BodyResponseCallback<Schema$DataSource>
1092
+ | BodyResponseCallback<Readable>,
1093
+ optionsOrCallback?:
1094
+ | MethodOptions
1095
+ | StreamMethodOptions
1096
+ | BodyResponseCallback<Schema$DataSource>
1097
+ | BodyResponseCallback<Readable>,
1098
+ callback?:
1099
+ | BodyResponseCallback<Schema$DataSource>
1100
+ | BodyResponseCallback<Readable>
1101
+ ):
1102
+ | void
1103
+ | Promise<GaxiosResponseWithHTTP2<Schema$DataSource>>
1104
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1105
+ let params = (paramsOrCallback ||
1106
+ {}) as Params$Resource$Accounts$Datasources$Get;
1107
+ let options = (optionsOrCallback || {}) as MethodOptions;
1108
+
1109
+ if (typeof paramsOrCallback === 'function') {
1110
+ callback = paramsOrCallback;
1111
+ params = {} as Params$Resource$Accounts$Datasources$Get;
1112
+ options = {};
1113
+ }
1114
+
1115
+ if (typeof optionsOrCallback === 'function') {
1116
+ callback = optionsOrCallback;
1117
+ options = {};
1118
+ }
1119
+
1120
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
1121
+ const parameters = {
1122
+ options: Object.assign(
1123
+ {
1124
+ url: (rootUrl + '/datasources/v1/{+name}').replace(
1125
+ /([^:]\/)\/+/g,
1126
+ '$1'
1127
+ ),
1128
+ method: 'GET',
1129
+ apiVersion: '',
1130
+ },
1131
+ options
1132
+ ),
1133
+ params,
1134
+ requiredParams: ['name'],
1135
+ pathParams: ['name'],
1136
+ context: this.context,
1137
+ };
1138
+ if (callback) {
1139
+ createAPIRequest<Schema$DataSource>(
1140
+ parameters,
1141
+ callback as BodyResponseCallback<unknown>
1142
+ );
1143
+ } else {
1144
+ return createAPIRequest<Schema$DataSource>(parameters);
1145
+ }
1146
+ }
1147
+
1148
+ /**
1149
+ * Lists the configurations for data sources for the given account.
1150
+ * @example
1151
+ * ```js
1152
+ * // Before running the sample:
1153
+ * // - Enable the API at:
1154
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
1155
+ * // - Login into gcloud by running:
1156
+ * // ```sh
1157
+ * // $ gcloud auth application-default login
1158
+ * // ```
1159
+ * // - Install the npm module by running:
1160
+ * // ```sh
1161
+ * // $ npm install googleapis
1162
+ * // ```
1163
+ *
1164
+ * const {google} = require('googleapis');
1165
+ * const merchantapi = google.merchantapi('datasources_v1');
1166
+ *
1167
+ * async function main() {
1168
+ * const auth = new google.auth.GoogleAuth({
1169
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1170
+ * scopes: ['https://www.googleapis.com/auth/content'],
1171
+ * });
1172
+ *
1173
+ * // Acquire an auth client, and bind it to all future calls
1174
+ * const authClient = await auth.getClient();
1175
+ * google.options({auth: authClient});
1176
+ *
1177
+ * // Do the magic
1178
+ * const res = await merchantapi.accounts.dataSources.list({
1179
+ * // Optional. The maximum number of data sources to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000. If unspecified, the maximum number of data sources will be returned.
1180
+ * pageSize: 'placeholder-value',
1181
+ * // Optional. A page token, received from a previous `ListDataSources` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDataSources` must match the call that provided the page token.
1182
+ * pageToken: 'placeholder-value',
1183
+ * // Required. The account to list data sources for. Format: `accounts/{account\}`
1184
+ * parent: 'accounts/my-account',
1185
+ * });
1186
+ * console.log(res.data);
1187
+ *
1188
+ * // Example response
1189
+ * // {
1190
+ * // "dataSources": [],
1191
+ * // "nextPageToken": "my_nextPageToken"
1192
+ * // }
1193
+ * }
1194
+ *
1195
+ * main().catch(e => {
1196
+ * console.error(e);
1197
+ * throw e;
1198
+ * });
1199
+ *
1200
+ * ```
1201
+ *
1202
+ * @param params - Parameters for request
1203
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1204
+ * @param callback - Optional callback that handles the response.
1205
+ * @returns A promise if used with async/await, or void if used with a callback.
1206
+ */
1207
+ list(
1208
+ params: Params$Resource$Accounts$Datasources$List,
1209
+ options: StreamMethodOptions
1210
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1211
+ list(
1212
+ params?: Params$Resource$Accounts$Datasources$List,
1213
+ options?: MethodOptions
1214
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListDataSourcesResponse>>;
1215
+ list(
1216
+ params: Params$Resource$Accounts$Datasources$List,
1217
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1218
+ callback: BodyResponseCallback<Readable>
1219
+ ): void;
1220
+ list(
1221
+ params: Params$Resource$Accounts$Datasources$List,
1222
+ options:
1223
+ | MethodOptions
1224
+ | BodyResponseCallback<Schema$ListDataSourcesResponse>,
1225
+ callback: BodyResponseCallback<Schema$ListDataSourcesResponse>
1226
+ ): void;
1227
+ list(
1228
+ params: Params$Resource$Accounts$Datasources$List,
1229
+ callback: BodyResponseCallback<Schema$ListDataSourcesResponse>
1230
+ ): void;
1231
+ list(callback: BodyResponseCallback<Schema$ListDataSourcesResponse>): void;
1232
+ list(
1233
+ paramsOrCallback?:
1234
+ | Params$Resource$Accounts$Datasources$List
1235
+ | BodyResponseCallback<Schema$ListDataSourcesResponse>
1236
+ | BodyResponseCallback<Readable>,
1237
+ optionsOrCallback?:
1238
+ | MethodOptions
1239
+ | StreamMethodOptions
1240
+ | BodyResponseCallback<Schema$ListDataSourcesResponse>
1241
+ | BodyResponseCallback<Readable>,
1242
+ callback?:
1243
+ | BodyResponseCallback<Schema$ListDataSourcesResponse>
1244
+ | BodyResponseCallback<Readable>
1245
+ ):
1246
+ | void
1247
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListDataSourcesResponse>>
1248
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1249
+ let params = (paramsOrCallback ||
1250
+ {}) as Params$Resource$Accounts$Datasources$List;
1251
+ let options = (optionsOrCallback || {}) as MethodOptions;
1252
+
1253
+ if (typeof paramsOrCallback === 'function') {
1254
+ callback = paramsOrCallback;
1255
+ params = {} as Params$Resource$Accounts$Datasources$List;
1256
+ options = {};
1257
+ }
1258
+
1259
+ if (typeof optionsOrCallback === 'function') {
1260
+ callback = optionsOrCallback;
1261
+ options = {};
1262
+ }
1263
+
1264
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
1265
+ const parameters = {
1266
+ options: Object.assign(
1267
+ {
1268
+ url: (rootUrl + '/datasources/v1/{+parent}/dataSources').replace(
1269
+ /([^:]\/)\/+/g,
1270
+ '$1'
1271
+ ),
1272
+ method: 'GET',
1273
+ apiVersion: '',
1274
+ },
1275
+ options
1276
+ ),
1277
+ params,
1278
+ requiredParams: ['parent'],
1279
+ pathParams: ['parent'],
1280
+ context: this.context,
1281
+ };
1282
+ if (callback) {
1283
+ createAPIRequest<Schema$ListDataSourcesResponse>(
1284
+ parameters,
1285
+ callback as BodyResponseCallback<unknown>
1286
+ );
1287
+ } else {
1288
+ return createAPIRequest<Schema$ListDataSourcesResponse>(parameters);
1289
+ }
1290
+ }
1291
+
1292
+ /**
1293
+ * Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.
1294
+ * @example
1295
+ * ```js
1296
+ * // Before running the sample:
1297
+ * // - Enable the API at:
1298
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
1299
+ * // - Login into gcloud by running:
1300
+ * // ```sh
1301
+ * // $ gcloud auth application-default login
1302
+ * // ```
1303
+ * // - Install the npm module by running:
1304
+ * // ```sh
1305
+ * // $ npm install googleapis
1306
+ * // ```
1307
+ *
1308
+ * const {google} = require('googleapis');
1309
+ * const merchantapi = google.merchantapi('datasources_v1');
1310
+ *
1311
+ * async function main() {
1312
+ * const auth = new google.auth.GoogleAuth({
1313
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1314
+ * scopes: ['https://www.googleapis.com/auth/content'],
1315
+ * });
1316
+ *
1317
+ * // Acquire an auth client, and bind it to all future calls
1318
+ * const authClient = await auth.getClient();
1319
+ * google.options({auth: authClient});
1320
+ *
1321
+ * // Do the magic
1322
+ * const res = await merchantapi.accounts.dataSources.patch({
1323
+ * // Required. Identifier. The name of the data source. Format: `accounts/{account\}/dataSources/{datasource\}`
1324
+ * name: 'accounts/my-account/dataSources/my-dataSource',
1325
+ * // Required. The list of data source fields to be updated. Fields specified in the update mask without a value specified in the body will be deleted from the data source. Providing special "*" value for full data source replacement is not supported. For example, If you insert `updateMask=displayName` in the request, it will only update the `displayName` leaving all other fields untouched.
1326
+ * updateMask: 'placeholder-value',
1327
+ *
1328
+ * // Request body metadata
1329
+ * requestBody: {
1330
+ * // request body parameters
1331
+ * // {
1332
+ * // "dataSourceId": "my_dataSourceId",
1333
+ * // "displayName": "my_displayName",
1334
+ * // "fileInput": {},
1335
+ * // "input": "my_input",
1336
+ * // "localInventoryDataSource": {},
1337
+ * // "merchantReviewDataSource": {},
1338
+ * // "name": "my_name",
1339
+ * // "primaryProductDataSource": {},
1340
+ * // "productReviewDataSource": {},
1341
+ * // "promotionDataSource": {},
1342
+ * // "regionalInventoryDataSource": {},
1343
+ * // "supplementalProductDataSource": {}
1344
+ * // }
1345
+ * },
1346
+ * });
1347
+ * console.log(res.data);
1348
+ *
1349
+ * // Example response
1350
+ * // {
1351
+ * // "dataSourceId": "my_dataSourceId",
1352
+ * // "displayName": "my_displayName",
1353
+ * // "fileInput": {},
1354
+ * // "input": "my_input",
1355
+ * // "localInventoryDataSource": {},
1356
+ * // "merchantReviewDataSource": {},
1357
+ * // "name": "my_name",
1358
+ * // "primaryProductDataSource": {},
1359
+ * // "productReviewDataSource": {},
1360
+ * // "promotionDataSource": {},
1361
+ * // "regionalInventoryDataSource": {},
1362
+ * // "supplementalProductDataSource": {}
1363
+ * // }
1364
+ * }
1365
+ *
1366
+ * main().catch(e => {
1367
+ * console.error(e);
1368
+ * throw e;
1369
+ * });
1370
+ *
1371
+ * ```
1372
+ *
1373
+ * @param params - Parameters for request
1374
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1375
+ * @param callback - Optional callback that handles the response.
1376
+ * @returns A promise if used with async/await, or void if used with a callback.
1377
+ */
1378
+ patch(
1379
+ params: Params$Resource$Accounts$Datasources$Patch,
1380
+ options: StreamMethodOptions
1381
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1382
+ patch(
1383
+ params?: Params$Resource$Accounts$Datasources$Patch,
1384
+ options?: MethodOptions
1385
+ ): Promise<GaxiosResponseWithHTTP2<Schema$DataSource>>;
1386
+ patch(
1387
+ params: Params$Resource$Accounts$Datasources$Patch,
1388
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1389
+ callback: BodyResponseCallback<Readable>
1390
+ ): void;
1391
+ patch(
1392
+ params: Params$Resource$Accounts$Datasources$Patch,
1393
+ options: MethodOptions | BodyResponseCallback<Schema$DataSource>,
1394
+ callback: BodyResponseCallback<Schema$DataSource>
1395
+ ): void;
1396
+ patch(
1397
+ params: Params$Resource$Accounts$Datasources$Patch,
1398
+ callback: BodyResponseCallback<Schema$DataSource>
1399
+ ): void;
1400
+ patch(callback: BodyResponseCallback<Schema$DataSource>): void;
1401
+ patch(
1402
+ paramsOrCallback?:
1403
+ | Params$Resource$Accounts$Datasources$Patch
1404
+ | BodyResponseCallback<Schema$DataSource>
1405
+ | BodyResponseCallback<Readable>,
1406
+ optionsOrCallback?:
1407
+ | MethodOptions
1408
+ | StreamMethodOptions
1409
+ | BodyResponseCallback<Schema$DataSource>
1410
+ | BodyResponseCallback<Readable>,
1411
+ callback?:
1412
+ | BodyResponseCallback<Schema$DataSource>
1413
+ | BodyResponseCallback<Readable>
1414
+ ):
1415
+ | void
1416
+ | Promise<GaxiosResponseWithHTTP2<Schema$DataSource>>
1417
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1418
+ let params = (paramsOrCallback ||
1419
+ {}) as Params$Resource$Accounts$Datasources$Patch;
1420
+ let options = (optionsOrCallback || {}) as MethodOptions;
1421
+
1422
+ if (typeof paramsOrCallback === 'function') {
1423
+ callback = paramsOrCallback;
1424
+ params = {} as Params$Resource$Accounts$Datasources$Patch;
1425
+ options = {};
1426
+ }
1427
+
1428
+ if (typeof optionsOrCallback === 'function') {
1429
+ callback = optionsOrCallback;
1430
+ options = {};
1431
+ }
1432
+
1433
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
1434
+ const parameters = {
1435
+ options: Object.assign(
1436
+ {
1437
+ url: (rootUrl + '/datasources/v1/{+name}').replace(
1438
+ /([^:]\/)\/+/g,
1439
+ '$1'
1440
+ ),
1441
+ method: 'PATCH',
1442
+ apiVersion: '',
1443
+ },
1444
+ options
1445
+ ),
1446
+ params,
1447
+ requiredParams: ['name'],
1448
+ pathParams: ['name'],
1449
+ context: this.context,
1450
+ };
1451
+ if (callback) {
1452
+ createAPIRequest<Schema$DataSource>(
1453
+ parameters,
1454
+ callback as BodyResponseCallback<unknown>
1455
+ );
1456
+ } else {
1457
+ return createAPIRequest<Schema$DataSource>(parameters);
1458
+ }
1459
+ }
1460
+ }
1461
+
1462
+ export interface Params$Resource$Accounts$Datasources$Create
1463
+ extends StandardParameters {
1464
+ /**
1465
+ * Required. The account where this data source will be created. Format: `accounts/{account\}`
1466
+ */
1467
+ parent?: string;
1468
+
1469
+ /**
1470
+ * Request body metadata
1471
+ */
1472
+ requestBody?: Schema$DataSource;
1473
+ }
1474
+ export interface Params$Resource$Accounts$Datasources$Delete
1475
+ extends StandardParameters {
1476
+ /**
1477
+ * Required. The name of the data source to delete. Format: `accounts/{account\}/dataSources/{datasource\}`
1478
+ */
1479
+ name?: string;
1480
+ }
1481
+ export interface Params$Resource$Accounts$Datasources$Fetch
1482
+ extends StandardParameters {
1483
+ /**
1484
+ * Required. The name of the data source resource to fetch. Format: `accounts/{account\}/dataSources/{datasource\}`
1485
+ */
1486
+ name?: string;
1487
+
1488
+ /**
1489
+ * Request body metadata
1490
+ */
1491
+ requestBody?: Schema$FetchDataSourceRequest;
1492
+ }
1493
+ export interface Params$Resource$Accounts$Datasources$Get
1494
+ extends StandardParameters {
1495
+ /**
1496
+ * Required. The name of the data source to retrieve. Format: `accounts/{account\}/dataSources/{datasource\}`
1497
+ */
1498
+ name?: string;
1499
+ }
1500
+ export interface Params$Resource$Accounts$Datasources$List
1501
+ extends StandardParameters {
1502
+ /**
1503
+ * Optional. The maximum number of data sources to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000. If unspecified, the maximum number of data sources will be returned.
1504
+ */
1505
+ pageSize?: number;
1506
+ /**
1507
+ * Optional. A page token, received from a previous `ListDataSources` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDataSources` must match the call that provided the page token.
1508
+ */
1509
+ pageToken?: string;
1510
+ /**
1511
+ * Required. The account to list data sources for. Format: `accounts/{account\}`
1512
+ */
1513
+ parent?: string;
1514
+ }
1515
+ export interface Params$Resource$Accounts$Datasources$Patch
1516
+ extends StandardParameters {
1517
+ /**
1518
+ * Required. Identifier. The name of the data source. Format: `accounts/{account\}/dataSources/{datasource\}`
1519
+ */
1520
+ name?: string;
1521
+ /**
1522
+ * Required. The list of data source fields to be updated. Fields specified in the update mask without a value specified in the body will be deleted from the data source. Providing special "*" value for full data source replacement is not supported. For example, If you insert `updateMask=displayName` in the request, it will only update the `displayName` leaving all other fields untouched.
1523
+ */
1524
+ updateMask?: string;
1525
+
1526
+ /**
1527
+ * Request body metadata
1528
+ */
1529
+ requestBody?: Schema$DataSource;
1530
+ }
1531
+
1532
+ export class Resource$Accounts$Datasources$Fileuploads {
1533
+ context: APIRequestContext;
1534
+ constructor(context: APIRequestContext) {
1535
+ this.context = context;
1536
+ }
1537
+
1538
+ /**
1539
+ * Gets the latest data source file upload. Only the `latest` alias is accepted for a file upload.
1540
+ * @example
1541
+ * ```js
1542
+ * // Before running the sample:
1543
+ * // - Enable the API at:
1544
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
1545
+ * // - Login into gcloud by running:
1546
+ * // ```sh
1547
+ * // $ gcloud auth application-default login
1548
+ * // ```
1549
+ * // - Install the npm module by running:
1550
+ * // ```sh
1551
+ * // $ npm install googleapis
1552
+ * // ```
1553
+ *
1554
+ * const {google} = require('googleapis');
1555
+ * const merchantapi = google.merchantapi('datasources_v1');
1556
+ *
1557
+ * async function main() {
1558
+ * const auth = new google.auth.GoogleAuth({
1559
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1560
+ * scopes: ['https://www.googleapis.com/auth/content'],
1561
+ * });
1562
+ *
1563
+ * // Acquire an auth client, and bind it to all future calls
1564
+ * const authClient = await auth.getClient();
1565
+ * google.options({auth: authClient});
1566
+ *
1567
+ * // Do the magic
1568
+ * const res = await merchantapi.accounts.dataSources.fileUploads.get({
1569
+ * // Required. The name of the data source file upload to retrieve. Format: `accounts/{account\}/dataSources/{datasource\}/fileUploads/latest`
1570
+ * name: 'accounts/my-account/dataSources/my-dataSource/fileUploads/my-fileUpload',
1571
+ * });
1572
+ * console.log(res.data);
1573
+ *
1574
+ * // Example response
1575
+ * // {
1576
+ * // "dataSourceId": "my_dataSourceId",
1577
+ * // "issues": [],
1578
+ * // "itemsCreated": "my_itemsCreated",
1579
+ * // "itemsTotal": "my_itemsTotal",
1580
+ * // "itemsUpdated": "my_itemsUpdated",
1581
+ * // "name": "my_name",
1582
+ * // "processingState": "my_processingState",
1583
+ * // "uploadTime": "my_uploadTime"
1584
+ * // }
1585
+ * }
1586
+ *
1587
+ * main().catch(e => {
1588
+ * console.error(e);
1589
+ * throw e;
1590
+ * });
1591
+ *
1592
+ * ```
1593
+ *
1594
+ * @param params - Parameters for request
1595
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1596
+ * @param callback - Optional callback that handles the response.
1597
+ * @returns A promise if used with async/await, or void if used with a callback.
1598
+ */
1599
+ get(
1600
+ params: Params$Resource$Accounts$Datasources$Fileuploads$Get,
1601
+ options: StreamMethodOptions
1602
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1603
+ get(
1604
+ params?: Params$Resource$Accounts$Datasources$Fileuploads$Get,
1605
+ options?: MethodOptions
1606
+ ): Promise<GaxiosResponseWithHTTP2<Schema$FileUpload>>;
1607
+ get(
1608
+ params: Params$Resource$Accounts$Datasources$Fileuploads$Get,
1609
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1610
+ callback: BodyResponseCallback<Readable>
1611
+ ): void;
1612
+ get(
1613
+ params: Params$Resource$Accounts$Datasources$Fileuploads$Get,
1614
+ options: MethodOptions | BodyResponseCallback<Schema$FileUpload>,
1615
+ callback: BodyResponseCallback<Schema$FileUpload>
1616
+ ): void;
1617
+ get(
1618
+ params: Params$Resource$Accounts$Datasources$Fileuploads$Get,
1619
+ callback: BodyResponseCallback<Schema$FileUpload>
1620
+ ): void;
1621
+ get(callback: BodyResponseCallback<Schema$FileUpload>): void;
1622
+ get(
1623
+ paramsOrCallback?:
1624
+ | Params$Resource$Accounts$Datasources$Fileuploads$Get
1625
+ | BodyResponseCallback<Schema$FileUpload>
1626
+ | BodyResponseCallback<Readable>,
1627
+ optionsOrCallback?:
1628
+ | MethodOptions
1629
+ | StreamMethodOptions
1630
+ | BodyResponseCallback<Schema$FileUpload>
1631
+ | BodyResponseCallback<Readable>,
1632
+ callback?:
1633
+ | BodyResponseCallback<Schema$FileUpload>
1634
+ | BodyResponseCallback<Readable>
1635
+ ):
1636
+ | void
1637
+ | Promise<GaxiosResponseWithHTTP2<Schema$FileUpload>>
1638
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1639
+ let params = (paramsOrCallback ||
1640
+ {}) as Params$Resource$Accounts$Datasources$Fileuploads$Get;
1641
+ let options = (optionsOrCallback || {}) as MethodOptions;
1642
+
1643
+ if (typeof paramsOrCallback === 'function') {
1644
+ callback = paramsOrCallback;
1645
+ params = {} as Params$Resource$Accounts$Datasources$Fileuploads$Get;
1646
+ options = {};
1647
+ }
1648
+
1649
+ if (typeof optionsOrCallback === 'function') {
1650
+ callback = optionsOrCallback;
1651
+ options = {};
1652
+ }
1653
+
1654
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
1655
+ const parameters = {
1656
+ options: Object.assign(
1657
+ {
1658
+ url: (rootUrl + '/datasources/v1/{+name}').replace(
1659
+ /([^:]\/)\/+/g,
1660
+ '$1'
1661
+ ),
1662
+ method: 'GET',
1663
+ apiVersion: '',
1664
+ },
1665
+ options
1666
+ ),
1667
+ params,
1668
+ requiredParams: ['name'],
1669
+ pathParams: ['name'],
1670
+ context: this.context,
1671
+ };
1672
+ if (callback) {
1673
+ createAPIRequest<Schema$FileUpload>(
1674
+ parameters,
1675
+ callback as BodyResponseCallback<unknown>
1676
+ );
1677
+ } else {
1678
+ return createAPIRequest<Schema$FileUpload>(parameters);
1679
+ }
1680
+ }
1681
+ }
1682
+
1683
+ export interface Params$Resource$Accounts$Datasources$Fileuploads$Get
1684
+ extends StandardParameters {
1685
+ /**
1686
+ * Required. The name of the data source file upload to retrieve. Format: `accounts/{account\}/dataSources/{datasource\}/fileUploads/latest`
1687
+ */
1688
+ name?: string;
1689
+ }
1690
+ }