@leaflow/sdk 0.52.0 → 0.54.0

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.
@@ -123,6 +123,44 @@ export interface paths {
123
123
  patch?: never;
124
124
  trace?: never;
125
125
  };
126
+ "/account/v1/billing-accounts/{accountKey}/balance/movement": {
127
+ parameters: {
128
+ query?: never;
129
+ header?: never;
130
+ path?: never;
131
+ cookie?: never;
132
+ };
133
+ /**
134
+ * How the balance moved this month
135
+ * @description Opening balance, money in, money out, closing balance — for the current calendar month.
136
+ *
137
+ * **The four add up**: `closing = opening + income - spending`. That is the point of the
138
+ * endpoint. The balance alone answers "how much is left" and cannot answer "how did it get
139
+ * there", which is what somebody watching their balance shrink is actually asking. Four
140
+ * figures that add up can be checked by the holder; a single figure can only be taken on
141
+ * faith or queried with support.
142
+ *
143
+ * `closing` is computed from the other three rather than read separately. Reading the current
144
+ * balance for it would leave the equation off by whatever was booked between the two reads —
145
+ * and an equation that is off by a few cents is worse than no equation, because it puts the
146
+ * ledger itself in doubt.
147
+ *
148
+ * The window is the **calendar** month, not the engine's billing period. This is the month a
149
+ * person means when they say "this month"; the billing anchor is an internal recurrence that
150
+ * happens to line up.
151
+ *
152
+ * A month with no movement reports opening equal to closing and zero on both sides — not all
153
+ * zeroes, which would read as "your money is gone".
154
+ */
155
+ get: operations["read-billing-account-balance-movement"];
156
+ put?: never;
157
+ post?: never;
158
+ delete?: never;
159
+ options?: never;
160
+ head?: never;
161
+ patch?: never;
162
+ trace?: never;
163
+ };
126
164
  "/account/v1/billing-accounts/{accountKey}/projects/{projectId}": {
127
165
  parameters: {
128
166
  query?: never;
@@ -182,8 +220,8 @@ export interface paths {
182
220
  * look at in exactly the case someone wants to look: a resource was asked for, was not
183
221
  * delivered, and the question is what happened.
184
222
  *
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.
223
+ * Lines come with each order. A list showing only identifiers and amounts is a page nobody can
224
+ * read recognising one ("which of these was last week's machine") is why it gets opened.
187
225
  */
188
226
  get: operations["list-orders"];
189
227
  put?: never;
@@ -203,8 +241,8 @@ export interface paths {
203
241
  };
204
242
  /**
205
243
  * 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.
244
+ * @description Each line names what was asked for, how much of it, and what it produced. The list route
245
+ * carries lines too; this one exists for a permanent link to a single transaction.
208
246
  */
209
247
  get: operations["get-order"];
210
248
  put?: never;
@@ -538,6 +576,36 @@ export interface paths {
538
576
  patch?: never;
539
577
  trace?: never;
540
578
  };
579
+ "/account/v1/billing-accounts/{accountKey}/subscription/keep": {
580
+ parameters: {
581
+ query?: never;
582
+ header?: never;
583
+ path?: never;
584
+ cookie?: never;
585
+ };
586
+ get?: never;
587
+ put?: never;
588
+ /**
589
+ * Undo an end-of-period cancellation
590
+ * @description Takes back a cancellation that was set for the end of the period, so the plan carries on.
591
+ *
592
+ * **It only works on a cancellation, not on a scheduled downgrade.** Scheduling a change to
593
+ * another plan leaves a second, scheduled subscription holding the customer's one slot, and the
594
+ * engine offers no way to remove it: unscheduling is refused with a conflict and the scheduled
595
+ * subscription cannot be deleted over HTTP. So a downgrade becomes final the moment it is
596
+ * scheduled, and saying so up front is the only honest thing to do — this endpoint answers
597
+ * `BILLING_NO_SCHEDULED_CHANGE` rather than pretending to undo it.
598
+ *
599
+ * Without this, someone who cancels by accident has to wait out the period and buy the tier
600
+ * again, losing whatever the tier had accumulated.
601
+ */
602
+ post: operations["keep-subscription"];
603
+ delete?: never;
604
+ options?: never;
605
+ head?: never;
606
+ patch?: never;
607
+ trace?: never;
608
+ };
541
609
  "/account/v1/billing-accounts/{accountKey}/subscription/cancel": {
542
610
  parameters: {
543
611
  query?: never;
@@ -549,12 +617,13 @@ export interface paths {
549
617
  put?: never;
550
618
  /**
551
619
  * Come off the paid plan
552
- * @description Moves the account off whatever plan it is on.
620
+ * @description Takes the account off its paid plan and back to the free tier.
553
621
  *
554
- * Where a default plan is configured this is a switch to it rather than a cancellation an
555
- * account with no plan is refused admission, so cancelling outright would cut off someone who
556
- * only meant to drop back to the free tier. Without a default plan it is a real cancellation and
557
- * the account is left with no plan on purpose.
622
+ * Ending immediately lands on the free tier straight away. Ending at the end of the period is a
623
+ * plain cancellation that can still be undone (`subscription/keep`) it deliberately does not
624
+ * schedule a switch, because a scheduled switch holds the customer's one subscription slot and
625
+ * the engine gives no way to cancel it afterwards. The free tier is applied once the period
626
+ * actually ends, by the sweep that keeps every account on some plan.
558
627
  *
559
628
  * `timing` has to be stated. Ending immediately on an account that has already paid for the
560
629
  * current period takes back what they paid for; ending at the end of the period does not. There
@@ -796,16 +865,19 @@ export interface paths {
796
865
  * What I bought outright
797
866
  * @description Everything this account holds on a term, across every product.
798
867
  *
799
- * ## Nothing here expires on its own
868
+ * ## Every one of these expires
800
869
  *
801
- * A term renews for as long as the seat is held: the engine charges the next period, prorates
802
- * any change to the second, and stops the moment the seat is given up. So there is no renewal
803
- * to remember and no expiry to warn about giving it up means deleting the resource, in the
804
- * console that owns it.
870
+ * A term is paid for once, up front, and buys exactly the period named by `term`. Nothing
871
+ * renews it on its own: `expires_at` is when it runs out, and after that the machine is
872
+ * stopped and — once the retention window is over released.
805
873
  *
806
- * What the next period costs and when it falls due is on the charges route. That is read
807
- * straight from the engine rather than copied here, because a copy is a second answer that
808
- * drifts without saying so.
874
+ * This route used to say the opposite. It described an engine that charged the next period by
875
+ * itself for as long as the seat was held, which is how this worked before the money became a
876
+ * single up-front charge. Reading the old text, a customer would have had no reason to renew
877
+ * anything, and the first sign of trouble would have been a stopped machine.
878
+ *
879
+ * Turn on `auto_renew` to have billing place the renewal order itself while there is balance
880
+ * to pay for it. That is the only thing that makes a term continue.
809
881
  *
810
882
  * ## Metered resources are not here
811
883
  *
@@ -827,6 +899,137 @@ export interface paths {
827
899
  patch?: never;
828
900
  trace?: never;
829
901
  };
902
+ "/account/v1/billing-accounts/{accountKey}/prepaid-assets/{assetId}/renew": {
903
+ parameters: {
904
+ query?: never;
905
+ header?: never;
906
+ path?: never;
907
+ cookie?: never;
908
+ };
909
+ get?: never;
910
+ put?: never;
911
+ /**
912
+ * Buy another period
913
+ * @description Extends a term by one more period, paid for out of the account's balance right now.
914
+ *
915
+ * **The new expiry is the old one plus the term, not now plus the term.** Renewing three days
916
+ * early would otherwise throw those three days away, and renewing after the expiry would
917
+ * quietly reward the delay. Neither shows up as an error — the date on the account looks
918
+ * self-consistent either way, and only the customer notices.
919
+ *
920
+ * `term` does not have to match what was bought originally: a monthly machine can be renewed
921
+ * for a year.
922
+ *
923
+ * Refused when the balance does not cover it. The alternative — placing the order and letting
924
+ * the account go negative — turns a renewal the customer chose into a debt they did not.
925
+ */
926
+ post: operations["renew-prepaid-asset"];
927
+ delete?: never;
928
+ options?: never;
929
+ head?: never;
930
+ patch?: never;
931
+ trace?: never;
932
+ };
933
+ "/account/v1/billing-accounts/{accountKey}/prepaid-assets/{assetId}/auto-renew": {
934
+ parameters: {
935
+ query?: never;
936
+ header?: never;
937
+ path?: never;
938
+ cookie?: never;
939
+ };
940
+ get?: never;
941
+ /**
942
+ * Turn automatic renewal on or off
943
+ * @description With it on, billing places the renewal order itself a few days before the period runs out,
944
+ * paying from the account's balance.
945
+ *
946
+ * **Not enough balance is not an error here.** The switch only says what to attempt; whether
947
+ * the money is there is settled at renewal time, and the customer is told either way — told it
948
+ * renewed, or told it could not and by when it will expire.
949
+ */
950
+ put: operations["set-prepaid-auto-renew"];
951
+ post?: never;
952
+ delete?: never;
953
+ options?: never;
954
+ head?: never;
955
+ patch?: never;
956
+ trace?: never;
957
+ };
958
+ "/account/v1/billing-accounts/{accountKey}/promotion-codes/preview": {
959
+ parameters: {
960
+ query?: never;
961
+ header?: never;
962
+ path?: never;
963
+ cookie?: never;
964
+ };
965
+ get?: never;
966
+ put?: never;
967
+ /**
968
+ * See what a code takes off before committing
969
+ * @description Runs the same checks and the same arithmetic that placing the order will run, so the price
970
+ * shown here and the price charged agree. Writing the calculation twice — once for the page and
971
+ * once for the order — means they drift, and the visible form of that drift is a page saying
972
+ * "20 off" while the full amount is taken.
973
+ *
974
+ * Nothing is redeemed. The allowance is only consumed when the order is actually placed.
975
+ *
976
+ * A code that cannot be used is rejected here with the reason, so the user learns it before
977
+ * filling in the rest of the form rather than at the moment they press buy.
978
+ *
979
+ * **Metered orders are rejected.** They have no amount at this point — the money is worked out
980
+ * later from usage. Applying a discount to a nil amount leaves the user believing they saved
981
+ * something while the bill is unchanged.
982
+ */
983
+ post: operations["preview-promotion-code"];
984
+ delete?: never;
985
+ options?: never;
986
+ head?: never;
987
+ patch?: never;
988
+ trace?: never;
989
+ };
990
+ "/account/v1/billing-accounts/{accountKey}/vouchers": {
991
+ parameters: {
992
+ query?: never;
993
+ header?: never;
994
+ path?: never;
995
+ cookie?: never;
996
+ };
997
+ /**
998
+ * List this account's vouchers
999
+ * @description Credit received from campaigns, most recent first. Not the credit ledger — this says which
1000
+ * campaign each amount came from, which is the question "where did this 50 come from" that the
1001
+ * ledger cannot answer.
1002
+ */
1003
+ get: operations["list-account-vouchers"];
1004
+ put?: never;
1005
+ post?: never;
1006
+ delete?: never;
1007
+ options?: never;
1008
+ head?: never;
1009
+ patch?: never;
1010
+ trace?: never;
1011
+ };
1012
+ "/account/v1/billing-accounts/{accountKey}/refunds": {
1013
+ parameters: {
1014
+ query?: never;
1015
+ header?: never;
1016
+ path?: never;
1017
+ cookie?: never;
1018
+ };
1019
+ /**
1020
+ * List this account's refunds
1021
+ * @description Each refund carries how it was split. A customer asking "I was refunded 100, why is only 60
1022
+ * back on my card" is answered here and nowhere else.
1023
+ */
1024
+ get: operations["list-account-refunds"];
1025
+ put?: never;
1026
+ post?: never;
1027
+ delete?: never;
1028
+ options?: never;
1029
+ head?: never;
1030
+ patch?: never;
1031
+ trace?: never;
1032
+ };
830
1033
  }
831
1034
  export type webhooks = Record<string, never>;
832
1035
  export interface components {
@@ -912,13 +1115,35 @@ export interface components {
912
1115
  /** @description The sum of the already-rounded lines */
913
1116
  total: string;
914
1117
  /**
915
- * @description Keys that were given a usage but have no rate card on this plan.
1118
+ * @description The usages that have no rate card on this plan.
916
1119
  *
917
1120
  * **Reported rather than ignored**, because ignoring them yields a smaller but entirely
918
1121
  * normal-looking number — and that is the most expensive misconfiguration there is: usage
919
- * lands, the usage chart shows it, and the bill has no line for it
1122
+ * lands, the usage chart shows it, and the bill has no line for it.
1123
+ *
1124
+ * ## Each entry carries the caller's own naming, not only the key
1125
+ *
1126
+ * A meter key is a hash, and callers are told not to compute it (see `QuoteUsage`). An answer
1127
+ * that named the unpriced usages by key alone was therefore unusable whenever more than one
1128
+ * usage was priced at a time: the caller could see that something was unsold but not which of
1129
+ * the things it asked about. That is the case a catalogue page needs — pricing thirty machine
1130
+ * types in one call and marking the ones this plan does not sell — so the answer echoes the
1131
+ * `service` and `product_id` that were given
920
1132
  */
921
- unpriced?: string[];
1133
+ unpriced?: components["schemas"]["UnpricedUsage"][];
1134
+ };
1135
+ /** @description One usage that has no rate card on the plan it was priced against. */
1136
+ UnpricedUsage: {
1137
+ /** @description The meter key this usage resolved to */
1138
+ key: string;
1139
+ /** @description Echoed from the request when the usage was named by service and product */
1140
+ service?: string;
1141
+ /** @description Echoed from the request when the usage was named by service and product */
1142
+ product_id?: string;
1143
+ /** @description Echoed from the request */
1144
+ variant?: {
1145
+ [key: string]: string;
1146
+ };
922
1147
  };
923
1148
  /**
924
1149
  * @description When a plan change takes effect. There is no default: an upgrade and a downgrade want opposite
@@ -927,6 +1152,15 @@ export interface components {
927
1152
  */
928
1153
  PlanChangeTiming: "immediate" | "next_billing_cycle";
929
1154
  OfferList: {
1155
+ /**
1156
+ * Format: int64
1157
+ * @description How many entries there are in total, across every page.
1158
+ *
1159
+ * Without it, "is there another page" has to be guessed from whether this one came back
1160
+ * full — and that guess turns into one extra fetch of an empty page whenever the last page
1161
+ * happens to be exactly full.
1162
+ */
1163
+ total_count?: number;
930
1164
  offers: components["schemas"]["Offer"][];
931
1165
  };
932
1166
  /**
@@ -945,6 +1179,15 @@ export interface components {
945
1179
  * @description When this offer stops being purchasable. Absent means it does not expire
946
1180
  */
947
1181
  valid_until?: string;
1182
+ /**
1183
+ * @description The plan this offer sells, matching `plan_key` on the subscription. Present on offers
1184
+ * that sell a plan.
1185
+ *
1186
+ * It is here so the pricing page can mark the tier the account is already on. Without it
1187
+ * the current tier looks like every other one, and the obvious thing to do — buy it — is
1188
+ * refused as a switch to the same plan
1189
+ */
1190
+ plan_key?: string;
948
1191
  /** @description Present on offers that sell a plan */
949
1192
  pricing?: components["schemas"]["Pricing"];
950
1193
  /** @description Present on offers that sell credit */
@@ -971,6 +1214,21 @@ export interface components {
971
1214
  * one of those, last
972
1215
  */
973
1216
  phases: components["schemas"]["PricingPhase"][];
1217
+ /**
1218
+ * @description Credit handed out at the start of every period, as a decimal string in `currency`. Absent
1219
+ * when the tier comes with none.
1220
+ *
1221
+ * It is what makes a paid tier worth buying — "$200 a month, and $200 of credit to spend" —
1222
+ * so leaving it off the pricing page turns that tier into a fee with nothing visibly
1223
+ * attached to it
1224
+ */
1225
+ included_credit?: string;
1226
+ /**
1227
+ * @description Whether unused credit is voided at the end of the period. Only meaningful alongside
1228
+ * `included_credit`, and worth showing either way: carried over, it accumulates, which is a
1229
+ * materially different offer at the same price
1230
+ */
1231
+ included_credit_expires?: boolean;
974
1232
  };
975
1233
  PricingPhase: {
976
1234
  name: string;
@@ -1033,16 +1291,70 @@ export interface components {
1033
1291
  */
1034
1292
  amount?: string;
1035
1293
  currency?: string;
1294
+ /**
1295
+ * Format: date-time
1296
+ * @description When the money for this order arrived. Absent on an order nothing was charged for, and on
1297
+ * one still waiting to be paid.
1298
+ *
1299
+ * Separate from `created_at` because the two can be far apart: an order paid online is
1300
+ * created first and paid whenever the customer gets round to it. Merged into one field,
1301
+ * "how long did this sit unpaid" has no answer anywhere — and that is the number chasing
1302
+ * payment looks at.
1303
+ */
1304
+ paid_at?: string;
1036
1305
  /**
1037
1306
  * @description Always `none` on a metered order.
1307
+ *
1308
+ * `pending` is an order paid for online whose money has not arrived yet: the checkout
1309
+ * session is open and nothing has been created. It was missing from this enum while the
1310
+ * column had it and the handler passed it through unchanged, so such an order read back
1311
+ * a value outside the enum — the one state where the caller most needs to know not to
1312
+ * expect the resource yet.
1038
1313
  * @enum {string}
1039
1314
  */
1040
- payment_state?: "none" | "paid" | "refunded";
1315
+ payment_state?: "none" | "pending" | "paid" | "refunded";
1041
1316
  /** Format: date-time */
1042
1317
  created_at: string;
1043
- /** @description Only present on the single-order route. */
1318
+ /**
1319
+ * @description What this order was for. Present on the list route too — an order list that shows only
1320
+ * numbers and amounts is a page of identifiers with no content, and recognising one
1321
+ * ("which of these was last week's machine") is the reason anyone opens it.
1322
+ */
1044
1323
  lines?: components["schemas"]["OrderLine"][];
1045
1324
  };
1325
+ BalanceMovement: {
1326
+ currency: components["schemas"]["Currency"];
1327
+ /**
1328
+ * Format: date-time
1329
+ * @description Start of the window — the first instant of the current calendar month, UTC.
1330
+ */
1331
+ from: string;
1332
+ /**
1333
+ * Format: date-time
1334
+ * @description End of the window, which is **now** rather than the month's end. The month is not over.
1335
+ */
1336
+ to: string;
1337
+ /**
1338
+ * @description The balance when the window opened, as a decimal string.
1339
+ *
1340
+ * Taken from the earliest transaction in the window rather than read separately: every
1341
+ * transaction carries the balance before and after it, so this figure and the totals below
1342
+ * come from one read of one ledger and therefore agree.
1343
+ */
1344
+ opening: string;
1345
+ /** @description What came in — top-ups and credit issued by operations. Never negative. */
1346
+ income: string;
1347
+ /**
1348
+ * @description What went out — consumption and expiry. **Never negative**: the direction is in the
1349
+ * name, not in the sign. Signed, a client would have to handle both `-20` and `20` meaning
1350
+ * the same thing.
1351
+ */
1352
+ spending: string;
1353
+ /** @description `opening + income - spending`. Computed, not read separately — see the endpoint. */
1354
+ closing: string;
1355
+ /** @description False when this account has no balance record in this currency at all, which is not the same as a zero balance. */
1356
+ present: boolean;
1357
+ };
1046
1358
  OrderLine: {
1047
1359
  id: string;
1048
1360
  /** @enum {string} */
@@ -1051,8 +1363,62 @@ export interface components {
1051
1363
  service: string;
1052
1364
  /** @description That service's own catalogue identifier for what was asked for. */
1053
1365
  product_id: string;
1366
+ /**
1367
+ * @description What this was called when it was ordered.
1368
+ *
1369
+ * A snapshot, not a lookup. `product_id` is usually a uuid, and an order page that shows it
1370
+ * shows a string of hex. Asking the owning service for the name later is worse: it is a
1371
+ * cross-service call per row, and by then the product may have been renamed or withdrawn —
1372
+ * a bill has to answer "what did I buy", and that answer has to be in the words used at the
1373
+ * time.
1374
+ *
1375
+ * Empty on orders placed before this was recorded, and on the rare call that omits it.
1376
+ * Fall back to `product_id`.
1377
+ */
1378
+ product_name: string;
1379
+ /**
1380
+ * @description What was configured on this line at the moment of sale, as key–value pairs meant for a
1381
+ * person to read.
1382
+ *
1383
+ * **Free-form, not fixed fields.** Every service's products have their own dimensions — a
1384
+ * machine has cores and memory, a disk has capacity and medium, an address has bandwidth.
1385
+ * Fixed fields would mean adding more of them for every service that comes along, or
1386
+ * squeezing one service's answers into another's boxes.
1387
+ *
1388
+ * Do not parse it. The keys are written for the reader, in the reader's language, and they
1389
+ * change when the wording changes. Anything a program needs to decide on is in
1390
+ * `product_id` and `quantity`.
1391
+ */
1392
+ configuration?: {
1393
+ [key: string]: string;
1394
+ };
1054
1395
  /** Format: int64 */
1055
1396
  quantity: number;
1397
+ /**
1398
+ * @description How this line is paid for: empty is by the hour, an ISO 8601 duration (`P1M`, `P1Y`) is
1399
+ * bought outright for that long.
1400
+ *
1401
+ * Fixed at the moment of sale. The asset's own term can move afterwards (renewing can
1402
+ * change the period); this one cannot, because an order is a transaction that already
1403
+ * happened.
1404
+ */
1405
+ term: string;
1406
+ /**
1407
+ * Format: date-time
1408
+ * @description Start of the period this line bought. **Absent when billed by the hour** — that has no
1409
+ * service period, and filling in "today to today" would state a term that does not exist.
1410
+ */
1411
+ service_period_from?: string;
1412
+ /**
1413
+ * Format: date-time
1414
+ * @description End of the period this line bought. Absent when billed by the hour.
1415
+ */
1416
+ service_period_to?: string;
1417
+ /**
1418
+ * @description The resource this line produced, in the owning service's own identifiers. Absent until
1419
+ * that service reports it back, which is also the moment the line starts being billed.
1420
+ */
1421
+ resource_id?: string;
1056
1422
  };
1057
1423
  PrepaidAsset: {
1058
1424
  id: string;
@@ -1074,12 +1440,31 @@ export interface components {
1074
1440
  /**
1075
1441
  * @description How long one period buys, as an ISO 8601 duration (P1M, P1Y).
1076
1442
  *
1077
- * There is no expiry to report. The engine keeps renewing this for as long as the seat is
1078
- * held, so what runs out is not the term but the customer's decision to keep it. What the
1079
- * next period costs, and when it is charged, is on the charges route — that is the engine's
1080
- * own answer rather than a copy of it.
1443
+ * It is paid for once at purchase. Read it next to `expires_at`, which is when the period
1444
+ * actually runs out the two are settled when the order is placed and neither moves on
1445
+ * its own.
1081
1446
  */
1082
1447
  term: string;
1448
+ /**
1449
+ * Format: date-time
1450
+ * @description When the paid-for period runs out.
1451
+ *
1452
+ * Settled when the order is placed, not when the resource lands, so a purchase paid for
1453
+ * online does not get a longer period by being paid later.
1454
+ *
1455
+ * Absent means it was never settled — a row that has not finished being created. It is not
1456
+ * "does not expire": everything on this route does.
1457
+ */
1458
+ expires_at?: string;
1459
+ /**
1460
+ * @description Whether billing places the renewal order itself as the period runs out.
1461
+ *
1462
+ * Off by default, and deliberately so: renewing charges the account, and a charge nobody
1463
+ * asked for is worse than an expiry that was warned about. With it on, the renewal is
1464
+ * placed only while there is balance to pay for it — when there is not, the customer is
1465
+ * told rather than put into debt.
1466
+ */
1467
+ auto_renew: boolean;
1083
1468
  /** @enum {string} */
1084
1469
  state: "pending" | "active" | "suspended" | "terminated";
1085
1470
  /**
@@ -1090,6 +1475,15 @@ export interface components {
1090
1475
  desired_state: "active" | "suspended" | "terminated";
1091
1476
  };
1092
1477
  PrepaidAssetList: {
1478
+ /**
1479
+ * Format: int64
1480
+ * @description How many entries there are in total, across every page.
1481
+ *
1482
+ * Without it, "is there another page" has to be guessed from whether this one came back
1483
+ * full — and that guess turns into one extra fetch of an empty page whenever the last page
1484
+ * happens to be exactly full.
1485
+ */
1486
+ total_count?: number;
1093
1487
  assets: components["schemas"]["PrepaidAsset"][];
1094
1488
  };
1095
1489
  RenewRequestBody: {
@@ -1104,13 +1498,43 @@ export interface components {
1104
1498
  */
1105
1499
  idempotency_key: string;
1106
1500
  };
1501
+ AutoRenewRequestBody: {
1502
+ auto_renew: boolean;
1503
+ };
1107
1504
  OrderList: {
1505
+ /**
1506
+ * Format: int64
1507
+ * @description How many entries there are in total, across every page.
1508
+ *
1509
+ * Without it, "is there another page" has to be guessed from whether this one came back
1510
+ * full — and that guess turns into one extra fetch of an empty page whenever the last page
1511
+ * happens to be exactly full.
1512
+ */
1513
+ total_count?: number;
1108
1514
  orders: components["schemas"]["Order"][];
1109
1515
  };
1110
1516
  TopUpList: {
1517
+ /**
1518
+ * Format: int64
1519
+ * @description How many entries there are in total, across every page.
1520
+ *
1521
+ * Without it, "is there another page" has to be guessed from whether this one came back
1522
+ * full — and that guess turns into one extra fetch of an empty page whenever the last page
1523
+ * happens to be exactly full.
1524
+ */
1525
+ total_count?: number;
1111
1526
  top_ups: components["schemas"]["TopUpStatus"][];
1112
1527
  };
1113
1528
  CreditTransactionList: {
1529
+ /**
1530
+ * Format: int64
1531
+ * @description How many entries there are in total, across every page.
1532
+ *
1533
+ * Without it, "is there another page" has to be guessed from whether this one came back
1534
+ * full — and that guess turns into one extra fetch of an empty page whenever the last page
1535
+ * happens to be exactly full.
1536
+ */
1537
+ total_count?: number;
1114
1538
  transactions: components["schemas"]["CreditTransaction"][];
1115
1539
  };
1116
1540
  /**
@@ -1154,13 +1578,46 @@ export interface components {
1154
1578
  /** @description How much credit is granted. Equal to `pay` when there is no bonus */
1155
1579
  credit: string;
1156
1580
  };
1581
+ /**
1582
+ * @description The result of buying an offer — either it is done, or the money has to arrive first.
1583
+ *
1584
+ * ## A paid tier is never granted before the money lands
1585
+ *
1586
+ * A tier that charges a fee is paid for by card, not from the credit balance. Two reasons, and
1587
+ * the second is the one that decides it:
1588
+ *
1589
+ * 1. The engine bills a plan's fee **in arrears** — subscribing only records an unsettled
1590
+ * charge, while the tier's credit is handed over at once. Without payment first, an account
1591
+ * can subscribe, spend the credit, and walk away from an invoice nobody will pay.
1592
+ * 2. Paying for the membership out of credit is a loop: the tier hands back credit of the same
1593
+ * value, so nothing the platform can bank ever enters. The membership fee is where real
1594
+ * money is supposed to arrive.
1595
+ *
1596
+ * So `checkout_url` comes back instead of `subscription_id`, and the switch happens when the
1597
+ * payment does. The place on the offer is already held, so returning to it later finishes the
1598
+ * same purchase rather than starting a second one.
1599
+ */
1157
1600
  Purchase: {
1158
1601
  offer_key: string;
1159
1602
  /**
1160
1603
  * @description The subscription now serving this account. When the change was set to take effect at the
1161
- * end of the period, this is the one that takes over then, and its status says `scheduled`
1604
+ * end of the period, this is the one that takes over then, and its status says `scheduled`.
1605
+ *
1606
+ * Absent when payment is still needed — see `checkout_url`
1162
1607
  */
1163
- subscription_id: string;
1608
+ subscription_id?: string;
1609
+ /**
1610
+ * @description Where to send the buyer to pay. Present exactly when the tier charges a fee and the
1611
+ * payment has not been made yet.
1612
+ *
1613
+ * The switch is performed by the payment callback, so a client that ignores this and reads
1614
+ * `subscription_id` gets nothing — which is the intended failure: pretending the tier is
1615
+ * active before the money arrives is the thing this whole route exists to prevent
1616
+ */
1617
+ checkout_url?: string;
1618
+ /** @description What the buyer is being sent to pay, in `currency`. Present with `checkout_url` */
1619
+ amount_due?: string;
1620
+ currency?: components["schemas"]["Currency"];
1164
1621
  };
1165
1622
  Error: {
1166
1623
  code?: string;
@@ -1188,6 +1645,15 @@ export interface components {
1188
1645
  project_ids: string[];
1189
1646
  };
1190
1647
  BillingAccountList: {
1648
+ /**
1649
+ * Format: int64
1650
+ * @description How many entries there are in total, across every page.
1651
+ *
1652
+ * Without it, "is there another page" has to be guessed from whether this one came back
1653
+ * full — and that guess turns into one extra fetch of an empty page whenever the last page
1654
+ * happens to be exactly full.
1655
+ */
1656
+ total_count?: number;
1191
1657
  /** @description Every account belonging to the caller. Empty when they hold none */
1192
1658
  accounts: components["schemas"]["BillingAccount"][];
1193
1659
  };
@@ -1286,11 +1752,11 @@ export interface components {
1286
1752
  };
1287
1753
  PaymentMethodSetupSession: {
1288
1754
  /**
1289
- * @description Initialises the provider's JavaScript, which mounts its form in an iframe on this page.
1755
+ * @description Confirms this attempt from the browser, against the provider's own inputs.
1290
1756
  *
1291
- * Not a URL: the form is embedded rather than redirected to, so the account holder stays
1292
- * on the console. It expires, so fetch it when the form is about to be shown rather than
1293
- * when the page loads.
1757
+ * Not a URL and not a hosted page: only the inputs come from the provider, so the
1758
+ * heading, the button and the styling around them are this platform's. It expires, so
1759
+ * fetch it when the form is about to be shown rather than when the page loads.
1294
1760
  */
1295
1761
  client_secret: string;
1296
1762
  /**
@@ -1309,7 +1775,7 @@ export interface components {
1309
1775
  * records the method. It is here so that a support conversation about one failed attempt
1310
1776
  * has something to look it up by.
1311
1777
  */
1312
- session_id?: string;
1778
+ setup_id?: string;
1313
1779
  };
1314
1780
  /**
1315
1781
  * @description One saved way of collecting money later, without the account holder present.
@@ -1348,6 +1814,15 @@ export interface components {
1348
1814
  default: boolean;
1349
1815
  };
1350
1816
  PaymentMethodList: {
1817
+ /**
1818
+ * Format: int64
1819
+ * @description How many entries there are in total, across every page.
1820
+ *
1821
+ * Without it, "is there another page" has to be guessed from whether this one came back
1822
+ * full — and that guess turns into one extra fetch of an empty page whenever the last page
1823
+ * happens to be exactly full.
1824
+ */
1825
+ total_count?: number;
1351
1826
  payment_methods: components["schemas"]["PaymentMethod"][];
1352
1827
  };
1353
1828
  TopUpSession: {
@@ -1494,6 +1969,15 @@ export interface components {
1494
1969
  created_at: string;
1495
1970
  };
1496
1971
  InvoiceList: {
1972
+ /**
1973
+ * Format: int64
1974
+ * @description How many entries there are in total, across every page.
1975
+ *
1976
+ * Without it, "is there another page" has to be guessed from whether this one came back
1977
+ * full — and that guess turns into one extra fetch of an empty page whenever the last page
1978
+ * happens to be exactly full.
1979
+ */
1980
+ total_count?: number;
1497
1981
  invoices: components["schemas"]["Invoice"][];
1498
1982
  };
1499
1983
  InvoiceLine: {
@@ -1566,12 +2050,60 @@ export interface components {
1566
2050
  Subscription: {
1567
2051
  id: string;
1568
2052
  plan_key: string;
2053
+ /** @description What this tier is called on the pricing page */
2054
+ plan_name?: string;
1569
2055
  plan_version?: number;
1570
2056
  /**
1571
2057
  * @description `canceled` still counts as being on a plan — it is serving until the end of the period,
1572
2058
  * which has already been paid for
1573
2059
  */
1574
2060
  status: string;
2061
+ /**
2062
+ * Format: date-time
2063
+ * @description Start of the period being served. Absent for the moment right after subscribing, while
2064
+ * the engine is still writing the charge this is read from — absent means "not known yet"
2065
+ * rather than "no period"
2066
+ */
2067
+ current_period_start?: string;
2068
+ /**
2069
+ * Format: date-time
2070
+ * @description End of the period being served, which is also when the next charge falls and when
2071
+ * anything scheduled takes effect
2072
+ */
2073
+ current_period_end?: string;
2074
+ /**
2075
+ * @description What takes over at the end of the period, when a downgrade has been scheduled.
2076
+ *
2077
+ * Absent when nothing is pending. Leaving it out entirely would show someone who has
2078
+ * already scheduled a downgrade the tier they are on today, so they would schedule it
2079
+ * again.
2080
+ */
2081
+ scheduled?: components["schemas"]["ScheduledPlan"];
2082
+ /**
2083
+ * @description True once the account has been taken off its paid plan at the end of the period. It is
2084
+ * still being served until then, and this can still be undone — unlike a scheduled
2085
+ * downgrade
2086
+ */
2087
+ cancels_at_period_end?: boolean;
2088
+ /**
2089
+ * @description True when this is the free tier every account starts on.
2090
+ *
2091
+ * Coming off it is not a thing that can happen: cancelling puts the account back on it, so
2092
+ * offering that as an action is at best a no-op and at worst a gap — between the period
2093
+ * ending and the sweep putting the tier back, the account has no plan at all and admission
2094
+ * refuses it. A console reads this to leave the action out.
2095
+ */
2096
+ is_default_plan?: boolean;
2097
+ };
2098
+ ScheduledPlan: {
2099
+ plan_key: string;
2100
+ plan_name?: string;
2101
+ plan_version?: number;
2102
+ /**
2103
+ * Format: date-time
2104
+ * @description When it takes over, which is the end of the current period
2105
+ */
2106
+ starts_at?: string;
1575
2107
  };
1576
2108
  TopUpStatus: {
1577
2109
  payment_id: string;
@@ -1596,9 +2128,113 @@ export interface components {
1596
2128
  * where that rule can change without regenerating anything.
1597
2129
  */
1598
2130
  Currency: string;
2131
+ PreviewPromotionCodeRequestBody: {
2132
+ /** @description Case and surrounding whitespace do not matter. */
2133
+ code: string;
2134
+ /**
2135
+ * Format: uuid
2136
+ * @description Which project the order will be placed against — the price depends on its plan.
2137
+ */
2138
+ project_id: string;
2139
+ /**
2140
+ * @description The same lines the order will carry. The discount is computed over the ones in scope,
2141
+ * not the whole order, so leaving lines out changes the answer.
2142
+ */
2143
+ lines: components["schemas"]["PromotionPreviewLine"][];
2144
+ };
2145
+ /**
2146
+ * @description One line of the order being previewed. Only what pricing and scope need — this is not the
2147
+ * order itself, and carrying the whole order here would mean two places that have to agree on
2148
+ * what an order looks like.
2149
+ */
2150
+ PromotionPreviewLine: {
2151
+ service: string;
2152
+ product_id: string;
2153
+ /**
2154
+ * @description ISO 8601 duration for a prepaid line. Empty means metered, and a metered line
2155
+ * contributes nothing to the discount — it has no amount at this point.
2156
+ */
2157
+ term?: string;
2158
+ /** @default 1 */
2159
+ quantity?: number;
2160
+ };
2161
+ PromotionPreview: {
2162
+ /** @description The code as stored, upper-cased. */
2163
+ code: string;
2164
+ /** @description The campaign's name, to show next to the price. */
2165
+ name?: string;
2166
+ /** @enum {string} */
2167
+ kind: "voucher" | "discount";
2168
+ /** @description How much comes off this order, or how much credit is granted. */
2169
+ benefit_amount: string;
2170
+ /**
2171
+ * @description The part of the order the discount applies to. Shown so "why did only 12 come off a 200
2172
+ * order" has an answer on the page rather than in a support ticket.
2173
+ */
2174
+ discount_base?: string;
2175
+ original_amount: string;
2176
+ /** @description What will actually be charged. This is the number to show as the price. */
2177
+ payable_amount: string;
2178
+ currency: string;
2179
+ };
2180
+ Voucher: {
2181
+ /** Format: uuid */
2182
+ redemption_id: string;
2183
+ promotion_key: string;
2184
+ name?: string;
2185
+ amount: string;
2186
+ currency: string;
2187
+ /** Format: date-time */
2188
+ granted_at: string;
2189
+ };
2190
+ VoucherList: {
2191
+ items: components["schemas"]["Voucher"][];
2192
+ total_count?: number;
2193
+ };
2194
+ AccountRefund: {
2195
+ /** Format: uuid */
2196
+ refund_id: string;
2197
+ /** Format: uuid */
2198
+ order_id?: string | null;
2199
+ total_amount: string;
2200
+ currency: string;
2201
+ /**
2202
+ * @description `partial` means some of it is back and some is not. Showing it as "refunded" would have
2203
+ * the customer looking for money that has not moved.
2204
+ * @enum {string}
2205
+ */
2206
+ state: "pending" | "settled" | "partial";
2207
+ legs: components["schemas"]["AccountRefundLeg"][];
2208
+ /** Format: date-time */
2209
+ created_at: string;
2210
+ };
2211
+ AccountRefundLeg: {
2212
+ /** @enum {string} */
2213
+ kind: "cash" | "voucher" | "balance";
2214
+ amount: string;
2215
+ currency: string;
2216
+ /** @enum {string} */
2217
+ state: "pending" | "done" | "failed";
2218
+ /** Format: date-time */
2219
+ settled_at?: string | null;
2220
+ };
2221
+ AccountRefundList: {
2222
+ items: components["schemas"]["AccountRefund"][];
2223
+ total_count?: number;
2224
+ };
1599
2225
  };
1600
2226
  responses: never;
1601
2227
  parameters: {
2228
+ /** @description 1-based page number; the first page when omitted. */
2229
+ Page: number;
2230
+ /**
2231
+ * @description How many entries per page, at most 100.
2232
+ *
2233
+ * Every list here grows without bound — charges with resources, transactions with time. A list
2234
+ * that returns everything works on the account it was written against and quietly turns into a
2235
+ * multi-megabyte response on the one that has been running for a year.
2236
+ */
2237
+ PageSize: number;
1602
2238
  /** @description Which asset, from the prepaid list */
1603
2239
  ProvisionId: string;
1604
2240
  /**
@@ -1615,7 +2251,18 @@ export type $defs = Record<string, never>;
1615
2251
  export interface operations {
1616
2252
  "list-billing-accounts": {
1617
2253
  parameters: {
1618
- query?: never;
2254
+ query?: {
2255
+ /** @description 1-based page number; the first page when omitted. */
2256
+ page?: components["parameters"]["Page"];
2257
+ /**
2258
+ * @description How many entries per page, at most 100.
2259
+ *
2260
+ * Every list here grows without bound — charges with resources, transactions with time. A list
2261
+ * that returns everything works on the account it was written against and quietly turns into a
2262
+ * multi-megabyte response on the one that has been running for a year.
2263
+ */
2264
+ page_size?: components["parameters"]["PageSize"];
2265
+ };
1619
2266
  header?: never;
1620
2267
  path?: never;
1621
2268
  cookie?: never;
@@ -1751,7 +2398,18 @@ export interface operations {
1751
2398
  };
1752
2399
  "list-credit-transactions": {
1753
2400
  parameters: {
1754
- query?: never;
2401
+ query?: {
2402
+ /** @description 1-based page number; the first page when omitted. */
2403
+ page?: components["parameters"]["Page"];
2404
+ /**
2405
+ * @description How many entries per page, at most 100.
2406
+ *
2407
+ * Every list here grows without bound — charges with resources, transactions with time. A list
2408
+ * that returns everything works on the account it was written against and quietly turns into a
2409
+ * multi-megabyte response on the one that has been running for a year.
2410
+ */
2411
+ page_size?: components["parameters"]["PageSize"];
2412
+ };
1755
2413
  header?: never;
1756
2414
  path: {
1757
2415
  /**
@@ -1819,6 +2477,41 @@ export interface operations {
1819
2477
  };
1820
2478
  };
1821
2479
  };
2480
+ "read-billing-account-balance-movement": {
2481
+ parameters: {
2482
+ query?: never;
2483
+ header?: never;
2484
+ path: {
2485
+ /**
2486
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2487
+ * which is why the key is what addresses the account.
2488
+ */
2489
+ accountKey: components["parameters"]["AccountKey"];
2490
+ };
2491
+ cookie?: never;
2492
+ };
2493
+ requestBody?: never;
2494
+ responses: {
2495
+ /** @description OK */
2496
+ 200: {
2497
+ headers: {
2498
+ [name: string]: unknown;
2499
+ };
2500
+ content: {
2501
+ "application/json": components["schemas"]["BalanceMovement"];
2502
+ };
2503
+ };
2504
+ /** @description Error */
2505
+ default: {
2506
+ headers: {
2507
+ [name: string]: unknown;
2508
+ };
2509
+ content: {
2510
+ "application/json": components["schemas"]["Error"];
2511
+ };
2512
+ };
2513
+ };
2514
+ };
1822
2515
  "bind-project-to-billing-account": {
1823
2516
  parameters: {
1824
2517
  query?: never;
@@ -1893,7 +2586,18 @@ export interface operations {
1893
2586
  };
1894
2587
  "list-orders": {
1895
2588
  parameters: {
1896
- query?: never;
2589
+ query?: {
2590
+ /** @description 1-based page number; the first page when omitted. */
2591
+ page?: components["parameters"]["Page"];
2592
+ /**
2593
+ * @description How many entries per page, at most 100.
2594
+ *
2595
+ * Every list here grows without bound — charges with resources, transactions with time. A list
2596
+ * that returns everything works on the account it was written against and quietly turns into a
2597
+ * multi-megabyte response on the one that has been running for a year.
2598
+ */
2599
+ page_size?: components["parameters"]["PageSize"];
2600
+ };
1897
2601
  header?: never;
1898
2602
  path: {
1899
2603
  /**
@@ -1964,7 +2668,18 @@ export interface operations {
1964
2668
  };
1965
2669
  "list-top-ups": {
1966
2670
  parameters: {
1967
- query?: never;
2671
+ query?: {
2672
+ /** @description 1-based page number; the first page when omitted. */
2673
+ page?: components["parameters"]["Page"];
2674
+ /**
2675
+ * @description How many entries per page, at most 100.
2676
+ *
2677
+ * Every list here grows without bound — charges with resources, transactions with time. A list
2678
+ * that returns everything works on the account it was written against and quietly turns into a
2679
+ * multi-megabyte response on the one that has been running for a year.
2680
+ */
2681
+ page_size?: components["parameters"]["PageSize"];
2682
+ };
1968
2683
  header?: never;
1969
2684
  path: {
1970
2685
  /**
@@ -2040,15 +2755,15 @@ export interface operations {
2040
2755
  parameters: {
2041
2756
  query?: {
2042
2757
  /** @description 1-based page number; the first page when omitted. */
2043
- page?: number;
2758
+ page?: components["parameters"]["Page"];
2044
2759
  /**
2045
- * @description How many charges per page. Defaults to a full page.
2760
+ * @description How many entries per page, at most 100.
2046
2761
  *
2047
- * Charge count grows with resource count an account running dozens of machines produces
2048
- * hundreds of lines in a period, and a screen shows a dozen. Fetching all of them on every
2049
- * visit carries data nothing displays.
2762
+ * Every list here grows without boundcharges with resources, transactions with time. A list
2763
+ * that returns everything works on the account it was written against and quietly turns into a
2764
+ * multi-megabyte response on the one that has been running for a year.
2050
2765
  */
2051
- page_size?: number;
2766
+ page_size?: components["parameters"]["PageSize"];
2052
2767
  };
2053
2768
  header?: never;
2054
2769
  path: {
@@ -2121,7 +2836,18 @@ export interface operations {
2121
2836
  };
2122
2837
  "list-invoices": {
2123
2838
  parameters: {
2124
- query?: never;
2839
+ query?: {
2840
+ /** @description 1-based page number; the first page when omitted. */
2841
+ page?: components["parameters"]["Page"];
2842
+ /**
2843
+ * @description How many entries per page, at most 100.
2844
+ *
2845
+ * Every list here grows without bound — charges with resources, transactions with time. A list
2846
+ * that returns everything works on the account it was written against and quietly turns into a
2847
+ * multi-megabyte response on the one that has been running for a year.
2848
+ */
2849
+ page_size?: components["parameters"]["PageSize"];
2850
+ };
2125
2851
  header?: never;
2126
2852
  path: {
2127
2853
  /**
@@ -2331,6 +3057,41 @@ export interface operations {
2331
3057
  };
2332
3058
  };
2333
3059
  };
3060
+ "keep-subscription": {
3061
+ parameters: {
3062
+ query?: never;
3063
+ header?: never;
3064
+ path: {
3065
+ /**
3066
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
3067
+ * which is why the key is what addresses the account.
3068
+ */
3069
+ accountKey: components["parameters"]["AccountKey"];
3070
+ };
3071
+ cookie?: never;
3072
+ };
3073
+ requestBody?: never;
3074
+ responses: {
3075
+ /** @description OK */
3076
+ 200: {
3077
+ headers: {
3078
+ [name: string]: unknown;
3079
+ };
3080
+ content: {
3081
+ "application/json": components["schemas"]["Subscription"];
3082
+ };
3083
+ };
3084
+ /** @description Error */
3085
+ default: {
3086
+ headers: {
3087
+ [name: string]: unknown;
3088
+ };
3089
+ content: {
3090
+ "application/json": components["schemas"]["Error"];
3091
+ };
3092
+ };
3093
+ };
3094
+ };
2334
3095
  "cancel-subscription": {
2335
3096
  parameters: {
2336
3097
  query: {
@@ -2408,7 +3169,18 @@ export interface operations {
2408
3169
  };
2409
3170
  "list-payment-methods": {
2410
3171
  parameters: {
2411
- query?: never;
3172
+ query?: {
3173
+ /** @description 1-based page number; the first page when omitted. */
3174
+ page?: components["parameters"]["Page"];
3175
+ /**
3176
+ * @description How many entries per page, at most 100.
3177
+ *
3178
+ * Every list here grows without bound — charges with resources, transactions with time. A list
3179
+ * that returns everything works on the account it was written against and quietly turns into a
3180
+ * multi-megabyte response on the one that has been running for a year.
3181
+ */
3182
+ page_size?: components["parameters"]["PageSize"];
3183
+ };
2412
3184
  header?: never;
2413
3185
  path: {
2414
3186
  /**
@@ -2546,7 +3318,18 @@ export interface operations {
2546
3318
  };
2547
3319
  "list-offers": {
2548
3320
  parameters: {
2549
- query?: never;
3321
+ query?: {
3322
+ /** @description 1-based page number; the first page when omitted. */
3323
+ page?: components["parameters"]["Page"];
3324
+ /**
3325
+ * @description How many entries per page, at most 100.
3326
+ *
3327
+ * Every list here grows without bound — charges with resources, transactions with time. A list
3328
+ * that returns everything works on the account it was written against and quietly turns into a
3329
+ * multi-megabyte response on the one that has been running for a year.
3330
+ */
3331
+ page_size?: components["parameters"]["PageSize"];
3332
+ };
2550
3333
  header?: never;
2551
3334
  path: {
2552
3335
  /**
@@ -2621,7 +3404,18 @@ export interface operations {
2621
3404
  };
2622
3405
  "list-prepaid-assets": {
2623
3406
  parameters: {
2624
- query?: never;
3407
+ query?: {
3408
+ /** @description 1-based page number; the first page when omitted. */
3409
+ page?: components["parameters"]["Page"];
3410
+ /**
3411
+ * @description How many entries per page, at most 100.
3412
+ *
3413
+ * Every list here grows without bound — charges with resources, transactions with time. A list
3414
+ * that returns everything works on the account it was written against and quietly turns into a
3415
+ * multi-megabyte response on the one that has been running for a year.
3416
+ */
3417
+ page_size?: components["parameters"]["PageSize"];
3418
+ };
2625
3419
  header?: never;
2626
3420
  path: {
2627
3421
  /**
@@ -2654,4 +3448,217 @@ export interface operations {
2654
3448
  };
2655
3449
  };
2656
3450
  };
3451
+ "renew-prepaid-asset": {
3452
+ parameters: {
3453
+ query?: never;
3454
+ header?: never;
3455
+ path: {
3456
+ /**
3457
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
3458
+ * which is why the key is what addresses the account.
3459
+ */
3460
+ accountKey: components["parameters"]["AccountKey"];
3461
+ /** @description Which asset, from the prepaid list */
3462
+ assetId: string;
3463
+ };
3464
+ cookie?: never;
3465
+ };
3466
+ requestBody: {
3467
+ content: {
3468
+ "application/json": components["schemas"]["RenewRequestBody"];
3469
+ };
3470
+ };
3471
+ responses: {
3472
+ /** @description Renewed */
3473
+ 200: {
3474
+ headers: {
3475
+ [name: string]: unknown;
3476
+ };
3477
+ content: {
3478
+ "application/json": components["schemas"]["PrepaidAsset"];
3479
+ };
3480
+ };
3481
+ /** @description Error */
3482
+ default: {
3483
+ headers: {
3484
+ [name: string]: unknown;
3485
+ };
3486
+ content: {
3487
+ "application/json": components["schemas"]["Error"];
3488
+ };
3489
+ };
3490
+ };
3491
+ };
3492
+ "set-prepaid-auto-renew": {
3493
+ parameters: {
3494
+ query?: never;
3495
+ header?: never;
3496
+ path: {
3497
+ /**
3498
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
3499
+ * which is why the key is what addresses the account.
3500
+ */
3501
+ accountKey: components["parameters"]["AccountKey"];
3502
+ /** @description Which asset, from the prepaid list */
3503
+ assetId: string;
3504
+ };
3505
+ cookie?: never;
3506
+ };
3507
+ requestBody: {
3508
+ content: {
3509
+ "application/json": components["schemas"]["AutoRenewRequestBody"];
3510
+ };
3511
+ };
3512
+ responses: {
3513
+ /** @description OK */
3514
+ 200: {
3515
+ headers: {
3516
+ [name: string]: unknown;
3517
+ };
3518
+ content: {
3519
+ "application/json": components["schemas"]["PrepaidAsset"];
3520
+ };
3521
+ };
3522
+ /** @description Error */
3523
+ default: {
3524
+ headers: {
3525
+ [name: string]: unknown;
3526
+ };
3527
+ content: {
3528
+ "application/json": components["schemas"]["Error"];
3529
+ };
3530
+ };
3531
+ };
3532
+ };
3533
+ "preview-promotion-code": {
3534
+ parameters: {
3535
+ query?: never;
3536
+ header?: never;
3537
+ path: {
3538
+ /**
3539
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
3540
+ * which is why the key is what addresses the account.
3541
+ */
3542
+ accountKey: components["parameters"]["AccountKey"];
3543
+ };
3544
+ cookie?: never;
3545
+ };
3546
+ requestBody: {
3547
+ content: {
3548
+ "application/json": components["schemas"]["PreviewPromotionCodeRequestBody"];
3549
+ };
3550
+ };
3551
+ responses: {
3552
+ /** @description OK */
3553
+ 200: {
3554
+ headers: {
3555
+ [name: string]: unknown;
3556
+ };
3557
+ content: {
3558
+ "application/json": components["schemas"]["PromotionPreview"];
3559
+ };
3560
+ };
3561
+ /** @description Error */
3562
+ default: {
3563
+ headers: {
3564
+ [name: string]: unknown;
3565
+ };
3566
+ content: {
3567
+ "application/json": components["schemas"]["Error"];
3568
+ };
3569
+ };
3570
+ };
3571
+ };
3572
+ "list-account-vouchers": {
3573
+ parameters: {
3574
+ query?: {
3575
+ /** @description 1-based page number; the first page when omitted. */
3576
+ page?: components["parameters"]["Page"];
3577
+ /**
3578
+ * @description How many entries per page, at most 100.
3579
+ *
3580
+ * Every list here grows without bound — charges with resources, transactions with time. A list
3581
+ * that returns everything works on the account it was written against and quietly turns into a
3582
+ * multi-megabyte response on the one that has been running for a year.
3583
+ */
3584
+ page_size?: components["parameters"]["PageSize"];
3585
+ };
3586
+ header?: never;
3587
+ path: {
3588
+ /**
3589
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
3590
+ * which is why the key is what addresses the account.
3591
+ */
3592
+ accountKey: components["parameters"]["AccountKey"];
3593
+ };
3594
+ cookie?: never;
3595
+ };
3596
+ requestBody?: never;
3597
+ responses: {
3598
+ /** @description OK */
3599
+ 200: {
3600
+ headers: {
3601
+ [name: string]: unknown;
3602
+ };
3603
+ content: {
3604
+ "application/json": components["schemas"]["VoucherList"];
3605
+ };
3606
+ };
3607
+ /** @description Error */
3608
+ default: {
3609
+ headers: {
3610
+ [name: string]: unknown;
3611
+ };
3612
+ content: {
3613
+ "application/json": components["schemas"]["Error"];
3614
+ };
3615
+ };
3616
+ };
3617
+ };
3618
+ "list-account-refunds": {
3619
+ parameters: {
3620
+ query?: {
3621
+ /** @description 1-based page number; the first page when omitted. */
3622
+ page?: components["parameters"]["Page"];
3623
+ /**
3624
+ * @description How many entries per page, at most 100.
3625
+ *
3626
+ * Every list here grows without bound — charges with resources, transactions with time. A list
3627
+ * that returns everything works on the account it was written against and quietly turns into a
3628
+ * multi-megabyte response on the one that has been running for a year.
3629
+ */
3630
+ page_size?: components["parameters"]["PageSize"];
3631
+ };
3632
+ header?: never;
3633
+ path: {
3634
+ /**
3635
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
3636
+ * which is why the key is what addresses the account.
3637
+ */
3638
+ accountKey: components["parameters"]["AccountKey"];
3639
+ };
3640
+ cookie?: never;
3641
+ };
3642
+ requestBody?: never;
3643
+ responses: {
3644
+ /** @description OK */
3645
+ 200: {
3646
+ headers: {
3647
+ [name: string]: unknown;
3648
+ };
3649
+ content: {
3650
+ "application/json": components["schemas"]["AccountRefundList"];
3651
+ };
3652
+ };
3653
+ /** @description Error */
3654
+ default: {
3655
+ headers: {
3656
+ [name: string]: unknown;
3657
+ };
3658
+ content: {
3659
+ "application/json": components["schemas"]["Error"];
3660
+ };
3661
+ };
3662
+ };
3663
+ };
2657
3664
  }