@maxim_mazurok/gapi.client.merchantapi-quota_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.
Files changed (3) hide show
  1. package/index.d.ts +128 -0
  2. package/package.json +20 -0
  3. package/readme.md +73 -0
package/index.d.ts ADDED
@@ -0,0 +1,128 @@
1
+ /* Type definitions for non-npm package Merchant API quota_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=quota_v1
12
+ // Revision: 20250804
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Merchant API quota_v1 */
18
+ function load(
19
+ urlOrObject: 'https://merchantapi.googleapis.com/$discovery/rest?version=quota_v1',
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'merchantapi', version: 'quota_v1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'merchantapi',
26
+ version: 'quota_v1',
27
+ callback: () => any,
28
+ ): void;
29
+
30
+ namespace merchantapi {
31
+ interface ListQuotaGroupsResponse {
32
+ /** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
33
+ nextPageToken?: string;
34
+ /** The methods, current quota usage and limits per each group. The quota is shared between all methods in the group. The groups are sorted in descending order based on quota_usage. */
35
+ quotaGroups?: QuotaGroup[];
36
+ }
37
+ interface MethodDetails {
38
+ /** Output only. The name of the method for example `products.list`. */
39
+ method?: string;
40
+ /** Output only. The path for the method such as `products/v1/productInputs.insert` */
41
+ path?: string;
42
+ /** Output only. The sub-API that the method belongs to. */
43
+ subapi?: string;
44
+ /** Output only. The API version that the method belongs to. */
45
+ version?: string;
46
+ }
47
+ interface ProductChange {
48
+ /** 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`, ``) */
49
+ newValue?: string;
50
+ /** 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`, ``) */
51
+ oldValue?: string;
52
+ /** Countries that have the change (if applicable). Represented in the ISO 3166 format. */
53
+ regionCode?: string;
54
+ /** 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) */
55
+ reportingContext?: string;
56
+ }
57
+ interface ProductStatusChangeMessage {
58
+ /** The target account that owns the entity that changed. Format : `accounts/{merchant_id}` */
59
+ account?: string;
60
+ /** The attribute in the resource that changed, in this case it will be always `Status`. */
61
+ attribute?: string;
62
+ /** A message to describe the change that happened to the product */
63
+ changes?: ProductChange[];
64
+ /** 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. */
65
+ eventTime?: string;
66
+ /** Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event. */
67
+ expirationTime?: string;
68
+ /** 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}` */
69
+ managingAccount?: string;
70
+ /** The product name. Format: `accounts/{account}/products/{product}` */
71
+ resource?: string;
72
+ /** The product id. */
73
+ resourceId?: string;
74
+ /** The resource that changed, in this case it will always be `Product`. */
75
+ resourceType?: string;
76
+ }
77
+ interface QuotaGroup {
78
+ /** Output only. List of all methods group quota applies to. */
79
+ methodDetails?: MethodDetails[];
80
+ /** Identifier. The resource name of the quota group. Format: accounts/{account}/quotas/{group} Note: There is no guarantee on the format of {group} */
81
+ name?: string;
82
+ /** Output only. The maximum number of calls allowed per day for the group. */
83
+ quotaLimit?: string;
84
+ /** Output only. The maximum number of calls allowed per minute for the group. */
85
+ quotaMinuteLimit?: string;
86
+ /** Output only. The current quota usage, meaning the number of calls already made on a given day to the methods in the group. The daily quota limits reset at at 12:00 PM midday UTC. */
87
+ quotaUsage?: string;
88
+ }
89
+ interface QuotasResource {
90
+ /** Lists the daily call quota and usage per group for your Merchant Center account. */
91
+ list(request?: {
92
+ /** V1 error format. */
93
+ '$.xgafv'?: string;
94
+ /** OAuth access token. */
95
+ access_token?: string;
96
+ /** Data format for response. */
97
+ alt?: string;
98
+ /** JSONP */
99
+ callback?: string;
100
+ /** Selector specifying which fields to include in a partial response. */
101
+ fields?: string;
102
+ /** 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. */
103
+ key?: string;
104
+ /** OAuth 2.0 token for the current user. */
105
+ oauth_token?: string;
106
+ /** Optional. The maximum number of quotas to return in the response, used for paging. Defaults to 500; values above 1000 will be coerced to 1000. */
107
+ pageSize?: number;
108
+ /** Optional. Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token. */
109
+ pageToken?: string;
110
+ /** Required. The merchant account who owns the collection of method quotas Format: accounts/{account} */
111
+ parent: string;
112
+ /** Returns response with indentations and line breaks. */
113
+ prettyPrint?: boolean;
114
+ /** 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. */
115
+ quotaUser?: string;
116
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
117
+ upload_protocol?: string;
118
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
119
+ uploadType?: string;
120
+ }): Request<ListQuotaGroupsResponse>;
121
+ }
122
+ interface AccountsResource {
123
+ quotas: QuotasResource;
124
+ }
125
+
126
+ const accounts: AccountsResource;
127
+ }
128
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.merchantapi-quota_v1",
3
+ "version": "0.0.20250804",
4
+ "description": "TypeScript typings for Merchant API quota_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 quota_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-quota_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=quota_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', 'quota_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
+ ```