@maxim_mazurok/gapi.client.css-v1 0.0.20240614

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 (3) hide show
  1. package/index.d.ts +759 -0
  2. package/package.json +20 -0
  3. package/readme.md +86 -0
package/index.d.ts ADDED
@@ -0,0 +1,759 @@
1
+ /* Type definitions for non-npm package CSS API v1 0.0 */
2
+ // Project: https://developers.google.com/comparison-shopping-services/api/overview
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://css.googleapis.com/$discovery/rest?version=v1
12
+ // Revision: 20240614
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load CSS API v1 */
18
+ function load(
19
+ urlOrObject: 'https://css.googleapis.com/$discovery/rest?version=v1'
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'css', version: 'v1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(name: 'css', version: 'v1', callback: () => any): void;
25
+
26
+ namespace css {
27
+ interface Account {
28
+ /** Output only. The type of this account. */
29
+ accountType?: string;
30
+ /** Automatically created label IDs assigned to the MC account by CSS Center. */
31
+ automaticLabelIds?: string[];
32
+ /** The CSS/MC account's short display name. */
33
+ displayName?: string;
34
+ /** Output only. Immutable. The CSS/MC account's full name. */
35
+ fullName?: string;
36
+ /** Output only. Immutable. The CSS/MC account's homepage. */
37
+ homepageUri?: string;
38
+ /** Manually created label IDs assigned to the CSS/MC account by a CSS parent account. */
39
+ labelIds?: string[];
40
+ /** The label resource name. Format: accounts/{account} */
41
+ name?: string;
42
+ /** The CSS/MC account's parent resource. CSS group for CSS domains; CSS domain for MC accounts. Returned only if the user has access to the parent account. */
43
+ parent?: string;
44
+ }
45
+ interface AccountLabel {
46
+ /** Output only. The ID of account this label belongs to. */
47
+ accountId?: string;
48
+ /** The description of this label. */
49
+ description?: string;
50
+ /** The display name of this label. */
51
+ displayName?: string;
52
+ /** Output only. The ID of the label. */
53
+ labelId?: string;
54
+ /** Output only. The type of this label. */
55
+ labelType?: string;
56
+ /** The resource name of the label. Format: accounts/{account}/labels/{label} */
57
+ name?: string;
58
+ }
59
+ interface Attributes {
60
+ /** Additional URL of images of the item. */
61
+ additionalImageLinks?: string[];
62
+ /** Set to true if the item is targeted towards adults. */
63
+ adult?: boolean;
64
+ /** Target age group of the item. */
65
+ ageGroup?: string;
66
+ /** Product Related Attributes.[14-36] Brand of the item. */
67
+ brand?: string;
68
+ /** A list of certificates claimed by the CSS for the given product. */
69
+ certifications?: Certification[];
70
+ /** Color of the item. */
71
+ color?: string;
72
+ /** Allows advertisers to override the item URL when the product is shown within the context of Product Ads. */
73
+ cppAdsRedirect?: string;
74
+ /** URL directly linking to your the Product Detail Page of the CSS. */
75
+ cppLink?: string;
76
+ /** URL for the mobile-optimized version of the Product Detail Page of the CSS. */
77
+ cppMobileLink?: string;
78
+ /** Custom label 0 for custom grouping of items in a Shopping campaign. */
79
+ customLabel0?: string;
80
+ /** Custom label 1 for custom grouping of items in a Shopping campaign. */
81
+ customLabel1?: string;
82
+ /** Custom label 2 for custom grouping of items in a Shopping campaign. */
83
+ customLabel2?: string;
84
+ /** Custom label 3 for custom grouping of items in a Shopping campaign. */
85
+ customLabel3?: string;
86
+ /** Custom label 4 for custom grouping of items in a Shopping campaign. */
87
+ customLabel4?: string;
88
+ /** Description of the item. */
89
+ description?: string;
90
+ /** The list of destinations to exclude for this target (corresponds to unchecked check boxes in Merchant Center). */
91
+ excludedDestinations?: string[];
92
+ /** Date on which the item should expire, as specified upon insertion, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual expiration date is exposed in `productstatuses` as [googleExpirationDate](https://support.google.com/merchants/answer/6324499) and might be earlier if `expirationDate` is too far in the future. Note: It may take 2+ days from the expiration date for the item to actually get deleted. */
93
+ expirationDate?: string;
94
+ /** Target gender of the item. */
95
+ gender?: string;
96
+ /** Google's category of the item (see [Google product taxonomy](https://support.google.com/merchants/answer/1705911)). When querying products, this field will contain the user provided value. There is currently no way to get back the auto assigned google product categories through the API. */
97
+ googleProductCategory?: string;
98
+ /** Global Trade Item Number ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the item. */
99
+ gtin?: string;
100
+ /** Condition of the headline offer. */
101
+ headlineOfferCondition?: string;
102
+ /** Link to the headline offer. */
103
+ headlineOfferLink?: string;
104
+ /** Mobile Link to the headline offer. */
105
+ headlineOfferMobileLink?: string;
106
+ /** Headline Price of the aggregate offer. */
107
+ headlineOfferPrice?: Price;
108
+ /** Headline Price of the aggregate offer. */
109
+ headlineOfferShippingPrice?: Price;
110
+ /** High Price of the aggregate offer. */
111
+ highPrice?: Price;
112
+ /** URL of an image of the item. */
113
+ imageLink?: string;
114
+ /** The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center). Default destinations are always included unless provided in `excludedDestinations`. */
115
+ includedDestinations?: string[];
116
+ /** Whether the item is a merchant-defined bundle. A bundle is a custom grouping of different products sold by a merchant for a single price. */
117
+ isBundle?: boolean;
118
+ /** Shared identifier for all variants of the same product. */
119
+ itemGroupId?: string;
120
+ /** Low Price of the aggregate offer. */
121
+ lowPrice?: Price;
122
+ /** The material of which the item is made. */
123
+ material?: string;
124
+ /** Manufacturer Part Number ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the item. */
125
+ mpn?: string;
126
+ /** The number of identical products in a merchant-defined multipack. */
127
+ multipack?: string;
128
+ /** The number of aggregate offers. */
129
+ numberOfOffers?: string;
130
+ /** The item's pattern (e.g. polka dots). */
131
+ pattern?: string;
132
+ /** Publication of this item will be temporarily paused. */
133
+ pause?: string;
134
+ /** Technical specification or additional product details. */
135
+ productDetails?: ProductDetail[];
136
+ /** The height of the product in the units provided. The value must be between 0 (exclusive) and 3000 (inclusive). */
137
+ productHeight?: ProductDimension;
138
+ /** Bullet points describing the most relevant highlights of a product. */
139
+ productHighlights?: string[];
140
+ /** The length of the product in the units provided. The value must be between 0 (exclusive) and 3000 (inclusive). */
141
+ productLength?: ProductDimension;
142
+ /** Categories of the item (formatted as in [products data specification](https://support.google.com/merchants/answer/6324406)). */
143
+ productTypes?: string[];
144
+ /** The weight of the product in the units provided. The value must be between 0 (exclusive) and 2000 (inclusive). */
145
+ productWeight?: ProductWeight;
146
+ /** The width of the product in the units provided. The value must be between 0 (exclusive) and 3000 (inclusive). */
147
+ productWidth?: ProductDimension;
148
+ /** Size of the item. Only one value is allowed. For variants with different sizes, insert a separate product for each size with the same `itemGroupId` value (see [https://support.google.com/merchants/answer/6324492](size definition)). */
149
+ size?: string;
150
+ /** System in which the size is specified. Recommended for apparel items. */
151
+ sizeSystem?: string;
152
+ /** The cut of the item. It can be used to represent combined size types for apparel items. Maximum two of size types can be provided (see [https://support.google.com/merchants/answer/6324497](size type)). */
153
+ sizeTypes?: string[];
154
+ /** Title of the item. */
155
+ title?: string;
156
+ }
157
+ interface Certification {
158
+ /** Name of the certification body. */
159
+ authority?: string;
160
+ /** A unique code to identify the certification. */
161
+ code?: string;
162
+ /** Name of the certification. */
163
+ name?: string;
164
+ }
165
+ interface CssProduct {
166
+ /** Output only. A list of product attributes. */
167
+ attributes?: Attributes;
168
+ /** Output only. The two-letter [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the product. */
169
+ contentLanguage?: string;
170
+ /** Output only. The status of a product, data validation issues, that is, information about a product computed asynchronously. */
171
+ cssProductStatus?: CssProductStatus;
172
+ /** Output only. A list of custom (CSS-provided) attributes. It can also be used to submit any attribute of the feed specification in its generic form (for example, `{ "name": "size type", "value": "regular" }`). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google. */
173
+ customAttributes?: CustomAttribute[];
174
+ /** Output only. The feed label for the product. */
175
+ feedLabel?: string;
176
+ /** The name of the CSS Product. Format: `"accounts/{account}/cssProducts/{css_product}"` */
177
+ name?: string;
178
+ /** Output only. Your unique raw identifier for the product. */
179
+ rawProvidedId?: string;
180
+ }
181
+ interface CssProductInput {
182
+ /** A list of CSS Product attributes. */
183
+ attributes?: Attributes;
184
+ /** Required. The two-letter [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS Product. */
185
+ contentLanguage?: string;
186
+ /** A list of custom (CSS-provided) attributes. It can also be used for submitting any attribute of the feed specification in its generic form (for example: `{ "name": "size type", "value": "regular" }`). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google. */
187
+ customAttributes?: CustomAttribute[];
188
+ /** Required. The [feed label](https://developers.google.com/shopping-content/guides/products/feed-labels) for the CSS Product. Feed Label is synonymous to "target country" and hence should always be a valid region code. For example: 'DE' for Germany, 'FR' for France. */
189
+ feedLabel?: string;
190
+ /** Output only. The name of the processed CSS Product. Format: `accounts/{account}/cssProducts/{css_product}` " */
191
+ finalName?: string;
192
+ /** Represents the existing version (freshness) of the CSS Product, which can be used to preserve the right order when multiple updates are done at the same time. This field must not be set to the future time. If set, the update is prevented if a newer version of the item already exists in our system (that is the last update time of the existing CSS products is later than the freshness time set in the update). If the update happens, the last update time is then set to this freshness time. If not set, the update will not be prevented and the last update time will default to when this request was received by the CSS API. If the operation is prevented, the aborted exception will be thrown. */
193
+ freshnessTime?: string;
194
+ /** The name of the CSS Product input. Format: `accounts/{account}/cssProductInputs/{css_product_input}` */
195
+ name?: string;
196
+ /** Required. Your unique identifier for the CSS Product. This is the same for the CSS Product input and processed CSS Product. We only allow ids with alphanumerics, underscores and dashes. See the [products feed specification](https://support.google.com/merchants/answer/188494#id) for details. */
197
+ rawProvidedId?: string;
198
+ }
199
+ interface CssProductStatus {
200
+ /** Date on which the item has been created, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format. */
201
+ creationDate?: string;
202
+ /** The intended destinations for the product. */
203
+ destinationStatuses?: DestinationStatus[];
204
+ /** Date on which the item expires, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format. */
205
+ googleExpirationDate?: string;
206
+ /** A list of all issues associated with the product. */
207
+ itemLevelIssues?: ItemLevelIssue[];
208
+ /** Date on which the item has been last updated, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format. */
209
+ lastUpdateDate?: string;
210
+ }
211
+ interface CustomAttribute {
212
+ /** Subattributes within this attribute group. If `group_values` is not empty, `value` must be empty. */
213
+ groupValues?: CustomAttribute[];
214
+ /** The name of the attribute. */
215
+ name?: string;
216
+ /** The value of the attribute. If `value` is not empty, `group_values` must be empty. */
217
+ value?: string;
218
+ }
219
+ interface DestinationStatus {
220
+ /** List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is approved. */
221
+ approvedCountries?: string[];
222
+ /** The name of the destination */
223
+ destination?: string;
224
+ /** List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is disapproved. */
225
+ disapprovedCountries?: string[];
226
+ /** List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is pending approval. */
227
+ pendingCountries?: string[];
228
+ }
229
+ interface Empty {}
230
+ interface ItemLevelIssue {
231
+ /** List of country codes (ISO 3166-1 alpha-2) where issue applies to the aggregate offer. */
232
+ applicableCountries?: string[];
233
+ /** The attribute's name, if the issue is caused by a single attribute. */
234
+ attribute?: string;
235
+ /** The error code of the issue. */
236
+ code?: string;
237
+ /** A short issue description in English. */
238
+ description?: string;
239
+ /** The destination the issue applies to. */
240
+ destination?: string;
241
+ /** A detailed issue description in English. */
242
+ detail?: string;
243
+ /** The URL of a web page to help with resolving this issue. */
244
+ documentation?: string;
245
+ /** Whether the issue can be resolved by the merchant. */
246
+ resolution?: string;
247
+ /** How this issue affects serving of the aggregate offer. */
248
+ servability?: string;
249
+ }
250
+ interface ListAccountLabelsResponse {
251
+ /** The labels from the specified account. */
252
+ accountLabels?: AccountLabel[];
253
+ /** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
254
+ nextPageToken?: string;
255
+ }
256
+ interface ListChildAccountsResponse {
257
+ /** The CSS/MC accounts returned for the specified CSS parent account. */
258
+ accounts?: Account[];
259
+ /** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
260
+ nextPageToken?: string;
261
+ }
262
+ interface ListCssProductsResponse {
263
+ /** The processed CSS products from the specified account. These are your processed CSS products after applying rules and supplemental feeds. */
264
+ cssProducts?: CssProduct[];
265
+ /** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
266
+ nextPageToken?: string;
267
+ }
268
+ interface Price {
269
+ /** The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros). */
270
+ amountMicros?: string;
271
+ /** The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217). */
272
+ currencyCode?: string;
273
+ }
274
+ interface ProductDetail {
275
+ /** The name of the product detail. */
276
+ attributeName?: string;
277
+ /** The value of the product detail. */
278
+ attributeValue?: string;
279
+ /** The section header used to group a set of product details. */
280
+ sectionName?: string;
281
+ }
282
+ interface ProductDimension {
283
+ /** Required. The dimension units. Acceptable values are: * "`in`" * "`cm`" */
284
+ unit?: string;
285
+ /** Required. The dimension value represented as a number. The value can have a maximum precision of four decimal places. */
286
+ value?: number;
287
+ }
288
+ interface ProductWeight {
289
+ /** Required. The weight unit. Acceptable values are: * "`g`" * "`kg`" * "`oz`" * "`lb`" */
290
+ unit?: string;
291
+ /** Required. The weight represented as a number. The weight can have a maximum precision of four decimal places. */
292
+ value?: number;
293
+ }
294
+ interface UpdateAccountLabelsRequest {
295
+ /** The list of label IDs to overwrite the existing account label IDs. If the list is empty, all currently assigned label IDs will be deleted. */
296
+ labelIds?: string[];
297
+ /** Optional. Only required when updating MC account labels. The CSS domain that is the parent resource of the MC account. Format: accounts/{account} */
298
+ parent?: string;
299
+ }
300
+ interface CssProductInputsResource {
301
+ /** Deletes a CSS Product input from your CSS Center account. After a delete it may take several minutes until the input is no longer available. */
302
+ delete(request?: {
303
+ /** V1 error format. */
304
+ '$.xgafv'?: string;
305
+ /** OAuth access token. */
306
+ access_token?: string;
307
+ /** Data format for response. */
308
+ alt?: string;
309
+ /** JSONP */
310
+ callback?: string;
311
+ /** Selector specifying which fields to include in a partial response. */
312
+ fields?: string;
313
+ /** 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. */
314
+ key?: string;
315
+ /** Required. The name of the CSS product input resource to delete. Format: accounts/{account}/cssProductInputs/{css_product_input} */
316
+ name: string;
317
+ /** OAuth 2.0 token for the current user. */
318
+ oauth_token?: string;
319
+ /** Returns response with indentations and line breaks. */
320
+ prettyPrint?: boolean;
321
+ /** 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. */
322
+ quotaUser?: string;
323
+ /** The Content API Supplemental Feed ID. The field must not be set if the action applies to a primary feed. If the field is set, then product action applies to a supplemental feed instead of primary Content API feed. */
324
+ supplementalFeedId?: string;
325
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
326
+ upload_protocol?: string;
327
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
328
+ uploadType?: string;
329
+ }): Request<{}>;
330
+ /** Uploads a CssProductInput to your CSS Center account. If an input with the same contentLanguage, identity, feedLabel and feedId already exists, this method replaces that entry. After inserting, updating, or deleting a CSS Product input, it may take several minutes before the processed CSS Product can be retrieved. */
331
+ insert(request: {
332
+ /** V1 error format. */
333
+ '$.xgafv'?: string;
334
+ /** OAuth access token. */
335
+ access_token?: string;
336
+ /** Data format for response. */
337
+ alt?: string;
338
+ /** JSONP */
339
+ callback?: string;
340
+ /** Required. The primary or supplemental feed id. If CSS Product already exists and feed id provided is different, then the CSS Product will be moved to a new feed. Note: For now, CSSs do not need to provide feed ids as we create feeds on the fly. We do not have supplemental feed support for CSS Products yet. */
341
+ feedId?: string;
342
+ /** Selector specifying which fields to include in a partial response. */
343
+ fields?: string;
344
+ /** 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. */
345
+ key?: string;
346
+ /** OAuth 2.0 token for the current user. */
347
+ oauth_token?: string;
348
+ /** Required. The account where this CSS Product will be inserted. Format: accounts/{account} */
349
+ parent: string;
350
+ /** Returns response with indentations and line breaks. */
351
+ prettyPrint?: boolean;
352
+ /** 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. */
353
+ quotaUser?: string;
354
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
355
+ upload_protocol?: string;
356
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
357
+ uploadType?: string;
358
+ /** Request body */
359
+ resource: CssProductInput;
360
+ }): Request<CssProductInput>;
361
+ insert(
362
+ request: {
363
+ /** V1 error format. */
364
+ '$.xgafv'?: string;
365
+ /** OAuth access token. */
366
+ access_token?: string;
367
+ /** Data format for response. */
368
+ alt?: string;
369
+ /** JSONP */
370
+ callback?: string;
371
+ /** Required. The primary or supplemental feed id. If CSS Product already exists and feed id provided is different, then the CSS Product will be moved to a new feed. Note: For now, CSSs do not need to provide feed ids as we create feeds on the fly. We do not have supplemental feed support for CSS Products yet. */
372
+ feedId?: string;
373
+ /** Selector specifying which fields to include in a partial response. */
374
+ fields?: string;
375
+ /** 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. */
376
+ key?: string;
377
+ /** OAuth 2.0 token for the current user. */
378
+ oauth_token?: string;
379
+ /** Required. The account where this CSS Product will be inserted. Format: accounts/{account} */
380
+ parent: string;
381
+ /** Returns response with indentations and line breaks. */
382
+ prettyPrint?: boolean;
383
+ /** 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. */
384
+ quotaUser?: string;
385
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
386
+ upload_protocol?: string;
387
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
388
+ uploadType?: string;
389
+ },
390
+ body: CssProductInput
391
+ ): Request<CssProductInput>;
392
+ }
393
+ interface CssProductsResource {
394
+ /** Retrieves the processed CSS Product from your CSS Center account. After inserting, updating, or deleting a product input, it may take several minutes before the updated final product can be retrieved. */
395
+ get(request?: {
396
+ /** V1 error format. */
397
+ '$.xgafv'?: string;
398
+ /** OAuth access token. */
399
+ access_token?: string;
400
+ /** Data format for response. */
401
+ alt?: string;
402
+ /** JSONP */
403
+ callback?: string;
404
+ /** Selector specifying which fields to include in a partial response. */
405
+ fields?: string;
406
+ /** 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. */
407
+ key?: string;
408
+ /** Required. The name of the CSS product to retrieve. */
409
+ name: string;
410
+ /** OAuth 2.0 token for the current user. */
411
+ oauth_token?: string;
412
+ /** Returns response with indentations and line breaks. */
413
+ prettyPrint?: boolean;
414
+ /** 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. */
415
+ quotaUser?: string;
416
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
417
+ upload_protocol?: string;
418
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
419
+ uploadType?: string;
420
+ }): Request<CssProduct>;
421
+ /** Lists the processed CSS Products in your CSS Center account. The response might contain fewer items than specified by pageSize. Rely on pageToken to determine if there are more items to be requested. After inserting, updating, or deleting a CSS product input, it may take several minutes before the updated processed CSS product can be retrieved. */
422
+ list(request?: {
423
+ /** V1 error format. */
424
+ '$.xgafv'?: string;
425
+ /** OAuth access token. */
426
+ access_token?: string;
427
+ /** Data format for response. */
428
+ alt?: string;
429
+ /** JSONP */
430
+ callback?: string;
431
+ /** Selector specifying which fields to include in a partial response. */
432
+ fields?: string;
433
+ /** 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. */
434
+ key?: string;
435
+ /** OAuth 2.0 token for the current user. */
436
+ oauth_token?: string;
437
+ /** The maximum number of CSS Products 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 CSS products will be returned. */
438
+ pageSize?: number;
439
+ /** A page token, received from a previous `ListCssProducts` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCssProducts` must match the call that provided the page token. */
440
+ pageToken?: string;
441
+ /** Required. The account/domain to list processed CSS Products for. Format: accounts/{account} */
442
+ parent: string;
443
+ /** Returns response with indentations and line breaks. */
444
+ prettyPrint?: boolean;
445
+ /** 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. */
446
+ quotaUser?: string;
447
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
448
+ upload_protocol?: string;
449
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
450
+ uploadType?: string;
451
+ }): Request<ListCssProductsResponse>;
452
+ }
453
+ interface LabelsResource {
454
+ /** Creates a new label, not assigned to any account. */
455
+ create(request: {
456
+ /** V1 error format. */
457
+ '$.xgafv'?: string;
458
+ /** OAuth access token. */
459
+ access_token?: string;
460
+ /** Data format for response. */
461
+ alt?: string;
462
+ /** JSONP */
463
+ callback?: string;
464
+ /** Selector specifying which fields to include in a partial response. */
465
+ fields?: string;
466
+ /** 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. */
467
+ key?: string;
468
+ /** OAuth 2.0 token for the current user. */
469
+ oauth_token?: string;
470
+ /** Required. The parent account. Format: accounts/{account} */
471
+ parent: string;
472
+ /** Returns response with indentations and line breaks. */
473
+ prettyPrint?: boolean;
474
+ /** 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. */
475
+ quotaUser?: string;
476
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
477
+ upload_protocol?: string;
478
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
479
+ uploadType?: string;
480
+ /** Request body */
481
+ resource: AccountLabel;
482
+ }): Request<AccountLabel>;
483
+ create(
484
+ request: {
485
+ /** V1 error format. */
486
+ '$.xgafv'?: string;
487
+ /** OAuth access token. */
488
+ access_token?: string;
489
+ /** Data format for response. */
490
+ alt?: string;
491
+ /** JSONP */
492
+ callback?: string;
493
+ /** Selector specifying which fields to include in a partial response. */
494
+ fields?: string;
495
+ /** 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. */
496
+ key?: string;
497
+ /** OAuth 2.0 token for the current user. */
498
+ oauth_token?: string;
499
+ /** Required. The parent account. Format: accounts/{account} */
500
+ parent: string;
501
+ /** Returns response with indentations and line breaks. */
502
+ prettyPrint?: boolean;
503
+ /** 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. */
504
+ quotaUser?: string;
505
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
506
+ upload_protocol?: string;
507
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
508
+ uploadType?: string;
509
+ },
510
+ body: AccountLabel
511
+ ): Request<AccountLabel>;
512
+ /** Deletes a label and removes it from all accounts to which it was assigned. */
513
+ delete(request?: {
514
+ /** V1 error format. */
515
+ '$.xgafv'?: string;
516
+ /** OAuth access token. */
517
+ access_token?: string;
518
+ /** Data format for response. */
519
+ alt?: string;
520
+ /** JSONP */
521
+ callback?: string;
522
+ /** Selector specifying which fields to include in a partial response. */
523
+ fields?: string;
524
+ /** 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. */
525
+ key?: string;
526
+ /** Required. The name of the label to delete. Format: accounts/{account}/labels/{label} */
527
+ name: string;
528
+ /** OAuth 2.0 token for the current user. */
529
+ oauth_token?: string;
530
+ /** Returns response with indentations and line breaks. */
531
+ prettyPrint?: boolean;
532
+ /** 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. */
533
+ quotaUser?: string;
534
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
535
+ upload_protocol?: string;
536
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
537
+ uploadType?: string;
538
+ }): Request<{}>;
539
+ /** Lists the labels assigned to an account. */
540
+ list(request?: {
541
+ /** V1 error format. */
542
+ '$.xgafv'?: string;
543
+ /** OAuth access token. */
544
+ access_token?: string;
545
+ /** Data format for response. */
546
+ alt?: string;
547
+ /** JSONP */
548
+ callback?: string;
549
+ /** Selector specifying which fields to include in a partial response. */
550
+ fields?: string;
551
+ /** 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. */
552
+ key?: string;
553
+ /** OAuth 2.0 token for the current user. */
554
+ oauth_token?: string;
555
+ /** The maximum number of labels to return. The service may return fewer than this value. If unspecified, at most 50 labels will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. */
556
+ pageSize?: number;
557
+ /** A page token, received from a previous `ListAccountLabels` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAccountLabels` must match the call that provided the page token. */
558
+ pageToken?: string;
559
+ /** Required. The parent account. Format: accounts/{account} */
560
+ parent: string;
561
+ /** Returns response with indentations and line breaks. */
562
+ prettyPrint?: boolean;
563
+ /** 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. */
564
+ quotaUser?: string;
565
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
566
+ upload_protocol?: string;
567
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
568
+ uploadType?: string;
569
+ }): Request<ListAccountLabelsResponse>;
570
+ /** Updates a label. */
571
+ patch(request: {
572
+ /** V1 error format. */
573
+ '$.xgafv'?: string;
574
+ /** OAuth access token. */
575
+ access_token?: string;
576
+ /** Data format for response. */
577
+ alt?: string;
578
+ /** JSONP */
579
+ callback?: string;
580
+ /** Selector specifying which fields to include in a partial response. */
581
+ fields?: string;
582
+ /** 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. */
583
+ key?: string;
584
+ /** The resource name of the label. Format: accounts/{account}/labels/{label} */
585
+ name: string;
586
+ /** OAuth 2.0 token for the current user. */
587
+ oauth_token?: string;
588
+ /** Returns response with indentations and line breaks. */
589
+ prettyPrint?: boolean;
590
+ /** 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. */
591
+ quotaUser?: string;
592
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
593
+ upload_protocol?: string;
594
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
595
+ uploadType?: string;
596
+ /** Request body */
597
+ resource: AccountLabel;
598
+ }): Request<AccountLabel>;
599
+ patch(
600
+ request: {
601
+ /** V1 error format. */
602
+ '$.xgafv'?: string;
603
+ /** OAuth access token. */
604
+ access_token?: string;
605
+ /** Data format for response. */
606
+ alt?: string;
607
+ /** JSONP */
608
+ callback?: string;
609
+ /** Selector specifying which fields to include in a partial response. */
610
+ fields?: string;
611
+ /** 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. */
612
+ key?: string;
613
+ /** The resource name of the label. Format: accounts/{account}/labels/{label} */
614
+ name: string;
615
+ /** OAuth 2.0 token for the current user. */
616
+ oauth_token?: string;
617
+ /** Returns response with indentations and line breaks. */
618
+ prettyPrint?: boolean;
619
+ /** 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. */
620
+ quotaUser?: string;
621
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
622
+ upload_protocol?: string;
623
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
624
+ uploadType?: string;
625
+ },
626
+ body: AccountLabel
627
+ ): Request<AccountLabel>;
628
+ }
629
+ interface AccountsResource {
630
+ /** Retrieves a single CSS/MC account by ID. */
631
+ get(request?: {
632
+ /** V1 error format. */
633
+ '$.xgafv'?: string;
634
+ /** OAuth access token. */
635
+ access_token?: string;
636
+ /** Data format for response. */
637
+ alt?: string;
638
+ /** JSONP */
639
+ callback?: string;
640
+ /** Selector specifying which fields to include in a partial response. */
641
+ fields?: string;
642
+ /** 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. */
643
+ key?: string;
644
+ /** Required. The name of the managed CSS/MC account. Format: accounts/{account} */
645
+ name: string;
646
+ /** OAuth 2.0 token for the current user. */
647
+ oauth_token?: string;
648
+ /** Optional. Only required when retrieving MC account information. The CSS domain that is the parent resource of the MC account. Format: accounts/{account} */
649
+ parent?: string;
650
+ /** Returns response with indentations and line breaks. */
651
+ prettyPrint?: boolean;
652
+ /** 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. */
653
+ quotaUser?: string;
654
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
655
+ upload_protocol?: string;
656
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
657
+ uploadType?: string;
658
+ }): Request<Account>;
659
+ /** Lists all the accounts under the specified CSS account ID, and optionally filters by label ID and account name. */
660
+ listChildAccounts(request?: {
661
+ /** V1 error format. */
662
+ '$.xgafv'?: string;
663
+ /** OAuth access token. */
664
+ access_token?: string;
665
+ /** Data format for response. */
666
+ alt?: string;
667
+ /** JSONP */
668
+ callback?: string;
669
+ /** Selector specifying which fields to include in a partial response. */
670
+ fields?: string;
671
+ /** If set, only the MC accounts with the given name (case sensitive) will be returned. */
672
+ fullName?: string;
673
+ /** 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. */
674
+ key?: string;
675
+ /** If set, only the MC accounts with the given label ID will be returned. */
676
+ labelId?: string;
677
+ /** OAuth 2.0 token for the current user. */
678
+ oauth_token?: string;
679
+ /** Optional. The maximum number of accounts to return. The service may return fewer than this value. If unspecified, at most 50 accounts will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. */
680
+ pageSize?: number;
681
+ /** Optional. A page token, received from a previous `ListChildAccounts` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListChildAccounts` must match the call that provided the page token. */
682
+ pageToken?: string;
683
+ /** Required. The parent account. Must be a CSS group or domain. Format: accounts/{account} */
684
+ parent: string;
685
+ /** Returns response with indentations and line breaks. */
686
+ prettyPrint?: boolean;
687
+ /** 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. */
688
+ quotaUser?: string;
689
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
690
+ upload_protocol?: string;
691
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
692
+ uploadType?: string;
693
+ }): Request<ListChildAccountsResponse>;
694
+ /** Updates labels assigned to CSS/MC accounts by a CSS domain. */
695
+ updateLabels(request: {
696
+ /** V1 error format. */
697
+ '$.xgafv'?: string;
698
+ /** OAuth access token. */
699
+ access_token?: string;
700
+ /** Data format for response. */
701
+ alt?: string;
702
+ /** JSONP */
703
+ callback?: string;
704
+ /** Selector specifying which fields to include in a partial response. */
705
+ fields?: string;
706
+ /** 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. */
707
+ key?: string;
708
+ /** Required. The label resource name. Format: accounts/{account} */
709
+ name: string;
710
+ /** OAuth 2.0 token for the current user. */
711
+ oauth_token?: string;
712
+ /** Returns response with indentations and line breaks. */
713
+ prettyPrint?: boolean;
714
+ /** 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. */
715
+ quotaUser?: string;
716
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
717
+ upload_protocol?: string;
718
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
719
+ uploadType?: string;
720
+ /** Request body */
721
+ resource: UpdateAccountLabelsRequest;
722
+ }): Request<Account>;
723
+ updateLabels(
724
+ request: {
725
+ /** V1 error format. */
726
+ '$.xgafv'?: string;
727
+ /** OAuth access token. */
728
+ access_token?: string;
729
+ /** Data format for response. */
730
+ alt?: string;
731
+ /** JSONP */
732
+ callback?: string;
733
+ /** Selector specifying which fields to include in a partial response. */
734
+ fields?: string;
735
+ /** 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. */
736
+ key?: string;
737
+ /** Required. The label resource name. Format: accounts/{account} */
738
+ name: string;
739
+ /** OAuth 2.0 token for the current user. */
740
+ oauth_token?: string;
741
+ /** Returns response with indentations and line breaks. */
742
+ prettyPrint?: boolean;
743
+ /** 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. */
744
+ quotaUser?: string;
745
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
746
+ upload_protocol?: string;
747
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
748
+ uploadType?: string;
749
+ },
750
+ body: UpdateAccountLabelsRequest
751
+ ): Request<Account>;
752
+ cssProductInputs: CssProductInputsResource;
753
+ cssProducts: CssProductsResource;
754
+ labels: LabelsResource;
755
+ }
756
+
757
+ const accounts: AccountsResource;
758
+ }
759
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.css-v1",
3
+ "version": "0.0.20240614",
4
+ "description": "TypeScript typings for CSS API 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,86 @@
1
+ # TypeScript typings for CSS API v1
2
+
3
+ Programmatically manage your Comparison Shopping Service (CSS) account data at scale.
4
+ For detailed description please check [documentation](https://developers.google.com/comparison-shopping-services/api/overview).
5
+
6
+ ## Installing
7
+
8
+ Install typings for CSS API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.css-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://css.googleapis.com/$discovery/rest?version=v1',
30
+ () => {
31
+ // now we can use:
32
+ // gapi.client.css
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('css', 'v1', () => {
40
+ // now we can use:
41
+ // gapi.client.css
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 CSS API resources: <!-- TODO: make this work for multiple namespaces -->
70
+
71
+ ```typescript
72
+ /*
73
+ Retrieves a single CSS/MC account by ID.
74
+ */
75
+ await gapi.client.css.accounts.get({name: 'name'});
76
+
77
+ /*
78
+ Lists all the accounts under the specified CSS account ID, and optionally filters by label ID and account name.
79
+ */
80
+ await gapi.client.css.accounts.listChildAccounts({parent: 'parent'});
81
+
82
+ /*
83
+ Updates labels assigned to CSS/MC accounts by a CSS domain.
84
+ */
85
+ await gapi.client.css.accounts.updateLabels({name: 'name'});
86
+ ```