@leaflow/sdk 0.0.0-dev.101.g01ce843

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 (48) hide show
  1. package/README.md +34 -0
  2. package/dist/account/v1/index.d.ts +54 -0
  3. package/dist/account/v1/index.js +5 -0
  4. package/dist/account/v1/schema.d.ts +1157 -0
  5. package/dist/account/v1/schema.js +5 -0
  6. package/dist/assistant/v1/index.d.ts +108 -0
  7. package/dist/assistant/v1/index.js +5 -0
  8. package/dist/assistant/v1/schema.d.ts +2840 -0
  9. package/dist/assistant/v1/schema.js +5 -0
  10. package/dist/billing/v1/index.d.ts +74 -0
  11. package/dist/billing/v1/index.js +5 -0
  12. package/dist/billing/v1/schema.d.ts +2445 -0
  13. package/dist/billing/v1/schema.js +5 -0
  14. package/dist/canopy/v1/index.d.ts +48 -0
  15. package/dist/canopy/v1/index.js +5 -0
  16. package/dist/canopy/v1/schema.d.ts +1100 -0
  17. package/dist/canopy/v1/schema.js +5 -0
  18. package/dist/compute/v1/index.d.ts +246 -0
  19. package/dist/compute/v1/index.js +5 -0
  20. package/dist/compute/v1/schema.d.ts +4924 -0
  21. package/dist/compute/v1/schema.js +5 -0
  22. package/dist/dns/v1/index.d.ts +42 -0
  23. package/dist/dns/v1/index.js +5 -0
  24. package/dist/dns/v1/schema.d.ts +883 -0
  25. package/dist/dns/v1/schema.js +5 -0
  26. package/dist/iam/v1/index.d.ts +84 -0
  27. package/dist/iam/v1/index.js +5 -0
  28. package/dist/iam/v1/schema.d.ts +1658 -0
  29. package/dist/iam/v1/schema.js +5 -0
  30. package/dist/index.d.ts +11 -0
  31. package/dist/index.js +6 -0
  32. package/dist/monitoring/v1/index.d.ts +176 -0
  33. package/dist/monitoring/v1/index.js +5 -0
  34. package/dist/monitoring/v1/schema.d.ts +4181 -0
  35. package/dist/monitoring/v1/schema.js +5 -0
  36. package/dist/notification/v1/index.d.ts +76 -0
  37. package/dist/notification/v1/index.js +5 -0
  38. package/dist/notification/v1/schema.d.ts +2038 -0
  39. package/dist/notification/v1/schema.js +5 -0
  40. package/dist/support/v1/index.d.ts +50 -0
  41. package/dist/support/v1/index.js +5 -0
  42. package/dist/support/v1/schema.d.ts +1078 -0
  43. package/dist/support/v1/schema.js +5 -0
  44. package/dist/tunnel/v1/index.d.ts +16 -0
  45. package/dist/tunnel/v1/index.js +5 -0
  46. package/dist/tunnel/v1/schema.d.ts +401 -0
  47. package/dist/tunnel/v1/schema.js +5 -0
  48. package/package.json +74 -0
@@ -0,0 +1,2445 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export interface paths {
6
+ "/account/v1/billing-accounts": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ /**
14
+ * List my billing accounts
15
+ * @description Every billing account belonging to the caller, with the projects each one currently pays for.
16
+ *
17
+ * Not paginated: how many accounts one person holds is bounded by how many they bothered to
18
+ * create, and that is a small number.
19
+ */
20
+ get: operations["list-billing-accounts"];
21
+ put?: never;
22
+ /**
23
+ * Create a billing account
24
+ * @description Creates a billing account for the caller.
25
+ *
26
+ * **`seq` is supplied by the client, not assigned here.** Assigning it would mean reading the
27
+ * existing accounts and adding one, which is a read-modify-write race: two concurrent "create"
28
+ * clicks compute the same `seq`. Having the client name it turns that race into a plain
29
+ * idempotent repeat — the second request returns the first account instead of failing.
30
+ *
31
+ * The new account pays for nothing. Binding a project is a separate, deliberate act; doing it
32
+ * here would quietly turn "I want to add a card" into "I have changed who pays".
33
+ */
34
+ post: operations["create-billing-account"];
35
+ delete?: never;
36
+ options?: never;
37
+ head?: never;
38
+ patch?: never;
39
+ trace?: never;
40
+ };
41
+ "/account/v1/billing-accounts/{accountKey}": {
42
+ parameters: {
43
+ query?: never;
44
+ header?: never;
45
+ path?: never;
46
+ cookie?: never;
47
+ };
48
+ /**
49
+ * Read one of my billing accounts
50
+ * @description One account, with the projects it currently pays for.
51
+ *
52
+ * The list returns the same objects, so this exists for the case the list cannot serve: a link
53
+ * straight to one account. Making the caller fetch every account and filter turns a bookmarked
54
+ * page into a request whose cost grows with how many accounts they hold.
55
+ */
56
+ get: operations["get-billing-account"];
57
+ /**
58
+ * Rename a billing account
59
+ * @description Changes the display name. Nothing else about the account can be changed here.
60
+ *
61
+ * The key is not among the fields and never will be: ownership is stated by the key, and
62
+ * invoices already issued refer to it. The name is what tells two accounts apart in a list, so
63
+ * a mistake made while creating one is otherwise permanent.
64
+ */
65
+ put: operations["update-billing-account"];
66
+ post?: never;
67
+ delete?: never;
68
+ options?: never;
69
+ head?: never;
70
+ patch?: never;
71
+ trace?: never;
72
+ };
73
+ "/account/v1/billing-accounts/{accountKey}/credit-transactions": {
74
+ parameters: {
75
+ query?: never;
76
+ header?: never;
77
+ path?: never;
78
+ cookie?: never;
79
+ };
80
+ /**
81
+ * How the balance got to where it is
82
+ * @description Every movement of credit on this account: what was added, what was spent, what expired, what
83
+ * was voided. Newest first.
84
+ *
85
+ * The balance on its own is a number with no account of itself. Asked why it is lower than
86
+ * expected, it cannot answer, and the holder is left to guess between "I was charged" and
87
+ * "something expired" — which lead to different next steps.
88
+ */
89
+ get: operations["list-credit-transactions"];
90
+ put?: never;
91
+ post?: never;
92
+ delete?: never;
93
+ options?: never;
94
+ head?: never;
95
+ patch?: never;
96
+ trace?: never;
97
+ };
98
+ "/account/v1/billing-accounts/{accountKey}/balance": {
99
+ parameters: {
100
+ query?: never;
101
+ header?: never;
102
+ path?: never;
103
+ cookie?: never;
104
+ };
105
+ /**
106
+ * Read an account's balance
107
+ * @description What is left on the account.
108
+ *
109
+ * The figure is the **live** balance: usage that has been reported but not yet settled is
110
+ * already subtracted. The settled figure is larger, and the difference is precisely what the
111
+ * holder has just spent — showing that instead would tell them they can afford something they
112
+ * cannot.
113
+ *
114
+ * An account that has never been topped up reports `"0"` — not an absent field, and not an
115
+ * empty string.
116
+ */
117
+ get: operations["read-billing-account-balance"];
118
+ put?: never;
119
+ post?: never;
120
+ delete?: never;
121
+ options?: never;
122
+ head?: never;
123
+ patch?: never;
124
+ trace?: never;
125
+ };
126
+ "/account/v1/billing-accounts/{accountKey}/projects/{projectId}": {
127
+ parameters: {
128
+ query?: never;
129
+ header?: never;
130
+ path?: never;
131
+ cookie?: never;
132
+ };
133
+ get?: never;
134
+ /**
135
+ * Make this account pay for a project
136
+ * @description Binds a project to this account. A project bound to another account is moved.
137
+ *
138
+ * **Both the account and the project must belong to the caller.** Either one failing refuses the
139
+ * request. Requiring the project as well as the account is what stops somebody attaching a
140
+ * project that is not theirs — which sounds generous, since they would be paying for it, but it
141
+ * would also expose that project's usage to them, and let them detach it again at any moment,
142
+ * leaving the project with no account and therefore unable to allocate anything.
143
+ *
144
+ * Idempotent: binding a project already bound to this account changes nothing.
145
+ *
146
+ * Only subsequent usage is affected; see the hard constraint on rebinding.
147
+ */
148
+ put: operations["bind-project-to-billing-account"];
149
+ post?: never;
150
+ /**
151
+ * Stop paying for a project
152
+ * @description Unbinds the project from this account. Nothing pays for it afterwards, and **everything in it
153
+ * is refused admission** until some account takes it on — no new machines, no forwarded
154
+ * requests.
155
+ *
156
+ * That consequence is the reason this exists rather than an argument against it: a project
157
+ * bound to the wrong account has no other way out, and moving it to another of the caller's
158
+ * accounts is not a correction when the answer is that this account should not be paying for
159
+ * it at all.
160
+ *
161
+ * Charges already accrued stay where they are. They were incurred while this account held the
162
+ * project, and an invoice has to keep pointing at what it was based on.
163
+ */
164
+ delete: operations["unbind-project-from-billing-account"];
165
+ options?: never;
166
+ head?: never;
167
+ patch?: never;
168
+ trace?: never;
169
+ };
170
+ "/account/v1/billing-accounts/{accountKey}/orders": {
171
+ parameters: {
172
+ query?: never;
173
+ header?: never;
174
+ path?: never;
175
+ cookie?: never;
176
+ };
177
+ /**
178
+ * My orders
179
+ * @description Every provisioning request made against the projects this account pays for, newest first.
180
+ *
181
+ * An order that never went through stays here on purpose. Removing it would leave nothing to
182
+ * look at in exactly the case someone wants to look: a resource was asked for, was not
183
+ * delivered, and the question is what happened.
184
+ *
185
+ * The list carries no lines. An order has only a handful, but shipping them on every page
186
+ * means carrying data no column shows.
187
+ */
188
+ get: operations["list-orders"];
189
+ put?: never;
190
+ post?: never;
191
+ delete?: never;
192
+ options?: never;
193
+ head?: never;
194
+ patch?: never;
195
+ trace?: never;
196
+ };
197
+ "/account/v1/billing-accounts/{accountKey}/orders/{orderId}": {
198
+ parameters: {
199
+ query?: never;
200
+ header?: never;
201
+ path?: never;
202
+ cookie?: never;
203
+ };
204
+ /**
205
+ * One order, with its lines
206
+ * @description Each line names what was asked for and how much of it. This is the only route that carries
207
+ * them.
208
+ */
209
+ get: operations["get-order"];
210
+ put?: never;
211
+ post?: never;
212
+ delete?: never;
213
+ options?: never;
214
+ head?: never;
215
+ patch?: never;
216
+ trace?: never;
217
+ };
218
+ "/account/v1/billing-accounts/{accountKey}/top-ups": {
219
+ parameters: {
220
+ query?: never;
221
+ header?: never;
222
+ path?: never;
223
+ cookie?: never;
224
+ };
225
+ /**
226
+ * My top-ups
227
+ * @description Every top-up this account has made, newest first.
228
+ *
229
+ * Reading one top-up requires already holding its identifier, and the only place that
230
+ * identifier appears is the redirect that started it — so without this list a top-up becomes
231
+ * unfindable the moment the browser tab is closed, which is exactly when somebody wants to
232
+ * check whether their money arrived.
233
+ */
234
+ get: operations["list-top-ups"];
235
+ put?: never;
236
+ /**
237
+ * Start a top-up
238
+ * @description Begins adding money to this account. Returns a URL to send the browser to; the card is
239
+ * entered there, on the payment provider's own page.
240
+ *
241
+ * **No card data ever reaches this platform**, in any field, in any log. That is the entire
242
+ * reason this returns a redirect instead of accepting card details.
243
+ *
244
+ * **Credit is not added here.** It is added once the payment provider confirms the money
245
+ * arrived, which happens out of band and usually within seconds. The balance is unchanged when
246
+ * this call returns, and polling it immediately will show the old figure.
247
+ *
248
+ * That ordering is deliberate. Credit is spendable as soon as it exists, so anything added
249
+ * before the charge succeeds is money the holder can spend against a payment that then fails.
250
+ *
251
+ * Abandoning the page costs nothing; nothing is created on the account until the money arrives.
252
+ */
253
+ post: operations["start-top-up"];
254
+ delete?: never;
255
+ options?: never;
256
+ head?: never;
257
+ patch?: never;
258
+ trace?: never;
259
+ };
260
+ "/account/v1/billing-accounts/{accountKey}/charges": {
261
+ parameters: {
262
+ query?: never;
263
+ header?: never;
264
+ path?: never;
265
+ cookie?: never;
266
+ };
267
+ /**
268
+ * What this period has run up so far
269
+ * @description The itemised version of `unsettled`: what has been used this period and not yet billed.
270
+ *
271
+ * It has to come from charges rather than from invoices. An invoice only exists once a period has
272
+ * been billed, and the one for the period in progress is in a state that does not appear in the
273
+ * invoice list at all — reading invoices would show nothing and suggest the account has used
274
+ * nothing, while the spend keeps climbing.
275
+ */
276
+ get: operations["list-charges"];
277
+ put?: never;
278
+ post?: never;
279
+ delete?: never;
280
+ options?: never;
281
+ head?: never;
282
+ patch?: never;
283
+ trace?: never;
284
+ };
285
+ "/account/v1/billing-accounts/{accountKey}/invoices": {
286
+ parameters: {
287
+ query?: never;
288
+ header?: never;
289
+ path?: never;
290
+ cookie?: never;
291
+ };
292
+ /**
293
+ * List this account's invoices
294
+ * @description Past periods, most recent first. The period in progress is not here — see the charges
295
+ * endpoint for that.
296
+ */
297
+ get: operations["list-invoices"];
298
+ put?: never;
299
+ post?: never;
300
+ delete?: never;
301
+ options?: never;
302
+ head?: never;
303
+ patch?: never;
304
+ trace?: never;
305
+ };
306
+ "/account/v1/billing-accounts/{accountKey}/invoices/{invoiceId}": {
307
+ parameters: {
308
+ query?: never;
309
+ header?: never;
310
+ path?: never;
311
+ cookie?: never;
312
+ };
313
+ /**
314
+ * Read one invoice with its lines
315
+ * @description A total does not answer "why is it this much", and that is the question a bill provokes. Each
316
+ * line carries its service period, without which lines of the same name — hundreds of them on an
317
+ * hourly bill — cannot be told apart, and how much of it credit covered, which is the answer to
318
+ * "I have a balance, why am I being charged".
319
+ */
320
+ get: operations["get-invoice"];
321
+ put?: never;
322
+ post?: never;
323
+ delete?: never;
324
+ options?: never;
325
+ head?: never;
326
+ patch?: never;
327
+ trace?: never;
328
+ };
329
+ "/account/v1/projects/{projectId}/quote": {
330
+ parameters: {
331
+ query?: never;
332
+ header?: never;
333
+ path?: never;
334
+ cookie?: never;
335
+ };
336
+ get?: never;
337
+ put?: never;
338
+ /**
339
+ * What a usage would cost in this project
340
+ * @description Prices a set of usages against whatever plan pays for this project, and returns **every
341
+ * intermediate step** rather than a single number.
342
+ *
343
+ * # Why by project rather than by billing account
344
+ *
345
+ * The page that needs this is the one where somebody is about to create a machine, and all it has
346
+ * is a project. Which account pays for that project is billing's own bookkeeping — asking the
347
+ * caller to resolve it first would put that mapping into a page that otherwise has no business
348
+ * knowing accounts exist.
349
+ *
350
+ * # Quantities are raw
351
+ *
352
+ * Seconds, token counts, GiB-seconds: the amount a service reports. Conversion happens here, which
353
+ * is why services keep no conversion tables of their own and why the caller must not do the
354
+ * arithmetic itself.
355
+ *
356
+ * Name each usage by `service` and `product_id` rather than by key: the key is a hash of a
357
+ * convention that has exactly one implementation on purpose.
358
+ *
359
+ * # It is an estimate
360
+ *
361
+ * The engine computes the real amount; this reproduces the same rules. Every step comes back for
362
+ * that reason — a single number that disagrees with the bill says nothing about which step was
363
+ * wrong.
364
+ *
365
+ * `404` means the project has no billing account, or its account is on no plan. Both are worth
366
+ * showing: nothing can be created in either case, because admission refuses it.
367
+ */
368
+ post: operations["quote-project-usage"];
369
+ delete?: never;
370
+ options?: never;
371
+ head?: never;
372
+ patch?: never;
373
+ trace?: never;
374
+ };
375
+ "/account/v1/billing-accounts/{accountKey}/quote": {
376
+ parameters: {
377
+ query?: never;
378
+ header?: never;
379
+ path?: never;
380
+ cookie?: never;
381
+ };
382
+ get?: never;
383
+ put?: never;
384
+ /**
385
+ * What a usage would cost on this account's plan
386
+ * @description Prices a set of usages against whatever plan this account is currently on, and returns **every
387
+ * intermediate step** rather than a single number.
388
+ *
389
+ * # What it is for
390
+ *
391
+ * Showing someone what a machine will cost before they create it. The console asks for the usage a
392
+ * machine of that shape produces in an hour, and gets back what that hour costs them — on their
393
+ * plan, with their discounts.
394
+ *
395
+ * # Quantities are raw
396
+ *
397
+ * Seconds, token counts, GiB-seconds: the amount a service reports. Conversion happens here, which
398
+ * is why services keep no conversion tables of their own and why the console must not do the
399
+ * arithmetic itself.
400
+ *
401
+ * # It is an estimate
402
+ *
403
+ * The engine computes the real amount; this reproduces the same rules. Every step comes back for
404
+ * that reason — a single number that disagrees with the bill says nothing about which step was
405
+ * wrong.
406
+ *
407
+ * `404` means this account is not on any plan, and there is therefore nothing to price against.
408
+ */
409
+ post: operations["quote-usage"];
410
+ delete?: never;
411
+ options?: never;
412
+ head?: never;
413
+ patch?: never;
414
+ trace?: never;
415
+ };
416
+ "/account/v1/billing-accounts/{accountKey}/subscription": {
417
+ parameters: {
418
+ query?: never;
419
+ header?: never;
420
+ path?: never;
421
+ cookie?: never;
422
+ };
423
+ /**
424
+ * Which plan this account is on
425
+ * @description `404` means no plan, which is worth showing rather than hiding: an account without one is
426
+ * refused admission, so nothing can be allocated in it.
427
+ *
428
+ * A subscription that has been cancelled but has not reached the end of its period still counts
429
+ * as being on a plan — it is still serving, still billing, and the period has already been paid
430
+ * for.
431
+ */
432
+ get: operations["read-subscription"];
433
+ put?: never;
434
+ post?: never;
435
+ delete?: never;
436
+ options?: never;
437
+ head?: never;
438
+ patch?: never;
439
+ trace?: never;
440
+ };
441
+ "/account/v1/billing-accounts/{accountKey}/subscription/cancel": {
442
+ parameters: {
443
+ query?: never;
444
+ header?: never;
445
+ path?: never;
446
+ cookie?: never;
447
+ };
448
+ get?: never;
449
+ put?: never;
450
+ /**
451
+ * Come off the paid plan
452
+ * @description Moves the account off whatever plan it is on.
453
+ *
454
+ * Where a default plan is configured this is a switch to it rather than a cancellation — an
455
+ * account with no plan is refused admission, so cancelling outright would cut off someone who
456
+ * only meant to drop back to the free tier. Without a default plan it is a real cancellation and
457
+ * the account is left with no plan on purpose.
458
+ *
459
+ * `timing` has to be stated. Ending immediately on an account that has already paid for the
460
+ * current period takes back what they paid for; ending at the end of the period does not. There
461
+ * is no default because the two are materially different and picking one silently would make the
462
+ * wrong one happen whenever the field is forgotten.
463
+ *
464
+ * Without this, someone who bought a paid plan can only stop paying by contacting support —
465
+ * which is how a cancellation becomes a chargeback.
466
+ */
467
+ post: operations["cancel-subscription"];
468
+ delete?: never;
469
+ options?: never;
470
+ head?: never;
471
+ patch?: never;
472
+ trace?: never;
473
+ };
474
+ "/account/v1/billing-accounts/{accountKey}/top-ups/{paymentId}": {
475
+ parameters: {
476
+ query?: never;
477
+ header?: never;
478
+ path?: never;
479
+ cookie?: never;
480
+ };
481
+ /**
482
+ * How far along a top-up is
483
+ * @description Credit arrives asynchronously, shortly after the payment provider confirms the money. Coming
484
+ * back from the payment page the balance has usually not moved yet, and without this there is no
485
+ * way to tell "it is on its way" from "it failed" — the only recourse is refreshing the balance
486
+ * and guessing.
487
+ *
488
+ * `settled` means the credit has landed. `pending` means the money arrived and the credit has
489
+ * not been issued yet, or the payment method is an asynchronous one and the money itself is
490
+ * still in transit.
491
+ */
492
+ get: operations["read-top-up"];
493
+ put?: never;
494
+ post?: never;
495
+ delete?: never;
496
+ options?: never;
497
+ head?: never;
498
+ patch?: never;
499
+ trace?: never;
500
+ };
501
+ "/account/v1/billing-accounts/{accountKey}/payment-method": {
502
+ parameters: {
503
+ query?: never;
504
+ header?: never;
505
+ path?: never;
506
+ cookie?: never;
507
+ };
508
+ /**
509
+ * Whether this account can be charged
510
+ * @description Answers whether a payment method is on file, and nothing else.
511
+ *
512
+ * ## It is a payment method, not a card
513
+ *
514
+ * A card is one kind. Direct debit and the recurring-payment mandates offered by regional
515
+ * wallets are others, and they occupy the same slot: something the provider can charge later
516
+ * without the account holder present. Naming the slot after cards would put an assumption
517
+ * into the contract that stops being true the day a second kind is accepted.
518
+ *
519
+ * ## Why there is no brand, no last four digits, no expiry
520
+ *
521
+ * Those would have to be read from the payment provider, and the two answers can disagree: a
522
+ * method present at the provider that the billing engine has not recorded as the default is
523
+ * exactly the state in which money cannot be collected — while a page built on the provider's
524
+ * answer would be showing one. What matters here is whether the party that will run the
525
+ * charge believes it can, so the answer comes from that party alone.
526
+ *
527
+ * To see it, replace it, or remove it, open the billing portal.
528
+ *
529
+ * ## Read this before offering a paid plan, not after
530
+ *
531
+ * `ready` being false is why the engine refuses to start a paid subscription. Discovering it
532
+ * at purchase time turns a missing payment method into a rejection whose wording is about
533
+ * something else entirely.
534
+ *
535
+ * An account that has never had one returns `ready: false`. That is the normal state of a
536
+ * new account, not an error.
537
+ */
538
+ get: operations["read-payment-method"];
539
+ put?: never;
540
+ /**
541
+ * Add or replace the payment method on file
542
+ * @description Begins adding a payment method. Returns a URL to send the browser to; the details are
543
+ * entered there, on the payment provider's own page, and **no card data ever reaches this
544
+ * platform**.
545
+ *
546
+ * Which kinds are offered is the provider's decision, not this API's — a card today, a
547
+ * wallet mandate or a direct debit wherever the provider supports charging one later without
548
+ * the account holder present.
549
+ *
550
+ * ## This is a prerequisite for buying a plan, not a convenience
551
+ *
552
+ * A plan is charged by invoice, and the invoice is collected from the method on file. A
553
+ * subscription cannot start for an account that has none — so "add a payment method, then
554
+ * buy" is the order the system requires, not a flow that was chosen.
555
+ *
556
+ * It is *not* a prerequisite for topping up: a top-up collects the money there and then.
557
+ *
558
+ * Replacing uses the same operation. The new method becomes the default and the old one stops
559
+ * being used; nothing else about the account changes.
560
+ */
561
+ post: operations["start-payment-method-setup"];
562
+ delete?: never;
563
+ options?: never;
564
+ head?: never;
565
+ patch?: never;
566
+ trace?: never;
567
+ };
568
+ "/account/v1/billing-accounts/{accountKey}/billing-portal": {
569
+ parameters: {
570
+ query?: never;
571
+ header?: never;
572
+ path?: never;
573
+ cookie?: never;
574
+ };
575
+ get?: never;
576
+ put?: never;
577
+ /**
578
+ * Open the hosted billing portal
579
+ * @description Returns a URL to the payment provider's own portal, where the card can be replaced or
580
+ * removed, the billing address changed, and past invoices downloaded.
581
+ *
582
+ * ## Why replacing a card is not a form on this platform
583
+ *
584
+ * A form would mean a card number field, and no card data ever reaches this platform. The
585
+ * portal moves the whole interaction to the provider; only a session URL comes back.
586
+ *
587
+ * ## Something has to be able to replace an expiring card
588
+ *
589
+ * Cards expire. Once one does, the invoices for a plan stop being collectable, dunning runs
590
+ * out, and the projects paid for by this account are suspended for non-payment. Without this
591
+ * operation the account holder watches that happen with nowhere to fix it — adding a card
592
+ * does not help, since that operation only makes sense when there is none.
593
+ *
594
+ * The URL is single-use and expires. Do not store it.
595
+ */
596
+ post: operations["start-billing-portal"];
597
+ delete?: never;
598
+ options?: never;
599
+ head?: never;
600
+ patch?: never;
601
+ trace?: never;
602
+ };
603
+ "/account/v1/billing-accounts/{accountKey}/offers": {
604
+ parameters: {
605
+ query?: never;
606
+ header?: never;
607
+ path?: never;
608
+ cookie?: never;
609
+ };
610
+ /**
611
+ * List the offers this account can buy
612
+ * @description Lists what is actually purchasable by this account, right now.
613
+ *
614
+ * ## Every offer here has passed the full eligibility check
615
+ *
616
+ * The list is not "everything on sale" filtered by status. A promotion whose places are gone, a
617
+ * first-month discount this person already used, a beta price they are not on the list for —
618
+ * none of them appear. Returning them and rejecting the purchase afterwards reads as a broken
619
+ * system rather than as a rule.
620
+ *
621
+ * The price is not here, and not because it was left out: an offer states **who may buy, and
622
+ * when**. What it costs comes from the plan it points at, and is reported by the offers list.
623
+ */
624
+ get: operations["list-offers"];
625
+ put?: never;
626
+ post?: never;
627
+ delete?: never;
628
+ options?: never;
629
+ head?: never;
630
+ patch?: never;
631
+ trace?: never;
632
+ };
633
+ "/account/v1/billing-accounts/{accountKey}/offers/{offerKey}/purchase": {
634
+ parameters: {
635
+ query?: never;
636
+ header?: never;
637
+ path?: never;
638
+ cookie?: never;
639
+ };
640
+ get?: never;
641
+ put?: never;
642
+ /**
643
+ * Buy an offer
644
+ * @description Puts the account on the plan this offer points at, taking one of its places if it has a limit.
645
+ *
646
+ * ## A card has to be on file first
647
+ *
648
+ * Unless the offer points at a free plan. A paid plan is collected from the card on file
649
+ * and refuses to start the subscription without one; that refusal arrives here as a
650
+ * precondition error rather than as a conflict.
651
+ *
652
+ * ## `timing` is required only when the account already has a plan
653
+ *
654
+ * Moving between plans immediately is what an upgrade wants — the customer paid more and wants
655
+ * it now. Waiting for the end of the period is what a downgrade wants — they already paid for
656
+ * this one. Neither is a safe default, and picking one silently gets the money wrong whenever
657
+ * the field is forgotten.
658
+ *
659
+ * ## Being refused says which rule refused
660
+ *
661
+ * Places gone, window closed, already used, not on the list — each needs the customer to do
662
+ * something different, and several of them need them to do nothing at all. A single "not
663
+ * eligible" sends everyone to support.
664
+ *
665
+ * ## Retrying is safe
666
+ *
667
+ * A place is taken before the subscription is created, so a failure in between leaves the place
668
+ * held rather than the discount given away. Retrying the same purchase finishes it instead of
669
+ * taking a second place.
670
+ */
671
+ post: operations["purchase-offer"];
672
+ delete?: never;
673
+ options?: never;
674
+ head?: never;
675
+ patch?: never;
676
+ trace?: never;
677
+ };
678
+ "/account/v1/billing-accounts/{accountKey}/prepaid-assets": {
679
+ parameters: {
680
+ query?: never;
681
+ header?: never;
682
+ path?: never;
683
+ cookie?: never;
684
+ };
685
+ /**
686
+ * What I bought outright, and when it runs out
687
+ * @description Everything this account paid a term for, across every product, soonest to expire first.
688
+ *
689
+ * ## Why this is one list rather than a page inside each product
690
+ *
691
+ * Renewal is the one thing a customer forgets, and forgetting it stops the machine. Splitting
692
+ * the list per product means the instance about to lapse tomorrow is only visible to someone
693
+ * who thought to go and look at instances. Sorting by expiry rather than by purchase date is
694
+ * the same reason: the row that matters is the one at the top.
695
+ *
696
+ * ## Metered resources are not here
697
+ *
698
+ * There is no term to run out. Listing them with an empty expiry would invite renewing
699
+ * something that is already billed by the hour until it is deleted.
700
+ *
701
+ * ## `state` and `desired_state` are both reported
702
+ *
703
+ * A machine stopped because its term lapsed reads `suspended` for both. One that has just been
704
+ * renewed reads `suspended` and `active` — it is on its way back. Without the second field
705
+ * those look identical, and a customer who just paid concludes it did not work and pays again.
706
+ */
707
+ get: operations["list-prepaid-assets"];
708
+ put?: never;
709
+ post?: never;
710
+ delete?: never;
711
+ options?: never;
712
+ head?: never;
713
+ patch?: never;
714
+ trace?: never;
715
+ };
716
+ "/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote": {
717
+ parameters: {
718
+ query?: never;
719
+ header?: never;
720
+ path?: never;
721
+ cookie?: never;
722
+ };
723
+ /**
724
+ * What renewing this would cost
725
+ * @description Priced the same way the charge is, from the same table, so the number shown is the number
726
+ * taken. Quoting separately from charging is what lets a customer see the price before
727
+ * committing; computing it twice in two places is what makes the two disagree, and a bill that
728
+ * disagrees with the page that sold it is a complaint rather than a bug report.
729
+ *
730
+ * ## Both the current and the resulting expiry are returned
731
+ *
732
+ * Renewing early adds the term to what is left, not to today — otherwise renewing a month
733
+ * ahead throws that month away, and everyone learns to wait until the last moment. Something
734
+ * that lapsed long ago is counted from now instead, because adding to a date in the past
735
+ * produces an expiry that is still in the past.
736
+ *
737
+ * Reporting only the new date leaves the customer unable to tell which of those happened.
738
+ *
739
+ * ## A withdrawn price still quotes
740
+ *
741
+ * Taking a product off sale means stop selling new ones. Refusing renewals as well would stop
742
+ * a batch of existing machines on their expiry date, which is not what the operator pressed
743
+ * that button for.
744
+ */
745
+ get: operations["quote-renewal"];
746
+ put?: never;
747
+ post?: never;
748
+ delete?: never;
749
+ options?: never;
750
+ head?: never;
751
+ patch?: never;
752
+ trace?: never;
753
+ };
754
+ "/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew": {
755
+ parameters: {
756
+ query?: never;
757
+ header?: never;
758
+ path?: never;
759
+ cookie?: never;
760
+ };
761
+ get?: never;
762
+ put?: never;
763
+ /**
764
+ * Renew it
765
+ * @description Takes the money from the balance and pushes the expiry out. The resource itself is not
766
+ * touched — nothing is rebuilt, nothing restarts, the id stays the same.
767
+ *
768
+ * ## An idempotency key is required, not optional
769
+ *
770
+ * Renewal is a pure charge. Unlike creating something, there is no resource whose uniqueness
771
+ * catches a repeat, so a double click is two charges and twice the term — and both calls
772
+ * return success. Letting the field be omitted would mean losing that protection silently, in
773
+ * the one case that looks completely normal until the books are reconciled.
774
+ *
775
+ * Sending the same key again returns the order that was already placed. It does not charge
776
+ * again, and it is not an error: reporting a repeat as a failure makes the caller retry
777
+ * forever, and makes the customer press the button a second time with a fresh key.
778
+ *
779
+ * ## What happens if the balance is short
780
+ *
781
+ * The order is recorded as failed and nothing else changes: no money moves, the expiry stays
782
+ * where it was, and the resource keeps running until its existing term ends. Retrying with the
783
+ * same key after topping up goes through.
784
+ *
785
+ * ## Renewing something that already lapsed brings it back
786
+ *
787
+ * Its term is counted from now, and it is asked to start again. Coming back is the
788
+ * reconciliation loop's job, so it is not instant — which is what `desired_state` on the asset
789
+ * list is for.
790
+ */
791
+ post: operations["renew-prepaid-asset"];
792
+ delete?: never;
793
+ options?: never;
794
+ head?: never;
795
+ patch?: never;
796
+ trace?: never;
797
+ };
798
+ }
799
+ export type webhooks = Record<string, never>;
800
+ export interface components {
801
+ schemas: {
802
+ /**
803
+ * @description The usages to price. Quantities are the **raw amounts a service reports** — seconds, token
804
+ * counts, GiB-seconds. Conversion happens on the billing side, which is why services keep no
805
+ * conversion tables of their own.
806
+ */
807
+ QuoteRequest: {
808
+ lines: components["schemas"]["QuoteUsage"][];
809
+ };
810
+ /**
811
+ * @description One usage to price. Name the thing **either** by its rate card key **or** by the service and
812
+ * product it belongs to — exactly one of the two.
813
+ *
814
+ * # Why the second form exists
815
+ *
816
+ * A meter's key is a hash of `(service, product_id, variant)`, computed by a function that lives in
817
+ * one place on purpose: get it wrong and usage lands in the wrong bucket, or in none, and nothing
818
+ * reports it. A caller that derived the key itself would be a second copy of that convention.
819
+ *
820
+ * So callers that know what they are buying — a machine of a given type, a model's input tokens —
821
+ * give the service and product, and this side derives the key.
822
+ */
823
+ QuoteUsage: {
824
+ /**
825
+ * @description The rate card's key. For a card tied to a meter that is the meter's key, because the engine
826
+ * requires the two to be identical.
827
+ *
828
+ * Leave it out when giving `service` and `product_id` instead
829
+ */
830
+ key?: string;
831
+ /** @description The service that owns the product, as it appears in its usage events */
832
+ service?: string;
833
+ /** @description That service's own catalogue id for the thing being bought */
834
+ product_id?: string;
835
+ /**
836
+ * @description The fixed dimension values that split one product into several meters — canopy's token kind,
837
+ * for instance. Part of the key, so leaving it out names a different meter
838
+ */
839
+ variant?: {
840
+ [key: string]: string;
841
+ };
842
+ /** @description The raw amount, before any conversion. A decimal string */
843
+ quantity: string;
844
+ };
845
+ /**
846
+ * @description One rate card priced, with every intermediate step.
847
+ *
848
+ * Each step is here on purpose: a single total that disagrees with the bill says nothing about
849
+ * which step went wrong, and this is a second implementation of the engine's rules
850
+ */
851
+ QuoteLine: {
852
+ key: string;
853
+ name: string;
854
+ /** @description False for a flat fee, which ignores usage entirely */
855
+ metered: boolean;
856
+ /** @description The quantity as given */
857
+ raw: string;
858
+ /** @description After unit conversion, before rounding */
859
+ converted: string;
860
+ /**
861
+ * @description After rounding. `unit_config.rounding` applies to this step only — entitlement uses the
862
+ * exact converted value, which is the engine's documented behaviour
863
+ */
864
+ billable: string;
865
+ /** @description Units covered by the usage discount */
866
+ free_units: string;
867
+ charged: string;
868
+ unit_price: string;
869
+ /** @description Before the percentage discount */
870
+ gross: string;
871
+ discount: string;
872
+ /**
873
+ * @description Rounded to the currency's minor unit, **per line**. Not by rounding the sum: the engine
874
+ * rounds each line, and the difference grows with the number of lines
875
+ */
876
+ total: string;
877
+ };
878
+ Quote: {
879
+ lines: components["schemas"]["QuoteLine"][];
880
+ /** @description The sum of the already-rounded lines */
881
+ total: string;
882
+ /**
883
+ * @description Keys that were given a usage but have no rate card on this plan.
884
+ *
885
+ * **Reported rather than ignored**, because ignoring them yields a smaller but entirely
886
+ * normal-looking number — and that is the most expensive misconfiguration there is: usage
887
+ * lands, the usage chart shows it, and the bill has no line for it
888
+ */
889
+ unpriced?: string[];
890
+ };
891
+ /**
892
+ * @description When a plan change takes effect. There is no default: an upgrade and a downgrade want opposite
893
+ * answers, and the difference is money
894
+ * @enum {string}
895
+ */
896
+ PlanChangeTiming: "immediate" | "next_billing_cycle";
897
+ OfferList: {
898
+ offers: components["schemas"]["Offer"][];
899
+ };
900
+ /**
901
+ * @description One thing this account can buy. It carries no price — the price is on the plan it points at,
902
+ * recorded in exactly one place
903
+ */
904
+ Offer: {
905
+ /** @description The stable identifier operations and support use for this offer */
906
+ offer_key: string;
907
+ name: string;
908
+ description?: string;
909
+ /** @description A short label for the pricing page, e.g. the one marking the recommended tier */
910
+ badge?: string;
911
+ /**
912
+ * Format: date-time
913
+ * @description When this offer stops being purchasable. Absent means it does not expire
914
+ */
915
+ valid_until?: string;
916
+ /** @description Present on offers that sell a plan */
917
+ pricing?: components["schemas"]["Pricing"];
918
+ /** @description Present on offers that sell credit */
919
+ top_up?: components["schemas"]["TopUpPricing"];
920
+ };
921
+ /**
922
+ * @description What this offer costs, as a structure rather than a number.
923
+ *
924
+ * A plan is rarely one number: an introductory period at one price followed by another, a monthly
925
+ * fee alongside metered usage, an allowance of free units before metering starts. Flattening that
926
+ * into a single figure means deciding which part to show, and every such decision is wrong for
927
+ * some plan.
928
+ *
929
+ * This is read on each request rather than stored alongside the offer. The plan owns
930
+ * prices; a second copy would be a second answer, and the two would drift without anything saying
931
+ * so — the visible symptom being a pricing page that disagrees with the invoice.
932
+ */
933
+ Pricing: {
934
+ currency: components["schemas"]["Currency"];
935
+ /** @description How often this recurs, as an ISO 8601 duration. `P1M` is monthly */
936
+ billing_period?: string;
937
+ /**
938
+ * @description In order. A phase with no `duration` runs until the subscription ends, and there is at most
939
+ * one of those, last
940
+ */
941
+ phases: components["schemas"]["PricingPhase"][];
942
+ };
943
+ PricingPhase: {
944
+ name: string;
945
+ /** @description How long this phase lasts, as an ISO 8601 duration. Absent means "until the end" */
946
+ duration?: string;
947
+ lines: components["schemas"]["PricingLine"][];
948
+ };
949
+ /** @description One charge within a phase — a fee, or a rate for something metered */
950
+ PricingLine: {
951
+ name: string;
952
+ /**
953
+ * @description `free` costs nothing. `flat` is charged once per period regardless of use. `unit` is charged
954
+ * per unit consumed
955
+ * @enum {string}
956
+ */
957
+ type: "free" | "flat" | "unit";
958
+ /** @description A decimal string. Money is never a float */
959
+ amount?: string;
960
+ /**
961
+ * @description For `unit` lines whose meter counts something finer than what is charged for: how many
962
+ * metered units one charge covers. A price of `10` with `units_per_charge` of `1000000` is
963
+ * ten currency units per million.
964
+ *
965
+ * Absent means one for one. **Showing the amount without this is wrong by whatever this
966
+ * factor is**, which for token pricing is six orders of magnitude
967
+ */
968
+ units_per_charge?: string;
969
+ /** @description How many units are not charged for before charging starts */
970
+ free_units?: string;
971
+ /**
972
+ * Format: float
973
+ * @description A reduction applied to this line, 0 to 100
974
+ */
975
+ percent_off?: number;
976
+ /**
977
+ * @description True when this is charged once at the start rather than every period. Absent or false means
978
+ * it recurs
979
+ */
980
+ one_time?: boolean;
981
+ };
982
+ UpdateBillingAccountRequestBody: {
983
+ display_name: string;
984
+ };
985
+ Order: {
986
+ id: string;
987
+ project_id: string;
988
+ placed_by: string;
989
+ /**
990
+ * @description Whether the request went through. It is not the state of what was provisioned: that
991
+ * belongs to each resource and outlives the order.
992
+ * @enum {string}
993
+ */
994
+ state: "pending" | "fulfilled" | "failed";
995
+ failure_reason?: string;
996
+ /**
997
+ * @description What was taken, as a decimal string. Absent on a metered order, where the amount is not
998
+ * known when the order is placed: it comes from usage afterwards. Absent must be read as
999
+ * "billed by usage" — writing zero would make a metered order and a genuinely free one
1000
+ * look the same.
1001
+ */
1002
+ amount?: string;
1003
+ currency?: string;
1004
+ /**
1005
+ * @description Always `none` on a metered order.
1006
+ * @enum {string}
1007
+ */
1008
+ payment_state?: "none" | "paid" | "refunded";
1009
+ /** Format: date-time */
1010
+ created_at: string;
1011
+ /** @description Only present on the single-order route. */
1012
+ lines?: components["schemas"]["OrderLine"][];
1013
+ };
1014
+ OrderLine: {
1015
+ id: string;
1016
+ /** @enum {string} */
1017
+ action: "add" | "renew" | "modify" | "remove";
1018
+ /** @description Which service holds the thing, for example `compute`. */
1019
+ service: string;
1020
+ /** @description That service's own catalogue identifier for what was asked for. */
1021
+ product_id: string;
1022
+ /** Format: int64 */
1023
+ quantity: number;
1024
+ };
1025
+ PrepaidAsset: {
1026
+ /** @description Use this to quote and to renew. */
1027
+ id: string;
1028
+ project_id: string;
1029
+ /** @description Which service holds it. Also which console it is managed from. */
1030
+ service: string;
1031
+ /**
1032
+ * @description That service's own catalogue id, not a billing sku. The price of a machine is made of
1033
+ * finer parts than the machine type — the type does not appear in the rate card at all.
1034
+ */
1035
+ product_id: string;
1036
+ /** @description The id that service knows it by, so the two consoles can be lined up. */
1037
+ resource_id?: string;
1038
+ /**
1039
+ * Format: int64
1040
+ * @description GiB for a disk, 1 for a machine or an address.
1041
+ */
1042
+ quantity: number;
1043
+ /**
1044
+ * Format: date-time
1045
+ * @description Paid up to this instant. It stops being served after it, not before.
1046
+ */
1047
+ term_end: string;
1048
+ /** @enum {string} */
1049
+ state: "pending" | "active" | "suspended" | "terminated";
1050
+ /**
1051
+ * @description What it is being moved to. Differs from `state` while a change is still being applied —
1052
+ * in particular right after a renewal, which is the moment a customer is most likely to
1053
+ * conclude that nothing happened.
1054
+ * @enum {string}
1055
+ */
1056
+ desired_state: "active" | "suspended" | "terminated";
1057
+ };
1058
+ PrepaidAssetList: {
1059
+ assets: components["schemas"]["PrepaidAsset"][];
1060
+ };
1061
+ RenewalQuote: {
1062
+ provision_id: string;
1063
+ term: string;
1064
+ /**
1065
+ * @description A decimal string, not a float. Money that survives a round trip through binary floating
1066
+ * point is money that stops adding up.
1067
+ */
1068
+ amount: string;
1069
+ currency: string;
1070
+ /**
1071
+ * Format: date-time
1072
+ * @description What it is paid up to now.
1073
+ */
1074
+ current_term_end: string;
1075
+ /**
1076
+ * Format: date-time
1077
+ * @description What it would be paid up to after renewing.
1078
+ */
1079
+ term_end: string;
1080
+ };
1081
+ RenewRequestBody: {
1082
+ /**
1083
+ * @description How long to renew for, as an ISO 8601 duration (P1M, P1Y). It does not have to match the
1084
+ * term originally bought.
1085
+ */
1086
+ term: string;
1087
+ /**
1088
+ * @description Generate one per renewal the customer starts — when the dialog opens, not when it is
1089
+ * submitted — and send the same one on every retry of that renewal.
1090
+ */
1091
+ idempotency_key: string;
1092
+ };
1093
+ OrderList: {
1094
+ orders: components["schemas"]["Order"][];
1095
+ };
1096
+ TopUpList: {
1097
+ top_ups: components["schemas"]["TopUpStatus"][];
1098
+ };
1099
+ CreditTransactionList: {
1100
+ transactions: components["schemas"]["CreditTransaction"][];
1101
+ };
1102
+ /**
1103
+ * @description One movement of credit. Immutable — a correction is another movement, never an edit of this
1104
+ * one, which is what lets the balance be recomputed from the list at any time
1105
+ */
1106
+ CreditTransaction: {
1107
+ id: string;
1108
+ type: components["schemas"]["CreditTransactionType"];
1109
+ /** @description A decimal string. Never a float — a balance that rounds is a balance that drifts */
1110
+ amount: string;
1111
+ currency: string;
1112
+ /**
1113
+ * Format: date-time
1114
+ * @description When it landed on the ledger, which is not always when it was requested
1115
+ */
1116
+ booked_at: string;
1117
+ /**
1118
+ * @description What the balance became. Recorded by the metering engine rather than recomputed here —
1119
+ * recomputing assumes our understanding of the burn-down order matches its own, and this
1120
+ * is its own account of it
1121
+ */
1122
+ balance_after: string;
1123
+ };
1124
+ /**
1125
+ * @description `funded` is credit arriving, `consumed` is it being spent, `expired` is a grant reaching the
1126
+ * end of its life unspent, and `voided` is one cancelled — a refund, or a correction
1127
+ * @enum {string}
1128
+ */
1129
+ CreditTransactionType: "funded" | "consumed" | "expired" | "voided";
1130
+ /**
1131
+ * @description What a top-up bundle costs and what it grants. Present only on offers that sell credit.
1132
+ *
1133
+ * Unlike a plan price, this is stated on the bundle itself: credit is granted per
1134
+ * transaction and has no catalog of bundles to read from. There is no second copy to drift
1135
+ * against, because there is no first one anywhere else
1136
+ */
1137
+ TopUpPricing: {
1138
+ /** @description What is charged, as a decimal string */
1139
+ pay: string;
1140
+ /** @description How much credit is granted. Equal to `pay` when there is no bonus */
1141
+ credit: string;
1142
+ };
1143
+ Purchase: {
1144
+ offer_key: string;
1145
+ /**
1146
+ * @description The subscription now serving this account. When the change was set to take effect at the
1147
+ * end of the period, this is the one that takes over then, and its status says `scheduled`
1148
+ */
1149
+ subscription_id: string;
1150
+ };
1151
+ Error: {
1152
+ code?: string;
1153
+ message: string;
1154
+ meta?: {
1155
+ [key: string]: unknown;
1156
+ };
1157
+ /** Format: int64 */
1158
+ status: number;
1159
+ };
1160
+ /**
1161
+ * @description A billing account.
1162
+ *
1163
+ * Any internal identifier is deliberately absent: the key addresses everything on
1164
+ * this API, and a second identifier is one more thing a client can pass in the wrong place, for
1165
+ * no benefit to anyone reading the page.
1166
+ */
1167
+ BillingAccount: {
1168
+ /** @description Addresses the account and states who owns it. Of the form `u_<user_id>_<seq>` */
1169
+ key: string;
1170
+ /** @description What the holder called it. Not unique, and it addresses nothing */
1171
+ display_name: string;
1172
+ currency: components["schemas"]["Currency"];
1173
+ /** @description The projects this account pays for. Empty when it pays for none, never `null` */
1174
+ project_ids: string[];
1175
+ };
1176
+ BillingAccountList: {
1177
+ /** @description Every account belonging to the caller. Empty when they hold none */
1178
+ accounts: components["schemas"]["BillingAccount"][];
1179
+ };
1180
+ CreateBillingAccountRequestBody: {
1181
+ /**
1182
+ * Format: int32
1183
+ * @description Which of the caller's accounts this is. Two requests carrying the same `seq` describe the
1184
+ * same account, so a retry is safe; a different `seq` creates a different account.
1185
+ *
1186
+ * It is not optional. Defaulting it would mean that a client which forgot the field
1187
+ * silently receives the account it already had, and reads that as a successful creation.
1188
+ */
1189
+ seq: number;
1190
+ /** @description A name for the holder's own benefit */
1191
+ display_name: string;
1192
+ currency?: components["schemas"]["Currency"];
1193
+ /**
1194
+ * @description Buy one of the top-up bundles from `/offers` instead of an arbitrary amount. When given,
1195
+ * `amount` is ignored: the bundle says what is charged and how much credit it grants.
1196
+ *
1197
+ * How much credit arrives is decided when the money does, not now — and only if the amount
1198
+ * collected matches what the bundle costs. A bundle whose places ran out, or whose window
1199
+ * closed, in between still grants what was paid for; it just does not grant the bonus.
1200
+ */
1201
+ offer_key?: string;
1202
+ };
1203
+ /**
1204
+ * @description The three numbers a billing page needs, which are not the same number.
1205
+ *
1206
+ * `balance` answers "can I start another one" and is floored at zero, so it cannot express
1207
+ * being past zero. `unsettled` is what the current period has run up. `available` is the
1208
+ * difference between the two and **may be negative**.
1209
+ *
1210
+ * Reporting only the first would make an account that has overspent indistinguishable from one
1211
+ * that spent exactly what it had, and those two call for different actions.
1212
+ */
1213
+ Balance: {
1214
+ currency: components["schemas"]["Currency"];
1215
+ /**
1216
+ * @description What is spendable right now, with usage reported but not yet settled already subtracted.
1217
+ * Never negative — it is floored at zero, so it answers "can I start another machine" but
1218
+ * not "how much do I owe". A decimal string; `"0"` when the account has never been topped up
1219
+ */
1220
+ balance: string;
1221
+ /** @description The amount booked to the ledger, before this period's usage is taken off */
1222
+ cash: string;
1223
+ /**
1224
+ * @description What this period has run up and not yet been billed for. It keeps growing past the cash
1225
+ * balance, which is precisely the case the live figure cannot show
1226
+ */
1227
+ unsettled: string;
1228
+ /**
1229
+ * @description `cash` minus `unsettled`. **Negative means already in arrears**, and being able to say that
1230
+ * is the whole reason this field exists — the positive range is already covered by `balance`
1231
+ */
1232
+ available: string;
1233
+ };
1234
+ /** @description Which account pays for which project, as it stands once the request has been applied */
1235
+ ProjectBinding: {
1236
+ account_key: string;
1237
+ /** Format: uuid */
1238
+ project_id: string;
1239
+ };
1240
+ StartTopUpRequestBody: {
1241
+ /**
1242
+ * @description How much to add, as a decimal string — `"20"`, `"19.99"`.
1243
+ *
1244
+ * **Anything below one cent is rejected rather than rounded.** Rounding up overcharges and
1245
+ * rounding down undercharges; both alter the amount somewhere the payer cannot see it, and
1246
+ * this is the one number on this API where being wrong means money is wrong.
1247
+ */
1248
+ amount: string;
1249
+ currency?: components["schemas"]["Currency"];
1250
+ /**
1251
+ * @description Buy one of the top-up bundles from `/offers` instead of an arbitrary amount. When given,
1252
+ * `amount` is ignored: the bundle says what is charged and how much credit it grants.
1253
+ *
1254
+ * How much credit arrives is decided when the money does, not now — and only if the amount
1255
+ * collected matches what the bundle costs. A bundle whose places ran out, or whose window
1256
+ * closed, in between still grants what was paid for; it just does not grant the bonus.
1257
+ */
1258
+ offer_key?: string;
1259
+ };
1260
+ PaymentMethodSetupSession: {
1261
+ /**
1262
+ * Format: uri
1263
+ * @description Send the browser here. It expires, so do not store it
1264
+ */
1265
+ url: string;
1266
+ };
1267
+ BillingPortalSession: {
1268
+ /**
1269
+ * Format: uri
1270
+ * @description Send the browser here. It expires, so do not store it
1271
+ */
1272
+ url: string;
1273
+ };
1274
+ /**
1275
+ * @description Whether money can be collected from this account later, without the account holder present.
1276
+ *
1277
+ * Deliberately not called a card: a card is one kind of payment method, and direct debit and
1278
+ * the recurring mandates offered by regional wallets occupy the same slot.
1279
+ */
1280
+ PaymentMethod: {
1281
+ /**
1282
+ * @description True when the billing engine holds a default payment method for this account and can
1283
+ * therefore collect an invoice.
1284
+ *
1285
+ * This is the precondition for a paid plan. While it is false, starting a paid
1286
+ * subscription is refused, and the refusal is about billing setup rather than about the
1287
+ * plan — so check this first and say what is actually missing.
1288
+ *
1289
+ * It says nothing about which kind is on file. To show or change that, send the account
1290
+ * holder to the billing portal.
1291
+ *
1292
+ * A free plan does not require it, which is what allows a new account to be placed on the
1293
+ * default tier before anyone has entered a card.
1294
+ */
1295
+ ready: boolean;
1296
+ };
1297
+ TopUpSession: {
1298
+ /**
1299
+ * @description Identifies this attempt. Quote it in a support conversation — it is what ties the payment
1300
+ * provider's record to the credit that was granted
1301
+ */
1302
+ payment_id: string;
1303
+ /**
1304
+ * Format: uri
1305
+ * @description Send the browser here. It expires, so do not store it
1306
+ */
1307
+ url: string;
1308
+ };
1309
+ /** @description One thing this period has been charged for */
1310
+ Charge: {
1311
+ id: string;
1312
+ name: string;
1313
+ /**
1314
+ * @description Decimal string, the real-time figure. The booked figure would show a machine that only
1315
+ * just started as zero
1316
+ */
1317
+ total: string;
1318
+ };
1319
+ ChargeList: {
1320
+ currency: components["schemas"]["Currency"];
1321
+ charges: components["schemas"]["Charge"][];
1322
+ /** @description The sum, which is the same number as `unsettled` on the balance */
1323
+ total: string;
1324
+ };
1325
+ /** @enum {string} */
1326
+ InvoiceStatus: "draft" | "issuing" | "issued" | "payment_processing" | "overdue" | "paid" | "uncollectible" | "voided";
1327
+ Invoice: {
1328
+ id: string;
1329
+ number?: string;
1330
+ status: components["schemas"]["InvoiceStatus"];
1331
+ currency: components["schemas"]["Currency"];
1332
+ total: string;
1333
+ /** Format: date-time */
1334
+ due_at?: string;
1335
+ /** Format: date-time */
1336
+ issued_at?: string;
1337
+ /** Format: date-time */
1338
+ created_at: string;
1339
+ };
1340
+ InvoiceList: {
1341
+ invoices: components["schemas"]["Invoice"][];
1342
+ };
1343
+ InvoiceLine: {
1344
+ name: string;
1345
+ description?: string;
1346
+ /**
1347
+ * Format: date-time
1348
+ * @description Required. Lines of the same name repeat many times on one invoice — hundreds on an hourly
1349
+ * bill — and without the period they cannot be told apart
1350
+ */
1351
+ period_from: string;
1352
+ /** Format: date-time */
1353
+ period_to: string;
1354
+ /** @description Before discounts and credit */
1355
+ amount: string;
1356
+ discounts_total?: string;
1357
+ /** @description How much of this line credit covered */
1358
+ credits_total?: string;
1359
+ total: string;
1360
+ };
1361
+ InvoiceDetail: {
1362
+ id: string;
1363
+ number?: string;
1364
+ status: components["schemas"]["InvoiceStatus"];
1365
+ currency: components["schemas"]["Currency"];
1366
+ total: string;
1367
+ charges_total?: string;
1368
+ discounts_total?: string;
1369
+ credits_total?: string;
1370
+ taxes_total?: string;
1371
+ /** Format: date-time */
1372
+ period_from?: string;
1373
+ /** Format: date-time */
1374
+ period_to?: string;
1375
+ /** Format: date-time */
1376
+ due_at?: string;
1377
+ /** Format: date-time */
1378
+ issued_at?: string;
1379
+ /** Format: date-time */
1380
+ created_at: string;
1381
+ lines: components["schemas"]["InvoiceLine"][];
1382
+ };
1383
+ Subscription: {
1384
+ id: string;
1385
+ plan_key: string;
1386
+ plan_version?: number;
1387
+ /**
1388
+ * @description `canceled` still counts as being on a plan — it is serving until the end of the period,
1389
+ * which has already been paid for
1390
+ */
1391
+ status: string;
1392
+ };
1393
+ TopUpStatus: {
1394
+ payment_id: string;
1395
+ /**
1396
+ * @description `settled` means the credit has landed. `pending` means it has not yet — the payment is
1397
+ * still being confirmed, or the money itself is still in transit
1398
+ * @enum {string}
1399
+ */
1400
+ state: "settled" | "pending";
1401
+ /** @description The credit that was issued, present once settled */
1402
+ amount?: string;
1403
+ currency?: components["schemas"]["Currency"];
1404
+ };
1405
+ /**
1406
+ * @description ISO 4217, uppercase. `USD` is the only value the platform issues today, and a request
1407
+ * naming any other is refused with `BILLING_CURRENCY_UNSUPPORTED`.
1408
+ *
1409
+ * Deliberately not an enumeration. The set of currency codes is governed outside this API, so
1410
+ * a client generated today must still be able to read a response naming a code added later —
1411
+ * an enumeration turns that response into a decode failure in a client nobody can redeploy.
1412
+ * Restricting what may be *sent* is a rule about what the platform supports, and it lives
1413
+ * where that rule can change without regenerating anything.
1414
+ */
1415
+ Currency: string;
1416
+ };
1417
+ responses: never;
1418
+ parameters: {
1419
+ /** @description Which asset, from the prepaid list */
1420
+ ProvisionId: string;
1421
+ /**
1422
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1423
+ * which is why the key is what addresses the account.
1424
+ */
1425
+ AccountKey: string;
1426
+ };
1427
+ requestBodies: never;
1428
+ headers: never;
1429
+ pathItems: never;
1430
+ }
1431
+ export type $defs = Record<string, never>;
1432
+ export interface operations {
1433
+ "list-billing-accounts": {
1434
+ parameters: {
1435
+ query?: never;
1436
+ header?: never;
1437
+ path?: never;
1438
+ cookie?: never;
1439
+ };
1440
+ requestBody?: never;
1441
+ responses: {
1442
+ /** @description OK */
1443
+ 200: {
1444
+ headers: {
1445
+ [name: string]: unknown;
1446
+ };
1447
+ content: {
1448
+ "application/json": components["schemas"]["BillingAccountList"];
1449
+ };
1450
+ };
1451
+ /** @description Error */
1452
+ default: {
1453
+ headers: {
1454
+ [name: string]: unknown;
1455
+ };
1456
+ content: {
1457
+ "application/json": components["schemas"]["Error"];
1458
+ };
1459
+ };
1460
+ };
1461
+ };
1462
+ "create-billing-account": {
1463
+ parameters: {
1464
+ query?: never;
1465
+ header?: never;
1466
+ path?: never;
1467
+ cookie?: never;
1468
+ };
1469
+ requestBody: {
1470
+ content: {
1471
+ "application/json": components["schemas"]["CreateBillingAccountRequestBody"];
1472
+ };
1473
+ };
1474
+ responses: {
1475
+ /** @description OK */
1476
+ 200: {
1477
+ headers: {
1478
+ [name: string]: unknown;
1479
+ };
1480
+ content: {
1481
+ "application/json": components["schemas"]["BillingAccount"];
1482
+ };
1483
+ };
1484
+ /** @description Error */
1485
+ default: {
1486
+ headers: {
1487
+ [name: string]: unknown;
1488
+ };
1489
+ content: {
1490
+ "application/json": components["schemas"]["Error"];
1491
+ };
1492
+ };
1493
+ };
1494
+ };
1495
+ "get-billing-account": {
1496
+ parameters: {
1497
+ query?: never;
1498
+ header?: never;
1499
+ path: {
1500
+ /**
1501
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1502
+ * which is why the key is what addresses the account.
1503
+ */
1504
+ accountKey: components["parameters"]["AccountKey"];
1505
+ };
1506
+ cookie?: never;
1507
+ };
1508
+ requestBody?: never;
1509
+ responses: {
1510
+ /** @description OK */
1511
+ 200: {
1512
+ headers: {
1513
+ [name: string]: unknown;
1514
+ };
1515
+ content: {
1516
+ "application/json": components["schemas"]["BillingAccount"];
1517
+ };
1518
+ };
1519
+ /** @description Error */
1520
+ default: {
1521
+ headers: {
1522
+ [name: string]: unknown;
1523
+ };
1524
+ content: {
1525
+ "application/json": components["schemas"]["Error"];
1526
+ };
1527
+ };
1528
+ };
1529
+ };
1530
+ "update-billing-account": {
1531
+ parameters: {
1532
+ query?: never;
1533
+ header?: never;
1534
+ path: {
1535
+ /**
1536
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1537
+ * which is why the key is what addresses the account.
1538
+ */
1539
+ accountKey: components["parameters"]["AccountKey"];
1540
+ };
1541
+ cookie?: never;
1542
+ };
1543
+ requestBody: {
1544
+ content: {
1545
+ "application/json": components["schemas"]["UpdateBillingAccountRequestBody"];
1546
+ };
1547
+ };
1548
+ responses: {
1549
+ /** @description OK */
1550
+ 200: {
1551
+ headers: {
1552
+ [name: string]: unknown;
1553
+ };
1554
+ content: {
1555
+ "application/json": components["schemas"]["BillingAccount"];
1556
+ };
1557
+ };
1558
+ /** @description Error */
1559
+ default: {
1560
+ headers: {
1561
+ [name: string]: unknown;
1562
+ };
1563
+ content: {
1564
+ "application/json": components["schemas"]["Error"];
1565
+ };
1566
+ };
1567
+ };
1568
+ };
1569
+ "list-credit-transactions": {
1570
+ parameters: {
1571
+ query?: never;
1572
+ header?: never;
1573
+ path: {
1574
+ /**
1575
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1576
+ * which is why the key is what addresses the account.
1577
+ */
1578
+ accountKey: components["parameters"]["AccountKey"];
1579
+ };
1580
+ cookie?: never;
1581
+ };
1582
+ requestBody?: never;
1583
+ responses: {
1584
+ /** @description OK */
1585
+ 200: {
1586
+ headers: {
1587
+ [name: string]: unknown;
1588
+ };
1589
+ content: {
1590
+ "application/json": components["schemas"]["CreditTransactionList"];
1591
+ };
1592
+ };
1593
+ /** @description Error */
1594
+ default: {
1595
+ headers: {
1596
+ [name: string]: unknown;
1597
+ };
1598
+ content: {
1599
+ "application/json": components["schemas"]["Error"];
1600
+ };
1601
+ };
1602
+ };
1603
+ };
1604
+ "read-billing-account-balance": {
1605
+ parameters: {
1606
+ query?: never;
1607
+ header?: never;
1608
+ path: {
1609
+ /**
1610
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1611
+ * which is why the key is what addresses the account.
1612
+ */
1613
+ accountKey: components["parameters"]["AccountKey"];
1614
+ };
1615
+ cookie?: never;
1616
+ };
1617
+ requestBody?: never;
1618
+ responses: {
1619
+ /** @description OK */
1620
+ 200: {
1621
+ headers: {
1622
+ [name: string]: unknown;
1623
+ };
1624
+ content: {
1625
+ "application/json": components["schemas"]["Balance"];
1626
+ };
1627
+ };
1628
+ /** @description Error */
1629
+ default: {
1630
+ headers: {
1631
+ [name: string]: unknown;
1632
+ };
1633
+ content: {
1634
+ "application/json": components["schemas"]["Error"];
1635
+ };
1636
+ };
1637
+ };
1638
+ };
1639
+ "bind-project-to-billing-account": {
1640
+ parameters: {
1641
+ query?: never;
1642
+ header?: never;
1643
+ path: {
1644
+ /**
1645
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1646
+ * which is why the key is what addresses the account.
1647
+ */
1648
+ accountKey: components["parameters"]["AccountKey"];
1649
+ /** @description The project this account should pay for */
1650
+ projectId: string;
1651
+ };
1652
+ cookie?: never;
1653
+ };
1654
+ requestBody?: never;
1655
+ responses: {
1656
+ /** @description OK */
1657
+ 200: {
1658
+ headers: {
1659
+ [name: string]: unknown;
1660
+ };
1661
+ content: {
1662
+ "application/json": components["schemas"]["ProjectBinding"];
1663
+ };
1664
+ };
1665
+ /** @description Error */
1666
+ default: {
1667
+ headers: {
1668
+ [name: string]: unknown;
1669
+ };
1670
+ content: {
1671
+ "application/json": components["schemas"]["Error"];
1672
+ };
1673
+ };
1674
+ };
1675
+ };
1676
+ "unbind-project-from-billing-account": {
1677
+ parameters: {
1678
+ query?: never;
1679
+ header?: never;
1680
+ path: {
1681
+ /**
1682
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1683
+ * which is why the key is what addresses the account.
1684
+ */
1685
+ accountKey: components["parameters"]["AccountKey"];
1686
+ /** @description The project to stop paying for */
1687
+ projectId: string;
1688
+ };
1689
+ cookie?: never;
1690
+ };
1691
+ requestBody?: never;
1692
+ responses: {
1693
+ /** @description Unbound */
1694
+ 204: {
1695
+ headers: {
1696
+ [name: string]: unknown;
1697
+ };
1698
+ content?: never;
1699
+ };
1700
+ /** @description Error */
1701
+ default: {
1702
+ headers: {
1703
+ [name: string]: unknown;
1704
+ };
1705
+ content: {
1706
+ "application/json": components["schemas"]["Error"];
1707
+ };
1708
+ };
1709
+ };
1710
+ };
1711
+ "list-orders": {
1712
+ parameters: {
1713
+ query?: never;
1714
+ header?: never;
1715
+ path: {
1716
+ /**
1717
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1718
+ * which is why the key is what addresses the account.
1719
+ */
1720
+ accountKey: components["parameters"]["AccountKey"];
1721
+ };
1722
+ cookie?: never;
1723
+ };
1724
+ requestBody?: never;
1725
+ responses: {
1726
+ /** @description OK */
1727
+ 200: {
1728
+ headers: {
1729
+ [name: string]: unknown;
1730
+ };
1731
+ content: {
1732
+ "application/json": components["schemas"]["OrderList"];
1733
+ };
1734
+ };
1735
+ /** @description Error */
1736
+ default: {
1737
+ headers: {
1738
+ [name: string]: unknown;
1739
+ };
1740
+ content: {
1741
+ "application/json": components["schemas"]["Error"];
1742
+ };
1743
+ };
1744
+ };
1745
+ };
1746
+ "get-order": {
1747
+ parameters: {
1748
+ query?: never;
1749
+ header?: never;
1750
+ path: {
1751
+ /**
1752
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1753
+ * which is why the key is what addresses the account.
1754
+ */
1755
+ accountKey: components["parameters"]["AccountKey"];
1756
+ orderId: string;
1757
+ };
1758
+ cookie?: never;
1759
+ };
1760
+ requestBody?: never;
1761
+ responses: {
1762
+ /** @description OK */
1763
+ 200: {
1764
+ headers: {
1765
+ [name: string]: unknown;
1766
+ };
1767
+ content: {
1768
+ "application/json": components["schemas"]["Order"];
1769
+ };
1770
+ };
1771
+ /** @description Error */
1772
+ default: {
1773
+ headers: {
1774
+ [name: string]: unknown;
1775
+ };
1776
+ content: {
1777
+ "application/json": components["schemas"]["Error"];
1778
+ };
1779
+ };
1780
+ };
1781
+ };
1782
+ "list-top-ups": {
1783
+ parameters: {
1784
+ query?: never;
1785
+ header?: never;
1786
+ path: {
1787
+ /**
1788
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1789
+ * which is why the key is what addresses the account.
1790
+ */
1791
+ accountKey: components["parameters"]["AccountKey"];
1792
+ };
1793
+ cookie?: never;
1794
+ };
1795
+ requestBody?: never;
1796
+ responses: {
1797
+ /** @description OK */
1798
+ 200: {
1799
+ headers: {
1800
+ [name: string]: unknown;
1801
+ };
1802
+ content: {
1803
+ "application/json": components["schemas"]["TopUpList"];
1804
+ };
1805
+ };
1806
+ /** @description Error */
1807
+ default: {
1808
+ headers: {
1809
+ [name: string]: unknown;
1810
+ };
1811
+ content: {
1812
+ "application/json": components["schemas"]["Error"];
1813
+ };
1814
+ };
1815
+ };
1816
+ };
1817
+ "start-top-up": {
1818
+ parameters: {
1819
+ query?: never;
1820
+ header?: never;
1821
+ path: {
1822
+ /**
1823
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1824
+ * which is why the key is what addresses the account.
1825
+ */
1826
+ accountKey: components["parameters"]["AccountKey"];
1827
+ };
1828
+ cookie?: never;
1829
+ };
1830
+ requestBody: {
1831
+ content: {
1832
+ "application/json": components["schemas"]["StartTopUpRequestBody"];
1833
+ };
1834
+ };
1835
+ responses: {
1836
+ /** @description OK */
1837
+ 200: {
1838
+ headers: {
1839
+ [name: string]: unknown;
1840
+ };
1841
+ content: {
1842
+ "application/json": components["schemas"]["TopUpSession"];
1843
+ };
1844
+ };
1845
+ /** @description Error */
1846
+ default: {
1847
+ headers: {
1848
+ [name: string]: unknown;
1849
+ };
1850
+ content: {
1851
+ "application/json": components["schemas"]["Error"];
1852
+ };
1853
+ };
1854
+ };
1855
+ };
1856
+ "list-charges": {
1857
+ parameters: {
1858
+ query?: never;
1859
+ header?: never;
1860
+ path: {
1861
+ /**
1862
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1863
+ * which is why the key is what addresses the account.
1864
+ */
1865
+ accountKey: components["parameters"]["AccountKey"];
1866
+ };
1867
+ cookie?: never;
1868
+ };
1869
+ requestBody?: never;
1870
+ responses: {
1871
+ /** @description OK */
1872
+ 200: {
1873
+ headers: {
1874
+ [name: string]: unknown;
1875
+ };
1876
+ content: {
1877
+ "application/json": components["schemas"]["ChargeList"];
1878
+ };
1879
+ };
1880
+ /** @description Error */
1881
+ default: {
1882
+ headers: {
1883
+ [name: string]: unknown;
1884
+ };
1885
+ content: {
1886
+ "application/json": components["schemas"]["Error"];
1887
+ };
1888
+ };
1889
+ };
1890
+ };
1891
+ "list-invoices": {
1892
+ parameters: {
1893
+ query?: never;
1894
+ header?: never;
1895
+ path: {
1896
+ /**
1897
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1898
+ * which is why the key is what addresses the account.
1899
+ */
1900
+ accountKey: components["parameters"]["AccountKey"];
1901
+ };
1902
+ cookie?: never;
1903
+ };
1904
+ requestBody?: never;
1905
+ responses: {
1906
+ /** @description OK */
1907
+ 200: {
1908
+ headers: {
1909
+ [name: string]: unknown;
1910
+ };
1911
+ content: {
1912
+ "application/json": components["schemas"]["InvoiceList"];
1913
+ };
1914
+ };
1915
+ /** @description Error */
1916
+ default: {
1917
+ headers: {
1918
+ [name: string]: unknown;
1919
+ };
1920
+ content: {
1921
+ "application/json": components["schemas"]["Error"];
1922
+ };
1923
+ };
1924
+ };
1925
+ };
1926
+ "get-invoice": {
1927
+ parameters: {
1928
+ query?: never;
1929
+ header?: never;
1930
+ path: {
1931
+ /**
1932
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1933
+ * which is why the key is what addresses the account.
1934
+ */
1935
+ accountKey: components["parameters"]["AccountKey"];
1936
+ invoiceId: string;
1937
+ };
1938
+ cookie?: never;
1939
+ };
1940
+ requestBody?: never;
1941
+ responses: {
1942
+ /** @description OK */
1943
+ 200: {
1944
+ headers: {
1945
+ [name: string]: unknown;
1946
+ };
1947
+ content: {
1948
+ "application/json": components["schemas"]["InvoiceDetail"];
1949
+ };
1950
+ };
1951
+ /** @description Error */
1952
+ default: {
1953
+ headers: {
1954
+ [name: string]: unknown;
1955
+ };
1956
+ content: {
1957
+ "application/json": components["schemas"]["Error"];
1958
+ };
1959
+ };
1960
+ };
1961
+ };
1962
+ "quote-project-usage": {
1963
+ parameters: {
1964
+ query?: never;
1965
+ header?: never;
1966
+ path: {
1967
+ projectId: string;
1968
+ };
1969
+ cookie?: never;
1970
+ };
1971
+ requestBody: {
1972
+ content: {
1973
+ "application/json": components["schemas"]["QuoteRequest"];
1974
+ };
1975
+ };
1976
+ responses: {
1977
+ /** @description OK */
1978
+ 200: {
1979
+ headers: {
1980
+ [name: string]: unknown;
1981
+ };
1982
+ content: {
1983
+ "application/json": components["schemas"]["Quote"];
1984
+ };
1985
+ };
1986
+ /** @description Error */
1987
+ default: {
1988
+ headers: {
1989
+ [name: string]: unknown;
1990
+ };
1991
+ content: {
1992
+ "application/json": components["schemas"]["Error"];
1993
+ };
1994
+ };
1995
+ };
1996
+ };
1997
+ "quote-usage": {
1998
+ parameters: {
1999
+ query?: never;
2000
+ header?: never;
2001
+ path: {
2002
+ /**
2003
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2004
+ * which is why the key is what addresses the account.
2005
+ */
2006
+ accountKey: components["parameters"]["AccountKey"];
2007
+ };
2008
+ cookie?: never;
2009
+ };
2010
+ requestBody: {
2011
+ content: {
2012
+ "application/json": components["schemas"]["QuoteRequest"];
2013
+ };
2014
+ };
2015
+ responses: {
2016
+ /** @description OK */
2017
+ 200: {
2018
+ headers: {
2019
+ [name: string]: unknown;
2020
+ };
2021
+ content: {
2022
+ "application/json": components["schemas"]["Quote"];
2023
+ };
2024
+ };
2025
+ /** @description Error */
2026
+ default: {
2027
+ headers: {
2028
+ [name: string]: unknown;
2029
+ };
2030
+ content: {
2031
+ "application/json": components["schemas"]["Error"];
2032
+ };
2033
+ };
2034
+ };
2035
+ };
2036
+ "read-subscription": {
2037
+ parameters: {
2038
+ query?: never;
2039
+ header?: never;
2040
+ path: {
2041
+ /**
2042
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2043
+ * which is why the key is what addresses the account.
2044
+ */
2045
+ accountKey: components["parameters"]["AccountKey"];
2046
+ };
2047
+ cookie?: never;
2048
+ };
2049
+ requestBody?: never;
2050
+ responses: {
2051
+ /** @description OK */
2052
+ 200: {
2053
+ headers: {
2054
+ [name: string]: unknown;
2055
+ };
2056
+ content: {
2057
+ "application/json": components["schemas"]["Subscription"];
2058
+ };
2059
+ };
2060
+ /** @description Error */
2061
+ default: {
2062
+ headers: {
2063
+ [name: string]: unknown;
2064
+ };
2065
+ content: {
2066
+ "application/json": components["schemas"]["Error"];
2067
+ };
2068
+ };
2069
+ };
2070
+ };
2071
+ "cancel-subscription": {
2072
+ parameters: {
2073
+ query: {
2074
+ /** @description When it takes effect */
2075
+ timing: "immediate" | "next_billing_cycle";
2076
+ };
2077
+ header?: never;
2078
+ path: {
2079
+ /**
2080
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2081
+ * which is why the key is what addresses the account.
2082
+ */
2083
+ accountKey: components["parameters"]["AccountKey"];
2084
+ };
2085
+ cookie?: never;
2086
+ };
2087
+ requestBody?: never;
2088
+ responses: {
2089
+ /** @description OK */
2090
+ 200: {
2091
+ headers: {
2092
+ [name: string]: unknown;
2093
+ };
2094
+ content: {
2095
+ "application/json": components["schemas"]["Subscription"];
2096
+ };
2097
+ };
2098
+ /** @description Error */
2099
+ default: {
2100
+ headers: {
2101
+ [name: string]: unknown;
2102
+ };
2103
+ content: {
2104
+ "application/json": components["schemas"]["Error"];
2105
+ };
2106
+ };
2107
+ };
2108
+ };
2109
+ "read-top-up": {
2110
+ parameters: {
2111
+ query?: never;
2112
+ header?: never;
2113
+ path: {
2114
+ /**
2115
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2116
+ * which is why the key is what addresses the account.
2117
+ */
2118
+ accountKey: components["parameters"]["AccountKey"];
2119
+ /** @description The payment id returned when the top-up was started */
2120
+ paymentId: string;
2121
+ };
2122
+ cookie?: never;
2123
+ };
2124
+ requestBody?: never;
2125
+ responses: {
2126
+ /** @description OK */
2127
+ 200: {
2128
+ headers: {
2129
+ [name: string]: unknown;
2130
+ };
2131
+ content: {
2132
+ "application/json": components["schemas"]["TopUpStatus"];
2133
+ };
2134
+ };
2135
+ /** @description Error */
2136
+ default: {
2137
+ headers: {
2138
+ [name: string]: unknown;
2139
+ };
2140
+ content: {
2141
+ "application/json": components["schemas"]["Error"];
2142
+ };
2143
+ };
2144
+ };
2145
+ };
2146
+ "read-payment-method": {
2147
+ parameters: {
2148
+ query?: never;
2149
+ header?: never;
2150
+ path: {
2151
+ /**
2152
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2153
+ * which is why the key is what addresses the account.
2154
+ */
2155
+ accountKey: components["parameters"]["AccountKey"];
2156
+ };
2157
+ cookie?: never;
2158
+ };
2159
+ requestBody?: never;
2160
+ responses: {
2161
+ /** @description OK */
2162
+ 200: {
2163
+ headers: {
2164
+ [name: string]: unknown;
2165
+ };
2166
+ content: {
2167
+ "application/json": components["schemas"]["PaymentMethod"];
2168
+ };
2169
+ };
2170
+ /** @description Error */
2171
+ default: {
2172
+ headers: {
2173
+ [name: string]: unknown;
2174
+ };
2175
+ content: {
2176
+ "application/json": components["schemas"]["Error"];
2177
+ };
2178
+ };
2179
+ };
2180
+ };
2181
+ "start-payment-method-setup": {
2182
+ parameters: {
2183
+ query?: never;
2184
+ header?: never;
2185
+ path: {
2186
+ /**
2187
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2188
+ * which is why the key is what addresses the account.
2189
+ */
2190
+ accountKey: components["parameters"]["AccountKey"];
2191
+ };
2192
+ cookie?: never;
2193
+ };
2194
+ requestBody?: never;
2195
+ responses: {
2196
+ /** @description OK */
2197
+ 200: {
2198
+ headers: {
2199
+ [name: string]: unknown;
2200
+ };
2201
+ content: {
2202
+ "application/json": components["schemas"]["PaymentMethodSetupSession"];
2203
+ };
2204
+ };
2205
+ /** @description Error */
2206
+ default: {
2207
+ headers: {
2208
+ [name: string]: unknown;
2209
+ };
2210
+ content: {
2211
+ "application/json": components["schemas"]["Error"];
2212
+ };
2213
+ };
2214
+ };
2215
+ };
2216
+ "start-billing-portal": {
2217
+ parameters: {
2218
+ query?: never;
2219
+ header?: never;
2220
+ path: {
2221
+ /**
2222
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2223
+ * which is why the key is what addresses the account.
2224
+ */
2225
+ accountKey: components["parameters"]["AccountKey"];
2226
+ };
2227
+ cookie?: never;
2228
+ };
2229
+ requestBody?: never;
2230
+ responses: {
2231
+ /** @description OK */
2232
+ 200: {
2233
+ headers: {
2234
+ [name: string]: unknown;
2235
+ };
2236
+ content: {
2237
+ "application/json": components["schemas"]["BillingPortalSession"];
2238
+ };
2239
+ };
2240
+ /** @description Error */
2241
+ default: {
2242
+ headers: {
2243
+ [name: string]: unknown;
2244
+ };
2245
+ content: {
2246
+ "application/json": components["schemas"]["Error"];
2247
+ };
2248
+ };
2249
+ };
2250
+ };
2251
+ "list-offers": {
2252
+ parameters: {
2253
+ query?: never;
2254
+ header?: never;
2255
+ path: {
2256
+ /**
2257
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2258
+ * which is why the key is what addresses the account.
2259
+ */
2260
+ accountKey: components["parameters"]["AccountKey"];
2261
+ };
2262
+ cookie?: never;
2263
+ };
2264
+ requestBody?: never;
2265
+ responses: {
2266
+ /** @description OK */
2267
+ 200: {
2268
+ headers: {
2269
+ [name: string]: unknown;
2270
+ };
2271
+ content: {
2272
+ "application/json": components["schemas"]["OfferList"];
2273
+ };
2274
+ };
2275
+ /** @description Error */
2276
+ default: {
2277
+ headers: {
2278
+ [name: string]: unknown;
2279
+ };
2280
+ content: {
2281
+ "application/json": components["schemas"]["Error"];
2282
+ };
2283
+ };
2284
+ };
2285
+ };
2286
+ "purchase-offer": {
2287
+ parameters: {
2288
+ query?: {
2289
+ /** @description When the switch takes effect. Required if the account already has a plan, ignored otherwise */
2290
+ timing?: components["schemas"]["PlanChangeTiming"];
2291
+ };
2292
+ header?: never;
2293
+ path: {
2294
+ /**
2295
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2296
+ * which is why the key is what addresses the account.
2297
+ */
2298
+ accountKey: components["parameters"]["AccountKey"];
2299
+ /** @description Which offer */
2300
+ offerKey: string;
2301
+ };
2302
+ cookie?: never;
2303
+ };
2304
+ requestBody?: never;
2305
+ responses: {
2306
+ /** @description OK */
2307
+ 200: {
2308
+ headers: {
2309
+ [name: string]: unknown;
2310
+ };
2311
+ content: {
2312
+ "application/json": components["schemas"]["Purchase"];
2313
+ };
2314
+ };
2315
+ /** @description Error */
2316
+ default: {
2317
+ headers: {
2318
+ [name: string]: unknown;
2319
+ };
2320
+ content: {
2321
+ "application/json": components["schemas"]["Error"];
2322
+ };
2323
+ };
2324
+ };
2325
+ };
2326
+ "list-prepaid-assets": {
2327
+ parameters: {
2328
+ query?: never;
2329
+ header?: never;
2330
+ path: {
2331
+ /**
2332
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2333
+ * which is why the key is what addresses the account.
2334
+ */
2335
+ accountKey: components["parameters"]["AccountKey"];
2336
+ };
2337
+ cookie?: never;
2338
+ };
2339
+ requestBody?: never;
2340
+ responses: {
2341
+ /** @description OK */
2342
+ 200: {
2343
+ headers: {
2344
+ [name: string]: unknown;
2345
+ };
2346
+ content: {
2347
+ "application/json": components["schemas"]["PrepaidAssetList"];
2348
+ };
2349
+ };
2350
+ /** @description Error */
2351
+ default: {
2352
+ headers: {
2353
+ [name: string]: unknown;
2354
+ };
2355
+ content: {
2356
+ "application/json": components["schemas"]["Error"];
2357
+ };
2358
+ };
2359
+ };
2360
+ };
2361
+ "quote-renewal": {
2362
+ parameters: {
2363
+ query: {
2364
+ /**
2365
+ * @description How long to renew for, as an ISO 8601 duration (P1M, P1Y). A duration rather than a
2366
+ * number of months: months are not the same length.
2367
+ */
2368
+ term: string;
2369
+ };
2370
+ header?: never;
2371
+ path: {
2372
+ /**
2373
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2374
+ * which is why the key is what addresses the account.
2375
+ */
2376
+ accountKey: components["parameters"]["AccountKey"];
2377
+ /** @description Which asset, from the prepaid list */
2378
+ provisionId: components["parameters"]["ProvisionId"];
2379
+ };
2380
+ cookie?: never;
2381
+ };
2382
+ requestBody?: never;
2383
+ responses: {
2384
+ /** @description OK */
2385
+ 200: {
2386
+ headers: {
2387
+ [name: string]: unknown;
2388
+ };
2389
+ content: {
2390
+ "application/json": components["schemas"]["RenewalQuote"];
2391
+ };
2392
+ };
2393
+ /** @description Error */
2394
+ default: {
2395
+ headers: {
2396
+ [name: string]: unknown;
2397
+ };
2398
+ content: {
2399
+ "application/json": components["schemas"]["Error"];
2400
+ };
2401
+ };
2402
+ };
2403
+ };
2404
+ "renew-prepaid-asset": {
2405
+ parameters: {
2406
+ query?: never;
2407
+ header?: never;
2408
+ path: {
2409
+ /**
2410
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2411
+ * which is why the key is what addresses the account.
2412
+ */
2413
+ accountKey: components["parameters"]["AccountKey"];
2414
+ /** @description Which asset, from the prepaid list */
2415
+ provisionId: components["parameters"]["ProvisionId"];
2416
+ };
2417
+ cookie?: never;
2418
+ };
2419
+ requestBody: {
2420
+ content: {
2421
+ "application/json": components["schemas"]["RenewRequestBody"];
2422
+ };
2423
+ };
2424
+ responses: {
2425
+ /** @description OK */
2426
+ 200: {
2427
+ headers: {
2428
+ [name: string]: unknown;
2429
+ };
2430
+ content: {
2431
+ "application/json": components["schemas"]["Order"];
2432
+ };
2433
+ };
2434
+ /** @description Error */
2435
+ default: {
2436
+ headers: {
2437
+ [name: string]: unknown;
2438
+ };
2439
+ content: {
2440
+ "application/json": components["schemas"]["Error"];
2441
+ };
2442
+ };
2443
+ };
2444
+ };
2445
+ }