@maxim_mazurok/gapi.client.merchantapi-notifications_v1beta 0.0.20240611

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 +292 -0
  2. package/package.json +20 -0
  3. package/readme.md +73 -0
package/index.d.ts ADDED
@@ -0,0 +1,292 @@
1
+ /* Type definitions for non-npm package Merchant API notifications_v1beta 0.0 */
2
+ // Project: https://developers.devsite.corp.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=notifications_v1beta
12
+ // Revision: 20240611
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Merchant API notifications_v1beta */
18
+ function load(
19
+ urlOrObject: 'https://merchantapi.googleapis.com/$discovery/rest?version=notifications_v1beta'
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(
23
+ name: 'merchantapi',
24
+ version: 'notifications_v1beta'
25
+ ): Promise<void>;
26
+ /** @deprecated Please load APIs with discovery documents. */
27
+ function load(
28
+ name: 'merchantapi',
29
+ version: 'notifications_v1beta',
30
+ callback: () => any
31
+ ): void;
32
+
33
+ namespace merchantapi {
34
+ interface Empty {}
35
+ interface ListNotificationSubscriptionsResponse {
36
+ /** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
37
+ nextPageToken?: string;
38
+ /** The list of notification subscriptions requested by the merchant. */
39
+ notificationSubscriptions?: NotificationSubscription[];
40
+ }
41
+ interface NotificationSubscription {
42
+ /** If this value is true, the requesting account is notified of the specified event for all managed accounts (can be subaccounts or other linked accounts) including newly added accounts on a daily basis. */
43
+ allManagedAccounts?: boolean;
44
+ /** URL to be used to push the notification to the merchant. */
45
+ callBackUri?: string;
46
+ /** Output only. The `name` of the notification configuration. Generated by the Content API upon creation of a new `NotificationSubscription`. The `account` represents the merchant ID of the merchant that owns the configuration. Format: `accounts/{account}/notificationsubscriptions/{notification_subscription}` */
47
+ name?: string;
48
+ /** The event that the merchant wants to be notified about. */
49
+ registeredEvent?: string;
50
+ /** The `name` of the account you want to receive notifications for. Format: `accounts/{account}` */
51
+ targetAccount?: string;
52
+ }
53
+ interface ProductChange {
54
+ /** The new value of the changed resource or attribute. */
55
+ newValue?: string;
56
+ /** The old value of the changed resource or attribute. */
57
+ oldValue?: string;
58
+ /** Countries that have the change (if applicable) */
59
+ regionCode?: string;
60
+ /** Reporting contexts that have the change (if applicable) */
61
+ reportingContext?: string;
62
+ }
63
+ interface ProductStatusChangeMessage {
64
+ /** The target account that owns the entity that changed. Format : `accounts/{merchant_id}` */
65
+ account?: string;
66
+ /** The attribute in the resource that changed, in this case it will be always `Status`. */
67
+ attribute?: string;
68
+ /** A message to describe the change that happened to the product */
69
+ changes?: ProductChange[];
70
+ /** 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}` */
71
+ managingAccount?: string;
72
+ /** The product name. Format: `{product.name=accounts/{account}/products/{product}}` */
73
+ resource?: string;
74
+ /** The product id. */
75
+ resourceId?: string;
76
+ /** The resource that changed, in this case it will always be `Product`. */
77
+ resourceType?: string;
78
+ }
79
+ interface NotificationsubscriptionsResource {
80
+ /** Creates a notification subscription for a merchant. We will allow the following types of notification subscriptions to exist together (per merchant as a subscriber per event type): 1. Subscription for all managed accounts + subscription for self 2. Multiple "partial" subscriptions for managed accounts + subscription for self we will not allow (per merchant as a subscriber per event type): 1. multiple self subscriptions. 2. multiple "all managed accounts" subscriptions. 3. all and partial subscriptions at the same time. 4. multiple partial subscriptions for the same target account */
81
+ create(request: {
82
+ /** V1 error format. */
83
+ '$.xgafv'?: string;
84
+ /** OAuth access token. */
85
+ access_token?: string;
86
+ /** Data format for response. */
87
+ alt?: string;
88
+ /** JSONP */
89
+ callback?: string;
90
+ /** Selector specifying which fields to include in a partial response. */
91
+ fields?: string;
92
+ /** 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. */
93
+ key?: string;
94
+ /** OAuth 2.0 token for the current user. */
95
+ oauth_token?: string;
96
+ /** Required. The merchant account that owns the new notification subscription. Format: `accounts/{account}` */
97
+ parent: string;
98
+ /** Returns response with indentations and line breaks. */
99
+ prettyPrint?: boolean;
100
+ /** 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. */
101
+ quotaUser?: string;
102
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
103
+ upload_protocol?: string;
104
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
105
+ uploadType?: string;
106
+ /** Request body */
107
+ resource: NotificationSubscription;
108
+ }): Request<NotificationSubscription>;
109
+ create(
110
+ request: {
111
+ /** V1 error format. */
112
+ '$.xgafv'?: string;
113
+ /** OAuth access token. */
114
+ access_token?: string;
115
+ /** Data format for response. */
116
+ alt?: string;
117
+ /** JSONP */
118
+ callback?: string;
119
+ /** Selector specifying which fields to include in a partial response. */
120
+ fields?: string;
121
+ /** 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. */
122
+ key?: string;
123
+ /** OAuth 2.0 token for the current user. */
124
+ oauth_token?: string;
125
+ /** Required. The merchant account that owns the new notification subscription. Format: `accounts/{account}` */
126
+ parent: string;
127
+ /** Returns response with indentations and line breaks. */
128
+ prettyPrint?: boolean;
129
+ /** 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. */
130
+ quotaUser?: string;
131
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
132
+ upload_protocol?: string;
133
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
134
+ uploadType?: string;
135
+ },
136
+ body: NotificationSubscription
137
+ ): Request<NotificationSubscription>;
138
+ /** Deletes a notification subscription for a merchant. */
139
+ delete(request?: {
140
+ /** V1 error format. */
141
+ '$.xgafv'?: string;
142
+ /** OAuth access token. */
143
+ access_token?: string;
144
+ /** Data format for response. */
145
+ alt?: string;
146
+ /** JSONP */
147
+ callback?: string;
148
+ /** Selector specifying which fields to include in a partial response. */
149
+ fields?: string;
150
+ /** 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. */
151
+ key?: string;
152
+ /** Required. The name of the notification subscription to be deleted. */
153
+ name: string;
154
+ /** OAuth 2.0 token for the current user. */
155
+ oauth_token?: string;
156
+ /** Returns response with indentations and line breaks. */
157
+ prettyPrint?: boolean;
158
+ /** 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. */
159
+ quotaUser?: string;
160
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
161
+ upload_protocol?: string;
162
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
163
+ uploadType?: string;
164
+ }): Request<{}>;
165
+ /** Gets notification subscriptions for an account. */
166
+ get(request?: {
167
+ /** V1 error format. */
168
+ '$.xgafv'?: string;
169
+ /** OAuth access token. */
170
+ access_token?: string;
171
+ /** Data format for response. */
172
+ alt?: string;
173
+ /** JSONP */
174
+ callback?: string;
175
+ /** Selector specifying which fields to include in a partial response. */
176
+ fields?: string;
177
+ /** 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. */
178
+ key?: string;
179
+ /** Required. The `name` of the notification subscription. */
180
+ name: string;
181
+ /** OAuth 2.0 token for the current user. */
182
+ oauth_token?: string;
183
+ /** Returns response with indentations and line breaks. */
184
+ prettyPrint?: boolean;
185
+ /** 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. */
186
+ quotaUser?: string;
187
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
188
+ upload_protocol?: string;
189
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
190
+ uploadType?: string;
191
+ }): Request<NotificationSubscription>;
192
+ /** Gets all the notification subscriptions for a merchant. */
193
+ list(request?: {
194
+ /** V1 error format. */
195
+ '$.xgafv'?: string;
196
+ /** OAuth access token. */
197
+ access_token?: string;
198
+ /** Data format for response. */
199
+ alt?: string;
200
+ /** JSONP */
201
+ callback?: string;
202
+ /** Selector specifying which fields to include in a partial response. */
203
+ fields?: string;
204
+ /** 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. */
205
+ key?: string;
206
+ /** OAuth 2.0 token for the current user. */
207
+ oauth_token?: string;
208
+ /** The maximum number of notification subscriptions to return in a page. The default value for `page_size` is 100. The maximum value is `200`. Values above `200` will be coerced to `200`. */
209
+ pageSize?: number;
210
+ /** Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token. */
211
+ pageToken?: string;
212
+ /** Required. The merchant account who owns the notification subscriptions. Format: `accounts/{account}` */
213
+ parent: string;
214
+ /** Returns response with indentations and line breaks. */
215
+ prettyPrint?: boolean;
216
+ /** 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. */
217
+ quotaUser?: string;
218
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
219
+ upload_protocol?: string;
220
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
221
+ uploadType?: string;
222
+ }): Request<ListNotificationSubscriptionsResponse>;
223
+ /** Updates an existing notification subscription for a merchant. */
224
+ patch(request: {
225
+ /** V1 error format. */
226
+ '$.xgafv'?: string;
227
+ /** OAuth access token. */
228
+ access_token?: string;
229
+ /** Data format for response. */
230
+ alt?: string;
231
+ /** JSONP */
232
+ callback?: string;
233
+ /** Selector specifying which fields to include in a partial response. */
234
+ fields?: string;
235
+ /** 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. */
236
+ key?: string;
237
+ /** Output only. The `name` of the notification configuration. Generated by the Content API upon creation of a new `NotificationSubscription`. The `account` represents the merchant ID of the merchant that owns the configuration. Format: `accounts/{account}/notificationsubscriptions/{notification_subscription}` */
238
+ name: string;
239
+ /** OAuth 2.0 token for the current user. */
240
+ oauth_token?: string;
241
+ /** Returns response with indentations and line breaks. */
242
+ prettyPrint?: boolean;
243
+ /** 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. */
244
+ quotaUser?: string;
245
+ /** List of fields being updated. */
246
+ updateMask?: string;
247
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
248
+ upload_protocol?: string;
249
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
250
+ uploadType?: string;
251
+ /** Request body */
252
+ resource: NotificationSubscription;
253
+ }): Request<NotificationSubscription>;
254
+ patch(
255
+ request: {
256
+ /** V1 error format. */
257
+ '$.xgafv'?: string;
258
+ /** OAuth access token. */
259
+ access_token?: string;
260
+ /** Data format for response. */
261
+ alt?: string;
262
+ /** JSONP */
263
+ callback?: string;
264
+ /** Selector specifying which fields to include in a partial response. */
265
+ fields?: string;
266
+ /** 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. */
267
+ key?: string;
268
+ /** Output only. The `name` of the notification configuration. Generated by the Content API upon creation of a new `NotificationSubscription`. The `account` represents the merchant ID of the merchant that owns the configuration. Format: `accounts/{account}/notificationsubscriptions/{notification_subscription}` */
269
+ name: string;
270
+ /** OAuth 2.0 token for the current user. */
271
+ oauth_token?: string;
272
+ /** Returns response with indentations and line breaks. */
273
+ prettyPrint?: boolean;
274
+ /** 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. */
275
+ quotaUser?: string;
276
+ /** List of fields being updated. */
277
+ updateMask?: string;
278
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
279
+ upload_protocol?: string;
280
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
281
+ uploadType?: string;
282
+ },
283
+ body: NotificationSubscription
284
+ ): Request<NotificationSubscription>;
285
+ }
286
+ interface AccountsResource {
287
+ notificationsubscriptions: NotificationsubscriptionsResource;
288
+ }
289
+
290
+ const accounts: AccountsResource;
291
+ }
292
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.merchantapi-notifications_v1beta",
3
+ "version": "0.0.20240611",
4
+ "description": "TypeScript typings for Merchant API notifications_v1beta",
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 notifications_v1beta
2
+
3
+ Programmatically manage your Merchant Center Accounts.
4
+ For detailed description please check [documentation](https://developers.devsite.corp.google.com/merchant/api).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Merchant API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.merchantapi-notifications_v1beta --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=notifications_v1beta',
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', 'notifications_v1beta', () => {
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
+ ```