@maxim_mazurok/gapi.client.cloudcommerceprocurement-v1 0.0.20240609

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 +822 -0
  2. package/package.json +20 -0
  3. package/readme.md +73 -0
package/index.d.ts ADDED
@@ -0,0 +1,822 @@
1
+ /* Type definitions for non-npm package Cloud Commerce Partner Procurement API v1 0.0 */
2
+ // Project: https://cloud.google.com/marketplace/docs/partners/
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://cloudcommerceprocurement.googleapis.com/$discovery/rest?version=v1
12
+ // Revision: 20240609
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Cloud Commerce Partner Procurement API v1 */
18
+ function load(
19
+ urlOrObject: 'https://cloudcommerceprocurement.googleapis.com/$discovery/rest?version=v1'
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'cloudcommerceprocurement', version: 'v1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'cloudcommerceprocurement',
26
+ version: 'v1',
27
+ callback: () => any
28
+ ): void;
29
+
30
+ namespace cloudcommerceprocurement {
31
+ interface Account {
32
+ /** Output only. The approvals for this account. These approvals are used to track actions that are permitted or have been completed by a customer within the context of the provider. This might include a sign up flow or a provisioning step, for example, that the provider can admit to having happened. */
33
+ approvals?: Approval[];
34
+ /** Output only. The creation timestamp. */
35
+ createTime?: string;
36
+ /** Output only. The custom properties that were collected from the user to create this account. */
37
+ inputProperties?: {[P in string]: any};
38
+ /** Output only. The resource name of the account. Account names have the form `accounts/{account_id}`. */
39
+ name?: string;
40
+ /** Output only. The identifier of the service provider that this account was created against. Each service provider is assigned a unique provider value when they onboard with Cloud Commerce platform. */
41
+ provider?: string;
42
+ /** Output only. The state of the account. This is used to decide whether the customer is in good standing with the provider and is able to make purchases. An account might not be able to make a purchase if the billing account is suspended, for example. */
43
+ state?: string;
44
+ /** Output only. The last update timestamp. */
45
+ updateTime?: string;
46
+ }
47
+ interface Approval {
48
+ /** Output only. The name of the approval. */
49
+ name?: string;
50
+ /** Output only. An explanation for the state of the approval. */
51
+ reason?: string;
52
+ /** Output only. The state of the approval. */
53
+ state?: string;
54
+ /** Optional. The last update timestamp of the approval. */
55
+ updateTime?: string;
56
+ }
57
+ interface ApproveAccountRequest {
58
+ /** The name of the approval being approved. If absent and there is only one approval possible, that approval will be granted. If absent and there are many approvals possible, the request will fail with a 400 Bad Request. Optional. */
59
+ approvalName?: string;
60
+ /** Set of properties that should be associated with the account. Optional. */
61
+ properties?: {[P in string]: string};
62
+ /** Free form text string explaining the approval reason. Optional. Max allowed length: 256 bytes. Longer strings will be truncated. */
63
+ reason?: string;
64
+ }
65
+ interface ApproveEntitlementPlanChangeRequest {
66
+ /** Required. Name of the pending plan that's being approved. */
67
+ pendingPlanName?: string;
68
+ }
69
+ interface ApproveEntitlementRequest {
70
+ /** Optional. The resource name of the entitlement that was migrated, with the format `providers/{provider_id}/entitlements/{entitlement_id}`. Should only be sent when resources have been migrated from entitlement_migrated to the new entitlement. Optional. */
71
+ entitlementMigrated?: string;
72
+ /** Set of properties that should be associated with the entitlement. Optional. */
73
+ properties?: {[P in string]: string};
74
+ }
75
+ interface Consumer {
76
+ /** A project name with format `projects/`. */
77
+ project?: string;
78
+ }
79
+ interface Empty {}
80
+ interface Entitlement {
81
+ /** Output only. The resource name of the account that this entitlement is based on, if any. */
82
+ account?: string;
83
+ /** Output only. The reason the entitlement was cancelled. If this entitlement wasn't cancelled, this field is empty. Possible values include "unknown", "expired", "user-cancelled", "account-closed", "billing-disabled" (if the customer has manually disabled billing to their resources), "user-aborted", and "migrated" (if the entitlement has migrated across products). Values of this field are subject to change, and we recommend that you don't build your technical integration to rely on these fields. */
84
+ cancellationReason?: string;
85
+ /** Output only. The resources using this entitlement, if applicable. */
86
+ consumers?: Consumer[];
87
+ /** Output only. The creation timestamp. */
88
+ createTime?: string;
89
+ /** Output only. The entitlement benefit IDs associated with the purchase. */
90
+ entitlementBenefitIds?: string[];
91
+ /** Output only. The custom properties that were collected from the user to create this entitlement. */
92
+ inputProperties?: {[P in string]: any};
93
+ /** Provider-supplied message that is displayed to the end user. Currently this is used to communicate progress and ETA for provisioning. This field can be updated only when a user is waiting for an action from the provider, i.e. entitlement state is EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED or EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL. This field is cleared automatically when the entitlement state changes. */
94
+ messageToUser?: string;
95
+ /** Output only. The resource name of the entitlement. Entitlement names have the form `providers/{provider_id}/entitlements/{entitlement_id}`. */
96
+ name?: string;
97
+ /** Output only. The end time of the new offer. If the offer was created with a term instead of a specified end date, this field is empty. This field is populated even if the entitlement isn't active yet. If there's no upcoming offer, the field is be empty. */
98
+ newOfferEndTime?: string;
99
+ /** Output only. The timestamp when the new offer becomes effective. This field is populated even if the entitlement isn't active yet. If there's no upcoming offer, the field is empty. */
100
+ newOfferStartTime?: string;
101
+ /** Output only. The name of the offer the entitlement is switching to upon a pending plan change. Only exists if the pending plan change is moving to an offer. This field isn't populated for entitlements which aren't active yet. Format: 'projects/{project}/services/{service}/privateOffers/{offer-id}' OR 'projects/{project}/services/{service}/standardOffers/{offer-id}', depending on whether the offer is private or public. The {service} in the name is the listing service of the offer. It could be either the product service that the offer is referencing, or a generic private offer parent service. We recommend that you don't build your integration to rely on the meaning of this {service} part. */
102
+ newPendingOffer?: string;
103
+ /** Output only. The duration of the new offer, in ISO 8601 duration format. This field isn't populated for entitlements which aren't active yet, only for pending offer changes. If the offer was created with a specified end date instead of a duration, this field is empty. */
104
+ newPendingOfferDuration?: string;
105
+ /** Output only. The identifier of the pending new plan. Required if the product has plans and the entitlement has a pending plan change. */
106
+ newPendingPlan?: string;
107
+ /** Output only. The name of the offer that was procured. Field is empty if order was not made using an offer. Format: 'projects/{project}/services/{service}/privateOffers/{offer-id}' OR 'projects/{project}/services/{service}/standardOffers/{offer-id}', depending on whether the offer is private or public. The {service} in the name is the listing service of the offer. It could be either the product service that the offer is referencing, or a generic private offer parent service. We recommend that you don't build your integration to rely on the meaning of this {service} part. */
108
+ offer?: string;
109
+ /** Output only. The offer duration of the current offer in ISO 8601 duration format. Field is empty if entitlement was not made using an offer. If the offer was created with a specified end date instead of a duration, this field is empty. */
110
+ offerDuration?: string;
111
+ /** Output only. End time for the Offer association corresponding to this entitlement. The field is only populated if the entitlement is currently associated with an Offer. */
112
+ offerEndTime?: string;
113
+ /** Output only. The order ID of this entitlement, without any `orders/` resource name prefix. */
114
+ orderId?: string;
115
+ /** Output only. The identifier of the plan that was procured. Required if the product has plans. */
116
+ plan?: string;
117
+ /** Output only. The identifier of the entity that was purchased. This may actually represent a product, quote, or offer. We strongly recommend that you use the following more explicit fields: productExternalName, quoteExternalName, or offer. */
118
+ product?: string;
119
+ /** Output only. The identifier of the product that was procured. */
120
+ productExternalName?: string;
121
+ /** Output only. The identifier of the service provider that this entitlement was created against. Each service provider is assigned a unique provider value when they onboard with Cloud Commerce platform. */
122
+ provider?: string;
123
+ /** Output only. The identifier of the quote that was used to procure. Empty if the order is not purchased using a quote. */
124
+ quoteExternalName?: string;
125
+ /** Output only. The state of the entitlement. */
126
+ state?: string;
127
+ /** Output only. End time for the subscription corresponding to this entitlement. */
128
+ subscriptionEndTime?: string;
129
+ /** Output only. The last update timestamp. */
130
+ updateTime?: string;
131
+ /** Output only. The consumerId to use when reporting usage through the Service Control API. See the consumerId field at [Reporting Metrics](https://cloud.google.com/service-control/reporting-metrics) for more details. This field is present only if the product has usage-based billing configured. */
132
+ usageReportingId?: string;
133
+ }
134
+ interface ListAccountsResponse {
135
+ /** The list of accounts in this response. */
136
+ accounts?: Account[];
137
+ /** The token for fetching the next page. */
138
+ nextPageToken?: string;
139
+ }
140
+ interface ListEntitlementsResponse {
141
+ /** The list of entitlements in this response. */
142
+ entitlements?: Entitlement[];
143
+ /** The token for fetching the next page. */
144
+ nextPageToken?: string;
145
+ }
146
+ interface RejectAccountRequest {
147
+ /** The name of the approval being rejected. If absent and there is only one approval possible, that approval will be rejected. If absent and there are many approvals possible, the request will fail with a 400 Bad Request. Optional. */
148
+ approvalName?: string;
149
+ /** Free form text string explaining the rejection reason. Max allowed length: 256 bytes. Longer strings will be truncated. */
150
+ reason?: string;
151
+ }
152
+ interface RejectEntitlementPlanChangeRequest {
153
+ /** Required. Name of the pending plan that is being rejected. */
154
+ pendingPlanName?: string;
155
+ /** Free form text string explaining the rejection reason. Max allowed length: 256 bytes. Longer strings will be truncated. */
156
+ reason?: string;
157
+ }
158
+ interface RejectEntitlementRequest {
159
+ /** Free form text string explaining the rejection reason. Max allowed length: 256 bytes. Longer strings will be truncated. */
160
+ reason?: string;
161
+ }
162
+ interface ResetAccountRequest {}
163
+ interface SuspendEntitlementRequest {
164
+ /** A free-form reason string, explaining the reason for suspension request. */
165
+ reason?: string;
166
+ }
167
+ interface AccountsResource {
168
+ /** Grants an approval on an Account. */
169
+ approve(request: {
170
+ /** V1 error format. */
171
+ '$.xgafv'?: string;
172
+ /** OAuth access token. */
173
+ access_token?: string;
174
+ /** Data format for response. */
175
+ alt?: string;
176
+ /** JSONP */
177
+ callback?: string;
178
+ /** Selector specifying which fields to include in a partial response. */
179
+ fields?: string;
180
+ /** 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. */
181
+ key?: string;
182
+ /** Required. The resource name of the account, with the format `providers/{providerId}/accounts/{accountId}`. */
183
+ name: string;
184
+ /** OAuth 2.0 token for the current user. */
185
+ oauth_token?: string;
186
+ /** Returns response with indentations and line breaks. */
187
+ prettyPrint?: boolean;
188
+ /** 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. */
189
+ quotaUser?: string;
190
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
191
+ upload_protocol?: string;
192
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
193
+ uploadType?: string;
194
+ /** Request body */
195
+ resource: ApproveAccountRequest;
196
+ }): Request<{}>;
197
+ approve(
198
+ request: {
199
+ /** V1 error format. */
200
+ '$.xgafv'?: string;
201
+ /** OAuth access token. */
202
+ access_token?: string;
203
+ /** Data format for response. */
204
+ alt?: string;
205
+ /** JSONP */
206
+ callback?: string;
207
+ /** Selector specifying which fields to include in a partial response. */
208
+ fields?: string;
209
+ /** 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. */
210
+ key?: string;
211
+ /** Required. The resource name of the account, with the format `providers/{providerId}/accounts/{accountId}`. */
212
+ name: string;
213
+ /** OAuth 2.0 token for the current user. */
214
+ oauth_token?: string;
215
+ /** Returns response with indentations and line breaks. */
216
+ prettyPrint?: boolean;
217
+ /** 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. */
218
+ quotaUser?: string;
219
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
220
+ upload_protocol?: string;
221
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
222
+ uploadType?: string;
223
+ },
224
+ body: ApproveAccountRequest
225
+ ): Request<{}>;
226
+ /** Gets a requested Account resource. */
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 account to retrieve. */
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<Account>;
253
+ /** Lists Accounts that the provider has access to. */
254
+ list(request?: {
255
+ /** V1 error format. */
256
+ '$.xgafv'?: string;
257
+ /** OAuth access token. */
258
+ access_token?: string;
259
+ /** Data format for response. */
260
+ alt?: string;
261
+ /** JSONP */
262
+ callback?: string;
263
+ /** Selector specifying which fields to include in a partial response. */
264
+ fields?: string;
265
+ /** 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. */
266
+ key?: string;
267
+ /** OAuth 2.0 token for the current user. */
268
+ oauth_token?: string;
269
+ /** The maximum number of entries that are requested. The default page size is 25 and the maximum page size is 200. */
270
+ pageSize?: number;
271
+ /** The token for fetching the next page. */
272
+ pageToken?: string;
273
+ /** Required. The parent resource name. */
274
+ parent: string;
275
+ /** Returns response with indentations and line breaks. */
276
+ prettyPrint?: boolean;
277
+ /** 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. */
278
+ quotaUser?: string;
279
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
280
+ upload_protocol?: string;
281
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
282
+ uploadType?: string;
283
+ }): Request<ListAccountsResponse>;
284
+ /** Rejects an approval on an Account. */
285
+ reject(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
+ /** Required. The resource name of the account. */
299
+ name: string;
300
+ /** OAuth 2.0 token for the current user. */
301
+ oauth_token?: 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
+ /** Request body */
311
+ resource: RejectAccountRequest;
312
+ }): Request<{}>;
313
+ reject(
314
+ 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 resource name of the account. */
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
+ },
340
+ body: RejectAccountRequest
341
+ ): Request<{}>;
342
+ /** Resets an Account and cancels all associated Entitlements. Partner can only reset accounts they own rather than customer accounts. */
343
+ reset(request: {
344
+ /** V1 error format. */
345
+ '$.xgafv'?: string;
346
+ /** OAuth access token. */
347
+ access_token?: string;
348
+ /** Data format for response. */
349
+ alt?: string;
350
+ /** JSONP */
351
+ callback?: string;
352
+ /** Selector specifying which fields to include in a partial response. */
353
+ fields?: string;
354
+ /** 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. */
355
+ key?: string;
356
+ /** Required. The resource name of the account. */
357
+ name: string;
358
+ /** OAuth 2.0 token for the current user. */
359
+ oauth_token?: string;
360
+ /** Returns response with indentations and line breaks. */
361
+ prettyPrint?: boolean;
362
+ /** 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. */
363
+ quotaUser?: string;
364
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
365
+ upload_protocol?: string;
366
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
367
+ uploadType?: string;
368
+ /** Request body */
369
+ resource: ResetAccountRequest;
370
+ }): Request<{}>;
371
+ reset(
372
+ request: {
373
+ /** V1 error format. */
374
+ '$.xgafv'?: string;
375
+ /** OAuth access token. */
376
+ access_token?: string;
377
+ /** Data format for response. */
378
+ alt?: string;
379
+ /** JSONP */
380
+ callback?: string;
381
+ /** Selector specifying which fields to include in a partial response. */
382
+ fields?: string;
383
+ /** 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. */
384
+ key?: string;
385
+ /** Required. The resource name of the account. */
386
+ name: string;
387
+ /** OAuth 2.0 token for the current user. */
388
+ oauth_token?: string;
389
+ /** Returns response with indentations and line breaks. */
390
+ prettyPrint?: boolean;
391
+ /** 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. */
392
+ quotaUser?: string;
393
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
394
+ upload_protocol?: string;
395
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
396
+ uploadType?: string;
397
+ },
398
+ body: ResetAccountRequest
399
+ ): Request<{}>;
400
+ }
401
+ interface EntitlementsResource {
402
+ /** Approves an entitlement that is in the EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED state. This method is invoked by the provider to approve the creation of the entitlement resource. */
403
+ approve(request: {
404
+ /** V1 error format. */
405
+ '$.xgafv'?: string;
406
+ /** OAuth access token. */
407
+ access_token?: string;
408
+ /** Data format for response. */
409
+ alt?: string;
410
+ /** JSONP */
411
+ callback?: string;
412
+ /** Selector specifying which fields to include in a partial response. */
413
+ fields?: string;
414
+ /** 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. */
415
+ key?: string;
416
+ /** Required. The resource name of the entitlement, with the format `providers/{providerId}/entitlements/{entitlementId}`. */
417
+ name: string;
418
+ /** OAuth 2.0 token for the current user. */
419
+ oauth_token?: string;
420
+ /** Returns response with indentations and line breaks. */
421
+ prettyPrint?: boolean;
422
+ /** 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. */
423
+ quotaUser?: string;
424
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
425
+ upload_protocol?: string;
426
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
427
+ uploadType?: string;
428
+ /** Request body */
429
+ resource: ApproveEntitlementRequest;
430
+ }): Request<{}>;
431
+ approve(
432
+ request: {
433
+ /** V1 error format. */
434
+ '$.xgafv'?: string;
435
+ /** OAuth access token. */
436
+ access_token?: string;
437
+ /** Data format for response. */
438
+ alt?: string;
439
+ /** JSONP */
440
+ callback?: string;
441
+ /** Selector specifying which fields to include in a partial response. */
442
+ fields?: string;
443
+ /** 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. */
444
+ key?: string;
445
+ /** Required. The resource name of the entitlement, with the format `providers/{providerId}/entitlements/{entitlementId}`. */
446
+ name: string;
447
+ /** OAuth 2.0 token for the current user. */
448
+ oauth_token?: string;
449
+ /** Returns response with indentations and line breaks. */
450
+ prettyPrint?: boolean;
451
+ /** 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. */
452
+ quotaUser?: string;
453
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
454
+ upload_protocol?: string;
455
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
456
+ uploadType?: string;
457
+ },
458
+ body: ApproveEntitlementRequest
459
+ ): Request<{}>;
460
+ /** Approves an entitlement plan change that is in the EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This method is invoked by the provider to approve the plan change on the entitlement resource. */
461
+ approvePlanChange(request: {
462
+ /** V1 error format. */
463
+ '$.xgafv'?: string;
464
+ /** OAuth access token. */
465
+ access_token?: string;
466
+ /** Data format for response. */
467
+ alt?: string;
468
+ /** JSONP */
469
+ callback?: string;
470
+ /** Selector specifying which fields to include in a partial response. */
471
+ fields?: string;
472
+ /** 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. */
473
+ key?: string;
474
+ /** Required. The resource name of the entitlement. */
475
+ name: string;
476
+ /** OAuth 2.0 token for the current user. */
477
+ oauth_token?: string;
478
+ /** Returns response with indentations and line breaks. */
479
+ prettyPrint?: boolean;
480
+ /** 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. */
481
+ quotaUser?: string;
482
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
483
+ upload_protocol?: string;
484
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
485
+ uploadType?: string;
486
+ /** Request body */
487
+ resource: ApproveEntitlementPlanChangeRequest;
488
+ }): Request<{}>;
489
+ approvePlanChange(
490
+ request: {
491
+ /** V1 error format. */
492
+ '$.xgafv'?: string;
493
+ /** OAuth access token. */
494
+ access_token?: string;
495
+ /** Data format for response. */
496
+ alt?: string;
497
+ /** JSONP */
498
+ callback?: string;
499
+ /** Selector specifying which fields to include in a partial response. */
500
+ fields?: string;
501
+ /** 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. */
502
+ key?: string;
503
+ /** Required. The resource name of the entitlement. */
504
+ name: string;
505
+ /** OAuth 2.0 token for the current user. */
506
+ oauth_token?: string;
507
+ /** Returns response with indentations and line breaks. */
508
+ prettyPrint?: boolean;
509
+ /** 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. */
510
+ quotaUser?: 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: ApproveEntitlementPlanChangeRequest
517
+ ): Request<{}>;
518
+ /** Gets a requested Entitlement resource. */
519
+ get(request?: {
520
+ /** V1 error format. */
521
+ '$.xgafv'?: string;
522
+ /** OAuth access token. */
523
+ access_token?: string;
524
+ /** Data format for response. */
525
+ alt?: string;
526
+ /** JSONP */
527
+ callback?: string;
528
+ /** Selector specifying which fields to include in a partial response. */
529
+ fields?: string;
530
+ /** 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. */
531
+ key?: string;
532
+ /** Required. The name of the entitlement to retrieve. */
533
+ name: string;
534
+ /** OAuth 2.0 token for the current user. */
535
+ oauth_token?: string;
536
+ /** Returns response with indentations and line breaks. */
537
+ prettyPrint?: boolean;
538
+ /** 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. */
539
+ quotaUser?: string;
540
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
541
+ upload_protocol?: string;
542
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
543
+ uploadType?: string;
544
+ }): Request<Entitlement>;
545
+ /** Lists Entitlements for which the provider has read access. */
546
+ list(request?: {
547
+ /** V1 error format. */
548
+ '$.xgafv'?: string;
549
+ /** OAuth access token. */
550
+ access_token?: string;
551
+ /** Data format for response. */
552
+ alt?: string;
553
+ /** JSONP */
554
+ callback?: string;
555
+ /** Selector specifying which fields to include in a partial response. */
556
+ fields?: string;
557
+ /** The filter that can be used to limit the list request. The filter is a query string that can match a selected set of attributes with string values. For example `account=E-1234-5678-ABCD-EFGH`, `state=pending_cancellation`, and `plan!=foo-plan`. Supported query attributes are * `account` * `customer_billing_account` with value in the format of: `billingAccounts/{id}` * `product_external_name` * `quote_external_name` * `offer` * `new_pending_offer` * `plan` * `newPendingPlan` or `new_pending_plan` * `state` * `consumers.project` * `change_history.new_offer` Note that the consumers and change_history.new_offer match works on repeated structures, so equality (`consumers.project=projects/123456789`) is not supported. Set membership can be expressed with the `:` operator. For example, `consumers.project:projects/123456789` finds entitlements with at least one consumer with project field equal to `projects/123456789`. `change_history.new_offer` retrieves all entitlements that were once associated or are currently active with the offer. Also note that the state name match is case-insensitive and query can omit the prefix "ENTITLEMENT_". For example, `state=active` is equivalent to `state=ENTITLEMENT_ACTIVE`. If the query contains some special characters other than letters, underscore, or digits, the phrase must be quoted with double quotes. For example, `product="providerId:productId"`, where the product name needs to be quoted because it contains special character colon. Queries can be combined with `AND`, `OR`, and `NOT` to form more complex queries. They can also be grouped to force a desired evaluation order. For example, `state=active AND (account=E-1234 OR account=5678) AND NOT (product=foo-product)`. Connective `AND` can be omitted between two predicates. For example `account=E-1234 state=active` is equivalent to `account=E-1234 AND state=active`. */
558
+ filter?: string;
559
+ /** 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. */
560
+ key?: string;
561
+ /** OAuth 2.0 token for the current user. */
562
+ oauth_token?: string;
563
+ /** The maximum number of entries that are requested. The default page size is 200. */
564
+ pageSize?: number;
565
+ /** The token for fetching the next page. */
566
+ pageToken?: string;
567
+ /** Required. The parent resource name. */
568
+ parent: string;
569
+ /** Returns response with indentations and line breaks. */
570
+ prettyPrint?: boolean;
571
+ /** 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. */
572
+ quotaUser?: string;
573
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
574
+ upload_protocol?: string;
575
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
576
+ uploadType?: string;
577
+ }): Request<ListEntitlementsResponse>;
578
+ /** Updates an existing Entitlement. */
579
+ patch(request: {
580
+ /** V1 error format. */
581
+ '$.xgafv'?: string;
582
+ /** OAuth access token. */
583
+ access_token?: string;
584
+ /** Data format for response. */
585
+ alt?: string;
586
+ /** JSONP */
587
+ callback?: string;
588
+ /** Selector specifying which fields to include in a partial response. */
589
+ fields?: string;
590
+ /** 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. */
591
+ key?: string;
592
+ /** Required. The name of the entitlement to update. */
593
+ name: string;
594
+ /** OAuth 2.0 token for the current user. */
595
+ oauth_token?: string;
596
+ /** Returns response with indentations and line breaks. */
597
+ prettyPrint?: boolean;
598
+ /** 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. */
599
+ quotaUser?: string;
600
+ /** The update mask that applies to the resource. See the [FieldMask definition] (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask) for more details. */
601
+ updateMask?: string;
602
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
603
+ upload_protocol?: string;
604
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
605
+ uploadType?: string;
606
+ /** Request body */
607
+ resource: Entitlement;
608
+ }): Request<Entitlement>;
609
+ patch(
610
+ request: {
611
+ /** V1 error format. */
612
+ '$.xgafv'?: string;
613
+ /** OAuth access token. */
614
+ access_token?: string;
615
+ /** Data format for response. */
616
+ alt?: string;
617
+ /** JSONP */
618
+ callback?: string;
619
+ /** Selector specifying which fields to include in a partial response. */
620
+ fields?: string;
621
+ /** 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. */
622
+ key?: string;
623
+ /** Required. The name of the entitlement to update. */
624
+ name: string;
625
+ /** OAuth 2.0 token for the current user. */
626
+ oauth_token?: string;
627
+ /** Returns response with indentations and line breaks. */
628
+ prettyPrint?: boolean;
629
+ /** 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. */
630
+ quotaUser?: string;
631
+ /** The update mask that applies to the resource. See the [FieldMask definition] (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask) for more details. */
632
+ updateMask?: string;
633
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
634
+ upload_protocol?: string;
635
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
636
+ uploadType?: string;
637
+ },
638
+ body: Entitlement
639
+ ): Request<Entitlement>;
640
+ /** Rejects an entitlement that is in the EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED state. This method is invoked by the provider to reject the creation of the entitlement resource. */
641
+ reject(request: {
642
+ /** V1 error format. */
643
+ '$.xgafv'?: string;
644
+ /** OAuth access token. */
645
+ access_token?: string;
646
+ /** Data format for response. */
647
+ alt?: string;
648
+ /** JSONP */
649
+ callback?: string;
650
+ /** Selector specifying which fields to include in a partial response. */
651
+ fields?: string;
652
+ /** 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. */
653
+ key?: string;
654
+ /** Required. The resource name of the entitlement. */
655
+ name: string;
656
+ /** OAuth 2.0 token for the current user. */
657
+ oauth_token?: string;
658
+ /** Returns response with indentations and line breaks. */
659
+ prettyPrint?: boolean;
660
+ /** 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. */
661
+ quotaUser?: string;
662
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
663
+ upload_protocol?: string;
664
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
665
+ uploadType?: string;
666
+ /** Request body */
667
+ resource: RejectEntitlementRequest;
668
+ }): Request<{}>;
669
+ reject(
670
+ request: {
671
+ /** V1 error format. */
672
+ '$.xgafv'?: string;
673
+ /** OAuth access token. */
674
+ access_token?: string;
675
+ /** Data format for response. */
676
+ alt?: string;
677
+ /** JSONP */
678
+ callback?: string;
679
+ /** Selector specifying which fields to include in a partial response. */
680
+ fields?: string;
681
+ /** 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. */
682
+ key?: string;
683
+ /** Required. The resource name of the entitlement. */
684
+ name: string;
685
+ /** OAuth 2.0 token for the current user. */
686
+ oauth_token?: string;
687
+ /** Returns response with indentations and line breaks. */
688
+ prettyPrint?: boolean;
689
+ /** 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. */
690
+ quotaUser?: string;
691
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
692
+ upload_protocol?: string;
693
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
694
+ uploadType?: string;
695
+ },
696
+ body: RejectEntitlementRequest
697
+ ): Request<{}>;
698
+ /** Rejects an entitlement plan change that is in the EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This method is invoked by the provider to reject the plan change on the entitlement resource. */
699
+ rejectPlanChange(request: {
700
+ /** V1 error format. */
701
+ '$.xgafv'?: string;
702
+ /** OAuth access token. */
703
+ access_token?: string;
704
+ /** Data format for response. */
705
+ alt?: string;
706
+ /** JSONP */
707
+ callback?: string;
708
+ /** Selector specifying which fields to include in a partial response. */
709
+ fields?: string;
710
+ /** 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. */
711
+ key?: string;
712
+ /** Required. The resource name of the entitlement. */
713
+ name: string;
714
+ /** OAuth 2.0 token for the current user. */
715
+ oauth_token?: string;
716
+ /** Returns response with indentations and line breaks. */
717
+ prettyPrint?: boolean;
718
+ /** 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. */
719
+ quotaUser?: string;
720
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
721
+ upload_protocol?: string;
722
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
723
+ uploadType?: string;
724
+ /** Request body */
725
+ resource: RejectEntitlementPlanChangeRequest;
726
+ }): Request<{}>;
727
+ rejectPlanChange(
728
+ request: {
729
+ /** V1 error format. */
730
+ '$.xgafv'?: string;
731
+ /** OAuth access token. */
732
+ access_token?: string;
733
+ /** Data format for response. */
734
+ alt?: string;
735
+ /** JSONP */
736
+ callback?: string;
737
+ /** Selector specifying which fields to include in a partial response. */
738
+ fields?: string;
739
+ /** 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. */
740
+ key?: string;
741
+ /** Required. The resource name of the entitlement. */
742
+ name: string;
743
+ /** OAuth 2.0 token for the current user. */
744
+ oauth_token?: string;
745
+ /** Returns response with indentations and line breaks. */
746
+ prettyPrint?: boolean;
747
+ /** 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. */
748
+ quotaUser?: string;
749
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
750
+ upload_protocol?: string;
751
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
752
+ uploadType?: string;
753
+ },
754
+ body: RejectEntitlementPlanChangeRequest
755
+ ): Request<{}>;
756
+ /** Requests suspension of an active Entitlement. This is not yet supported. */
757
+ suspend(request: {
758
+ /** V1 error format. */
759
+ '$.xgafv'?: string;
760
+ /** OAuth access token. */
761
+ access_token?: string;
762
+ /** Data format for response. */
763
+ alt?: string;
764
+ /** JSONP */
765
+ callback?: string;
766
+ /** Selector specifying which fields to include in a partial response. */
767
+ fields?: string;
768
+ /** 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. */
769
+ key?: string;
770
+ /** Required. The name of the entitlement to suspend. */
771
+ name: string;
772
+ /** OAuth 2.0 token for the current user. */
773
+ oauth_token?: string;
774
+ /** Returns response with indentations and line breaks. */
775
+ prettyPrint?: boolean;
776
+ /** 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. */
777
+ quotaUser?: string;
778
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
779
+ upload_protocol?: string;
780
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
781
+ uploadType?: string;
782
+ /** Request body */
783
+ resource: SuspendEntitlementRequest;
784
+ }): Request<{}>;
785
+ suspend(
786
+ request: {
787
+ /** V1 error format. */
788
+ '$.xgafv'?: string;
789
+ /** OAuth access token. */
790
+ access_token?: string;
791
+ /** Data format for response. */
792
+ alt?: string;
793
+ /** JSONP */
794
+ callback?: string;
795
+ /** Selector specifying which fields to include in a partial response. */
796
+ fields?: string;
797
+ /** 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. */
798
+ key?: string;
799
+ /** Required. The name of the entitlement to suspend. */
800
+ name: string;
801
+ /** OAuth 2.0 token for the current user. */
802
+ oauth_token?: string;
803
+ /** Returns response with indentations and line breaks. */
804
+ prettyPrint?: boolean;
805
+ /** 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. */
806
+ quotaUser?: string;
807
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
808
+ upload_protocol?: string;
809
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
810
+ uploadType?: string;
811
+ },
812
+ body: SuspendEntitlementRequest
813
+ ): Request<{}>;
814
+ }
815
+ interface ProvidersResource {
816
+ accounts: AccountsResource;
817
+ entitlements: EntitlementsResource;
818
+ }
819
+
820
+ const providers: ProvidersResource;
821
+ }
822
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.cloudcommerceprocurement-v1",
3
+ "version": "0.0.20240609",
4
+ "description": "TypeScript typings for Cloud Commerce Partner Procurement 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,73 @@
1
+ # TypeScript typings for Cloud Commerce Partner Procurement API v1
2
+
3
+ Partner API for the Cloud Commerce Procurement Service.
4
+ For detailed description please check [documentation](https://cloud.google.com/marketplace/docs/partners/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Cloud Commerce Partner Procurement API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.cloudcommerceprocurement-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://cloudcommerceprocurement.googleapis.com/$discovery/rest?version=v1',
30
+ () => {
31
+ // now we can use:
32
+ // gapi.client.cloudcommerceprocurement
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('cloudcommerceprocurement', 'v1', () => {
40
+ // now we can use:
41
+ // gapi.client.cloudcommerceprocurement
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
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
52
+ 'https://www.googleapis.com/auth/cloud-platform',
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 Cloud Commerce Partner Procurement API resources: <!-- TODO: make this work for multiple namespaces -->
70
+
71
+ ```typescript
72
+
73
+ ```