@maxim_mazurok/gapi.client.merchantapi-datasources_v1 0.0.20250804
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.
- package/index.d.ts +526 -0
- package/package.json +20 -0
- package/readme.md +73 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Merchant API datasources_v1 0.0 */
|
|
2
|
+
// Project: https://developers.google.com/merchant/api
|
|
3
|
+
// Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
|
|
4
|
+
// Nick Amoscato <https://github.com/namoscato>
|
|
5
|
+
// Declan Vong <https://github.com/declanvong>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
|
|
8
|
+
// IMPORTANT
|
|
9
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
10
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
11
|
+
// Generated from: https://merchantapi.googleapis.com/$discovery/rest?version=datasources_v1
|
|
12
|
+
// Revision: 20250804
|
|
13
|
+
|
|
14
|
+
/// <reference types="gapi.client" />
|
|
15
|
+
|
|
16
|
+
declare namespace gapi.client {
|
|
17
|
+
/** Load Merchant API datasources_v1 */
|
|
18
|
+
function load(
|
|
19
|
+
urlOrObject: 'https://merchantapi.googleapis.com/$discovery/rest?version=datasources_v1',
|
|
20
|
+
): Promise<void>;
|
|
21
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
22
|
+
function load(name: 'merchantapi', version: 'datasources_v1'): Promise<void>;
|
|
23
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
24
|
+
function load(
|
|
25
|
+
name: 'merchantapi',
|
|
26
|
+
version: 'datasources_v1',
|
|
27
|
+
callback: () => any,
|
|
28
|
+
): void;
|
|
29
|
+
|
|
30
|
+
namespace merchantapi {
|
|
31
|
+
interface DataSource {
|
|
32
|
+
/** Output only. The data source id. */
|
|
33
|
+
dataSourceId?: string;
|
|
34
|
+
/** Required. The displayed data source name in the Merchant Center UI. */
|
|
35
|
+
displayName?: string;
|
|
36
|
+
/** Optional. The field is used only when data is managed through a file. */
|
|
37
|
+
fileInput?: FileInput;
|
|
38
|
+
/** 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. */
|
|
39
|
+
input?: string;
|
|
40
|
+
/** The [local inventory](https://support.google.com/merchants/answer/7023001) data source. */
|
|
41
|
+
localInventoryDataSource?: LocalInventoryDataSource;
|
|
42
|
+
/** The [merchant review](https://support.google.com/merchants/answer/7045996) data source. */
|
|
43
|
+
merchantReviewDataSource?: any;
|
|
44
|
+
/** Required. Identifier. The name of the data source. Format: `accounts/{account}/dataSources/{datasource}` */
|
|
45
|
+
name?: string;
|
|
46
|
+
/** The [primary data source](https://support.google.com/merchants/answer/7439058) for local and online products. */
|
|
47
|
+
primaryProductDataSource?: PrimaryProductDataSource;
|
|
48
|
+
/** The [product review](https://support.google.com/merchants/answer/7045996) data source. */
|
|
49
|
+
productReviewDataSource?: any;
|
|
50
|
+
/** The [promotion](https://support.google.com/merchants/answer/2906014) data source. */
|
|
51
|
+
promotionDataSource?: PromotionDataSource;
|
|
52
|
+
/** The [regional inventory](https://support.google.com/merchants/answer/7439058) data source. */
|
|
53
|
+
regionalInventoryDataSource?: RegionalInventoryDataSource;
|
|
54
|
+
/** The [supplemental data source](https://support.google.com/merchants/answer/7439058) for local and online products. */
|
|
55
|
+
supplementalProductDataSource?: SupplementalProductDataSource;
|
|
56
|
+
}
|
|
57
|
+
interface DataSourceReference {
|
|
58
|
+
/** Optional. The name of the primary data source. Format: `accounts/{account}/dataSources/{datasource}` */
|
|
59
|
+
primaryDataSourceName?: string;
|
|
60
|
+
/** Self should be used to reference the primary data source itself. */
|
|
61
|
+
self?: boolean;
|
|
62
|
+
/** Optional. The name of the supplemental data source. Format: `accounts/{account}/dataSources/{datasource}` */
|
|
63
|
+
supplementalDataSourceName?: string;
|
|
64
|
+
}
|
|
65
|
+
interface DefaultRule {
|
|
66
|
+
/** 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`. */
|
|
67
|
+
takeFromDataSources?: DataSourceReference[];
|
|
68
|
+
}
|
|
69
|
+
interface Destination {
|
|
70
|
+
/** [Marketing methods](https://support.google.com/merchants/answer/15130232) (also known as destination) selections. */
|
|
71
|
+
destination?: string;
|
|
72
|
+
/** The state of the destination. */
|
|
73
|
+
state?: string;
|
|
74
|
+
}
|
|
75
|
+
interface Empty {}
|
|
76
|
+
interface FetchDataSourceRequest {}
|
|
77
|
+
interface FetchSettings {
|
|
78
|
+
/** 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. */
|
|
79
|
+
dayOfMonth?: number;
|
|
80
|
+
/** Optional. The day of the week when the data source file should be fetched. This field can only be set for weekly frequency. */
|
|
81
|
+
dayOfWeek?: string;
|
|
82
|
+
/** Optional. Enables or pauses the fetch schedule. */
|
|
83
|
+
enabled?: boolean;
|
|
84
|
+
/** 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. */
|
|
85
|
+
fetchUri?: string;
|
|
86
|
+
/** Required. The frequency describing fetch schedule. */
|
|
87
|
+
frequency?: string;
|
|
88
|
+
/** Optional. An optional password for fetch_uri. Used for [submitting data sources through SFTP](https://support.google.com/merchants/answer/13813117). */
|
|
89
|
+
password?: string;
|
|
90
|
+
/** Optional. The hour of the day when the data source file should be fetched. Minutes and seconds are not supported and will be ignored. */
|
|
91
|
+
timeOfDay?: TimeOfDay;
|
|
92
|
+
/** Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by default. For example, "America/Los_Angeles". */
|
|
93
|
+
timeZone?: string;
|
|
94
|
+
/** Optional. An optional user name for fetch_uri. Used for [submitting data sources through SFTP](https://support.google.com/merchants/answer/13813117). */
|
|
95
|
+
username?: string;
|
|
96
|
+
}
|
|
97
|
+
interface FileInput {
|
|
98
|
+
/** 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. */
|
|
99
|
+
fetchSettings?: FetchSettings;
|
|
100
|
+
/** Output only. The type of file input. */
|
|
101
|
+
fileInputType?: string;
|
|
102
|
+
/** Optional. The file name of the data source. Required for `UPLOAD` file input type. */
|
|
103
|
+
fileName?: string;
|
|
104
|
+
}
|
|
105
|
+
interface FileUpload {
|
|
106
|
+
/** Output only. The data source id. */
|
|
107
|
+
dataSourceId?: string;
|
|
108
|
+
/** Output only. The list of issues occurring in the data source. */
|
|
109
|
+
issues?: Issue[];
|
|
110
|
+
/** Output only. The number of items in the data source that were created. */
|
|
111
|
+
itemsCreated?: string;
|
|
112
|
+
/** Output only. The number of items in the data source that were processed. */
|
|
113
|
+
itemsTotal?: string;
|
|
114
|
+
/** Output only. The number of items in the data source that were updated. */
|
|
115
|
+
itemsUpdated?: string;
|
|
116
|
+
/** Identifier. The name of the data source file upload. Format: `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}` */
|
|
117
|
+
name?: string;
|
|
118
|
+
/** Output only. The processing state of the data source. */
|
|
119
|
+
processingState?: string;
|
|
120
|
+
/** Output only. The date at which the file of the data source was uploaded. */
|
|
121
|
+
uploadTime?: string;
|
|
122
|
+
}
|
|
123
|
+
interface Issue {
|
|
124
|
+
/** Output only. The code of the error, for example, "validation/invalid_value". Returns "?" if the code is unknown. */
|
|
125
|
+
code?: string;
|
|
126
|
+
/** Output only. The number of occurrences of the error in the file upload. */
|
|
127
|
+
count?: string;
|
|
128
|
+
/** 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". */
|
|
129
|
+
description?: string;
|
|
130
|
+
/** Output only. Link to the documentation explaining the issue in more details, if available. */
|
|
131
|
+
documentationUri?: string;
|
|
132
|
+
/** Output only. The severity of the issue. */
|
|
133
|
+
severity?: string;
|
|
134
|
+
/** Output only. The title of the issue, for example, "Item too big". */
|
|
135
|
+
title?: string;
|
|
136
|
+
}
|
|
137
|
+
interface ListDataSourcesResponse {
|
|
138
|
+
/** The data sources from the specified account. */
|
|
139
|
+
dataSources?: DataSource[];
|
|
140
|
+
/** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
|
|
141
|
+
nextPageToken?: string;
|
|
142
|
+
}
|
|
143
|
+
interface LocalInventoryDataSource {
|
|
144
|
+
/** Required. Immutable. The two-letter ISO 639-1 language of the items to which the local inventory is provided. */
|
|
145
|
+
contentLanguage?: string;
|
|
146
|
+
/** 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). */
|
|
147
|
+
feedLabel?: string;
|
|
148
|
+
}
|
|
149
|
+
interface MerchantReviewDataSource {}
|
|
150
|
+
interface PrimaryProductDataSource {
|
|
151
|
+
/** 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. */
|
|
152
|
+
contentLanguage?: string;
|
|
153
|
+
/** 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). */
|
|
154
|
+
countries?: string[];
|
|
155
|
+
/** Optional. Default rule management of the data source. If set, the linked data sources will be replaced. */
|
|
156
|
+
defaultRule?: DefaultRule;
|
|
157
|
+
/** 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. */
|
|
158
|
+
destinations?: Destination[];
|
|
159
|
+
/** 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. */
|
|
160
|
+
feedLabel?: string;
|
|
161
|
+
/** 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`. */
|
|
162
|
+
legacyLocal?: boolean;
|
|
163
|
+
}
|
|
164
|
+
interface ProductChange {
|
|
165
|
+
/** 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`, ``) */
|
|
166
|
+
newValue?: string;
|
|
167
|
+
/** 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`, ``) */
|
|
168
|
+
oldValue?: string;
|
|
169
|
+
/** Countries that have the change (if applicable). Represented in the ISO 3166 format. */
|
|
170
|
+
regionCode?: string;
|
|
171
|
+
/** 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) */
|
|
172
|
+
reportingContext?: string;
|
|
173
|
+
}
|
|
174
|
+
interface ProductReviewDataSource {}
|
|
175
|
+
interface ProductStatusChangeMessage {
|
|
176
|
+
/** The target account that owns the entity that changed. Format : `accounts/{merchant_id}` */
|
|
177
|
+
account?: string;
|
|
178
|
+
/** The attribute in the resource that changed, in this case it will be always `Status`. */
|
|
179
|
+
attribute?: string;
|
|
180
|
+
/** A message to describe the change that happened to the product */
|
|
181
|
+
changes?: ProductChange[];
|
|
182
|
+
/** 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. */
|
|
183
|
+
eventTime?: string;
|
|
184
|
+
/** Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event. */
|
|
185
|
+
expirationTime?: string;
|
|
186
|
+
/** 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}` */
|
|
187
|
+
managingAccount?: string;
|
|
188
|
+
/** The product name. Format: `accounts/{account}/products/{product}` */
|
|
189
|
+
resource?: string;
|
|
190
|
+
/** The product id. */
|
|
191
|
+
resourceId?: string;
|
|
192
|
+
/** The resource that changed, in this case it will always be `Product`. */
|
|
193
|
+
resourceType?: string;
|
|
194
|
+
}
|
|
195
|
+
interface PromotionDataSource {
|
|
196
|
+
/** Required. Immutable. The two-letter ISO 639-1 language of the items in the data source. */
|
|
197
|
+
contentLanguage?: string;
|
|
198
|
+
/** 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). */
|
|
199
|
+
targetCountry?: string;
|
|
200
|
+
}
|
|
201
|
+
interface RegionalInventoryDataSource {
|
|
202
|
+
/** Required. Immutable. The two-letter ISO 639-1 language of the items to which the regional inventory is provided. */
|
|
203
|
+
contentLanguage?: string;
|
|
204
|
+
/** 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). */
|
|
205
|
+
feedLabel?: string;
|
|
206
|
+
}
|
|
207
|
+
interface SupplementalProductDataSource {
|
|
208
|
+
/** 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. */
|
|
209
|
+
contentLanguage?: string;
|
|
210
|
+
/** 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. */
|
|
211
|
+
feedLabel?: string;
|
|
212
|
+
/** 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. */
|
|
213
|
+
referencingPrimaryDataSources?: DataSourceReference[];
|
|
214
|
+
}
|
|
215
|
+
interface TimeOfDay {
|
|
216
|
+
/** 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. */
|
|
217
|
+
hours?: number;
|
|
218
|
+
/** Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59. */
|
|
219
|
+
minutes?: number;
|
|
220
|
+
/** Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999. */
|
|
221
|
+
nanos?: number;
|
|
222
|
+
/** 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. */
|
|
223
|
+
seconds?: number;
|
|
224
|
+
}
|
|
225
|
+
interface FileUploadsResource {
|
|
226
|
+
/** Gets the latest data source file upload. Only the `latest` alias is accepted for a file upload. */
|
|
227
|
+
get(request?: {
|
|
228
|
+
/** V1 error format. */
|
|
229
|
+
'$.xgafv'?: string;
|
|
230
|
+
/** OAuth access token. */
|
|
231
|
+
access_token?: string;
|
|
232
|
+
/** Data format for response. */
|
|
233
|
+
alt?: string;
|
|
234
|
+
/** JSONP */
|
|
235
|
+
callback?: string;
|
|
236
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
237
|
+
fields?: string;
|
|
238
|
+
/** 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. */
|
|
239
|
+
key?: string;
|
|
240
|
+
/** Required. The name of the data source file upload to retrieve. Format: `accounts/{account}/dataSources/{datasource}/fileUploads/latest` */
|
|
241
|
+
name: string;
|
|
242
|
+
/** OAuth 2.0 token for the current user. */
|
|
243
|
+
oauth_token?: string;
|
|
244
|
+
/** Returns response with indentations and line breaks. */
|
|
245
|
+
prettyPrint?: boolean;
|
|
246
|
+
/** 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. */
|
|
247
|
+
quotaUser?: string;
|
|
248
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
249
|
+
upload_protocol?: string;
|
|
250
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
251
|
+
uploadType?: string;
|
|
252
|
+
}): Request<FileUpload>;
|
|
253
|
+
}
|
|
254
|
+
interface DataSourcesResource {
|
|
255
|
+
/** Creates the new data source configuration for the given account. This method always creates a new data source. */
|
|
256
|
+
create(request: {
|
|
257
|
+
/** V1 error format. */
|
|
258
|
+
'$.xgafv'?: string;
|
|
259
|
+
/** OAuth access token. */
|
|
260
|
+
access_token?: string;
|
|
261
|
+
/** Data format for response. */
|
|
262
|
+
alt?: string;
|
|
263
|
+
/** JSONP */
|
|
264
|
+
callback?: string;
|
|
265
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
266
|
+
fields?: string;
|
|
267
|
+
/** 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. */
|
|
268
|
+
key?: string;
|
|
269
|
+
/** OAuth 2.0 token for the current user. */
|
|
270
|
+
oauth_token?: string;
|
|
271
|
+
/** Required. The account where this data source will be created. Format: `accounts/{account}` */
|
|
272
|
+
parent: string;
|
|
273
|
+
/** Returns response with indentations and line breaks. */
|
|
274
|
+
prettyPrint?: boolean;
|
|
275
|
+
/** 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. */
|
|
276
|
+
quotaUser?: string;
|
|
277
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
278
|
+
upload_protocol?: string;
|
|
279
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
280
|
+
uploadType?: string;
|
|
281
|
+
/** Request body */
|
|
282
|
+
resource: DataSource;
|
|
283
|
+
}): Request<DataSource>;
|
|
284
|
+
create(
|
|
285
|
+
request: {
|
|
286
|
+
/** V1 error format. */
|
|
287
|
+
'$.xgafv'?: string;
|
|
288
|
+
/** OAuth access token. */
|
|
289
|
+
access_token?: string;
|
|
290
|
+
/** Data format for response. */
|
|
291
|
+
alt?: string;
|
|
292
|
+
/** JSONP */
|
|
293
|
+
callback?: string;
|
|
294
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
295
|
+
fields?: string;
|
|
296
|
+
/** 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. */
|
|
297
|
+
key?: string;
|
|
298
|
+
/** OAuth 2.0 token for the current user. */
|
|
299
|
+
oauth_token?: string;
|
|
300
|
+
/** Required. The account where this data source will be created. Format: `accounts/{account}` */
|
|
301
|
+
parent: string;
|
|
302
|
+
/** Returns response with indentations and line breaks. */
|
|
303
|
+
prettyPrint?: boolean;
|
|
304
|
+
/** 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. */
|
|
305
|
+
quotaUser?: string;
|
|
306
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
307
|
+
upload_protocol?: string;
|
|
308
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
309
|
+
uploadType?: string;
|
|
310
|
+
},
|
|
311
|
+
body: DataSource,
|
|
312
|
+
): Request<DataSource>;
|
|
313
|
+
/** Deletes a data source from your Merchant Center account. */
|
|
314
|
+
delete(request?: {
|
|
315
|
+
/** V1 error format. */
|
|
316
|
+
'$.xgafv'?: string;
|
|
317
|
+
/** OAuth access token. */
|
|
318
|
+
access_token?: string;
|
|
319
|
+
/** Data format for response. */
|
|
320
|
+
alt?: string;
|
|
321
|
+
/** JSONP */
|
|
322
|
+
callback?: string;
|
|
323
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
324
|
+
fields?: string;
|
|
325
|
+
/** 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. */
|
|
326
|
+
key?: string;
|
|
327
|
+
/** Required. The name of the data source to delete. Format: `accounts/{account}/dataSources/{datasource}` */
|
|
328
|
+
name: string;
|
|
329
|
+
/** OAuth 2.0 token for the current user. */
|
|
330
|
+
oauth_token?: string;
|
|
331
|
+
/** Returns response with indentations and line breaks. */
|
|
332
|
+
prettyPrint?: boolean;
|
|
333
|
+
/** 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. */
|
|
334
|
+
quotaUser?: string;
|
|
335
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
336
|
+
upload_protocol?: string;
|
|
337
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
338
|
+
uploadType?: string;
|
|
339
|
+
}): Request<{}>;
|
|
340
|
+
/** 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. */
|
|
341
|
+
fetch(request: {
|
|
342
|
+
/** V1 error format. */
|
|
343
|
+
'$.xgafv'?: string;
|
|
344
|
+
/** OAuth access token. */
|
|
345
|
+
access_token?: string;
|
|
346
|
+
/** Data format for response. */
|
|
347
|
+
alt?: string;
|
|
348
|
+
/** JSONP */
|
|
349
|
+
callback?: string;
|
|
350
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
351
|
+
fields?: string;
|
|
352
|
+
/** 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. */
|
|
353
|
+
key?: string;
|
|
354
|
+
/** Required. The name of the data source resource to fetch. Format: `accounts/{account}/dataSources/{datasource}` */
|
|
355
|
+
name: string;
|
|
356
|
+
/** OAuth 2.0 token for the current user. */
|
|
357
|
+
oauth_token?: string;
|
|
358
|
+
/** Returns response with indentations and line breaks. */
|
|
359
|
+
prettyPrint?: boolean;
|
|
360
|
+
/** 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. */
|
|
361
|
+
quotaUser?: string;
|
|
362
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
363
|
+
upload_protocol?: string;
|
|
364
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
365
|
+
uploadType?: string;
|
|
366
|
+
/** Request body */
|
|
367
|
+
resource: FetchDataSourceRequest;
|
|
368
|
+
}): Request<{}>;
|
|
369
|
+
fetch(
|
|
370
|
+
request: {
|
|
371
|
+
/** V1 error format. */
|
|
372
|
+
'$.xgafv'?: string;
|
|
373
|
+
/** OAuth access token. */
|
|
374
|
+
access_token?: string;
|
|
375
|
+
/** Data format for response. */
|
|
376
|
+
alt?: string;
|
|
377
|
+
/** JSONP */
|
|
378
|
+
callback?: string;
|
|
379
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
380
|
+
fields?: string;
|
|
381
|
+
/** 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. */
|
|
382
|
+
key?: string;
|
|
383
|
+
/** Required. The name of the data source resource to fetch. Format: `accounts/{account}/dataSources/{datasource}` */
|
|
384
|
+
name: string;
|
|
385
|
+
/** OAuth 2.0 token for the current user. */
|
|
386
|
+
oauth_token?: string;
|
|
387
|
+
/** Returns response with indentations and line breaks. */
|
|
388
|
+
prettyPrint?: boolean;
|
|
389
|
+
/** 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. */
|
|
390
|
+
quotaUser?: string;
|
|
391
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
392
|
+
upload_protocol?: string;
|
|
393
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
394
|
+
uploadType?: string;
|
|
395
|
+
},
|
|
396
|
+
body: FetchDataSourceRequest,
|
|
397
|
+
): Request<{}>;
|
|
398
|
+
/** Retrieves the data source configuration for the given account. */
|
|
399
|
+
get(request?: {
|
|
400
|
+
/** V1 error format. */
|
|
401
|
+
'$.xgafv'?: string;
|
|
402
|
+
/** OAuth access token. */
|
|
403
|
+
access_token?: string;
|
|
404
|
+
/** Data format for response. */
|
|
405
|
+
alt?: string;
|
|
406
|
+
/** JSONP */
|
|
407
|
+
callback?: string;
|
|
408
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
409
|
+
fields?: string;
|
|
410
|
+
/** 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. */
|
|
411
|
+
key?: string;
|
|
412
|
+
/** Required. The name of the data source to retrieve. Format: `accounts/{account}/dataSources/{datasource}` */
|
|
413
|
+
name: string;
|
|
414
|
+
/** OAuth 2.0 token for the current user. */
|
|
415
|
+
oauth_token?: string;
|
|
416
|
+
/** Returns response with indentations and line breaks. */
|
|
417
|
+
prettyPrint?: boolean;
|
|
418
|
+
/** 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. */
|
|
419
|
+
quotaUser?: string;
|
|
420
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
421
|
+
upload_protocol?: string;
|
|
422
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
423
|
+
uploadType?: string;
|
|
424
|
+
}): Request<DataSource>;
|
|
425
|
+
/** Lists the configurations for data sources for the given account. */
|
|
426
|
+
list(request?: {
|
|
427
|
+
/** V1 error format. */
|
|
428
|
+
'$.xgafv'?: string;
|
|
429
|
+
/** OAuth access token. */
|
|
430
|
+
access_token?: string;
|
|
431
|
+
/** Data format for response. */
|
|
432
|
+
alt?: string;
|
|
433
|
+
/** JSONP */
|
|
434
|
+
callback?: string;
|
|
435
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
436
|
+
fields?: string;
|
|
437
|
+
/** 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. */
|
|
438
|
+
key?: string;
|
|
439
|
+
/** OAuth 2.0 token for the current user. */
|
|
440
|
+
oauth_token?: string;
|
|
441
|
+
/** 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. */
|
|
442
|
+
pageSize?: number;
|
|
443
|
+
/** 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. */
|
|
444
|
+
pageToken?: string;
|
|
445
|
+
/** Required. The account to list data sources for. Format: `accounts/{account}` */
|
|
446
|
+
parent: string;
|
|
447
|
+
/** Returns response with indentations and line breaks. */
|
|
448
|
+
prettyPrint?: boolean;
|
|
449
|
+
/** 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. */
|
|
450
|
+
quotaUser?: string;
|
|
451
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
452
|
+
upload_protocol?: string;
|
|
453
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
454
|
+
uploadType?: string;
|
|
455
|
+
}): Request<ListDataSourcesResponse>;
|
|
456
|
+
/** Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted. */
|
|
457
|
+
patch(request: {
|
|
458
|
+
/** V1 error format. */
|
|
459
|
+
'$.xgafv'?: string;
|
|
460
|
+
/** OAuth access token. */
|
|
461
|
+
access_token?: string;
|
|
462
|
+
/** Data format for response. */
|
|
463
|
+
alt?: string;
|
|
464
|
+
/** JSONP */
|
|
465
|
+
callback?: string;
|
|
466
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
467
|
+
fields?: string;
|
|
468
|
+
/** 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. */
|
|
469
|
+
key?: string;
|
|
470
|
+
/** Required. Identifier. The name of the data source. Format: `accounts/{account}/dataSources/{datasource}` */
|
|
471
|
+
name: string;
|
|
472
|
+
/** OAuth 2.0 token for the current user. */
|
|
473
|
+
oauth_token?: string;
|
|
474
|
+
/** Returns response with indentations and line breaks. */
|
|
475
|
+
prettyPrint?: boolean;
|
|
476
|
+
/** 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. */
|
|
477
|
+
quotaUser?: string;
|
|
478
|
+
/** 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. */
|
|
479
|
+
updateMask?: string;
|
|
480
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
481
|
+
upload_protocol?: string;
|
|
482
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
483
|
+
uploadType?: string;
|
|
484
|
+
/** Request body */
|
|
485
|
+
resource: DataSource;
|
|
486
|
+
}): Request<DataSource>;
|
|
487
|
+
patch(
|
|
488
|
+
request: {
|
|
489
|
+
/** V1 error format. */
|
|
490
|
+
'$.xgafv'?: string;
|
|
491
|
+
/** OAuth access token. */
|
|
492
|
+
access_token?: string;
|
|
493
|
+
/** Data format for response. */
|
|
494
|
+
alt?: string;
|
|
495
|
+
/** JSONP */
|
|
496
|
+
callback?: string;
|
|
497
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
498
|
+
fields?: string;
|
|
499
|
+
/** 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. */
|
|
500
|
+
key?: string;
|
|
501
|
+
/** Required. Identifier. The name of the data source. Format: `accounts/{account}/dataSources/{datasource}` */
|
|
502
|
+
name: string;
|
|
503
|
+
/** OAuth 2.0 token for the current user. */
|
|
504
|
+
oauth_token?: string;
|
|
505
|
+
/** Returns response with indentations and line breaks. */
|
|
506
|
+
prettyPrint?: boolean;
|
|
507
|
+
/** 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. */
|
|
508
|
+
quotaUser?: string;
|
|
509
|
+
/** 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. */
|
|
510
|
+
updateMask?: string;
|
|
511
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
512
|
+
upload_protocol?: string;
|
|
513
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
514
|
+
uploadType?: string;
|
|
515
|
+
},
|
|
516
|
+
body: DataSource,
|
|
517
|
+
): Request<DataSource>;
|
|
518
|
+
fileUploads: FileUploadsResource;
|
|
519
|
+
}
|
|
520
|
+
interface AccountsResource {
|
|
521
|
+
dataSources: DataSourcesResource;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const accounts: AccountsResource;
|
|
525
|
+
}
|
|
526
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.merchantapi-datasources_v1",
|
|
3
|
+
"version": "0.0.20250804",
|
|
4
|
+
"description": "TypeScript typings for Merchant API datasources_v1",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Maxim Mazurok",
|
|
12
|
+
"email": "maxim@mazurok.com",
|
|
13
|
+
"url": "https://maxim.mazurok.com"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery-v1": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# TypeScript typings for Merchant API datasources_v1
|
|
2
|
+
|
|
3
|
+
Programmatically manage your Merchant Center Accounts.
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/merchant/api).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Merchant API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.merchantapi-datasources_v1 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load(
|
|
29
|
+
'https://merchantapi.googleapis.com/$discovery/rest?version=datasources_v1',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.merchantapi
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
39
|
+
gapi.client.load('merchantapi', 'datasources_v1', () => {
|
|
40
|
+
// now we can use:
|
|
41
|
+
// gapi.client.merchantapi
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// declare client_id registered in Google Developers Console
|
|
49
|
+
var client_id = '',
|
|
50
|
+
scope = [
|
|
51
|
+
// Manage your product listings and accounts for Google Shopping
|
|
52
|
+
'https://www.googleapis.com/auth/content',
|
|
53
|
+
],
|
|
54
|
+
immediate = true;
|
|
55
|
+
// ...
|
|
56
|
+
|
|
57
|
+
gapi.auth.authorize(
|
|
58
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
59
|
+
authResult => {
|
|
60
|
+
if (authResult && !authResult.error) {
|
|
61
|
+
/* handle successful authorization */
|
|
62
|
+
} else {
|
|
63
|
+
/* handle authorization error */
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
After that you can use Merchant API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
|
|
73
|
+
```
|