Skip to content

Commit ae30365

Browse files
feat(api): api update (#313)
1 parent 63f9206 commit ae30365

15 files changed

Lines changed: 569 additions & 284 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-48084a007f009b4358484f09a3a7b74a990c402669f9d15adfbb60e4f835f951.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-a2c1aa029d1e72a5fc7d3c6cd431479888ebd9a379683a2c8630da48437baa4f.yml

orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4974,7 +4974,11 @@ private constructor(
49744974
*/
49754975
fun adjustedSubtotal(): String = adjustedSubtotal.getRequired("adjusted_subtotal")
49764976

4977-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
4977+
/**
4978+
* All adjustments applied to the line item in the order they were applied based on invoice
4979+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
4980+
* -> maximums).
4981+
*/
49784982
fun adjustments(): List<Adjustment> = adjustments.getRequired("adjustments")
49794983

49804984
/**
@@ -5076,7 +5080,11 @@ private constructor(
50765080
@ExcludeMissing
50775081
fun _adjustedSubtotal(): JsonField<String> = adjustedSubtotal
50785082

5079-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5083+
/**
5084+
* All adjustments applied to the line item in the order they were applied based on invoice
5085+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
5086+
* -> maximums).
5087+
*/
50805088
@JsonProperty("adjustments")
50815089
@ExcludeMissing
50825090
fun _adjustments(): JsonField<List<Adjustment>> = adjustments
@@ -5334,40 +5342,72 @@ private constructor(
53345342
this.adjustedSubtotal = adjustedSubtotal
53355343
}
53365344

5337-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5345+
/**
5346+
* All adjustments applied to the line item in the order they were applied based on
5347+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5348+
* -> minimums -> maximums).
5349+
*/
53385350
fun adjustments(adjustments: List<Adjustment>) = adjustments(JsonField.of(adjustments))
53395351

5340-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5352+
/**
5353+
* All adjustments applied to the line item in the order they were applied based on
5354+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5355+
* -> minimums -> maximums).
5356+
*/
53415357
fun adjustments(adjustments: JsonField<List<Adjustment>>) = apply {
53425358
this.adjustments = adjustments.map { it.toMutableList() }
53435359
}
53445360

5345-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5361+
/**
5362+
* All adjustments applied to the line item in the order they were applied based on
5363+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5364+
* -> minimums -> maximums).
5365+
*/
53465366
fun addAdjustment(adjustment: Adjustment) = apply {
53475367
adjustments =
53485368
(adjustments ?: JsonField.of(mutableListOf())).also {
53495369
checkKnown("adjustments", it).add(adjustment)
53505370
}
53515371
}
53525372

5353-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5373+
/**
5374+
* All adjustments applied to the line item in the order they were applied based on
5375+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5376+
* -> minimums -> maximums).
5377+
*/
53545378
fun addAdjustment(monetaryUsageDiscount: Adjustment.MonetaryUsageDiscountAdjustment) =
53555379
addAdjustment(Adjustment.ofMonetaryUsageDiscount(monetaryUsageDiscount))
53565380

5357-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5381+
/**
5382+
* All adjustments applied to the line item in the order they were applied based on
5383+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5384+
* -> minimums -> maximums).
5385+
*/
53585386
fun addAdjustment(monetaryAmountDiscount: Adjustment.MonetaryAmountDiscountAdjustment) =
53595387
addAdjustment(Adjustment.ofMonetaryAmountDiscount(monetaryAmountDiscount))
53605388

5361-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5389+
/**
5390+
* All adjustments applied to the line item in the order they were applied based on
5391+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5392+
* -> minimums -> maximums).
5393+
*/
53625394
fun addAdjustment(
53635395
monetaryPercentageDiscount: Adjustment.MonetaryPercentageDiscountAdjustment
53645396
) = addAdjustment(Adjustment.ofMonetaryPercentageDiscount(monetaryPercentageDiscount))
53655397

5366-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5398+
/**
5399+
* All adjustments applied to the line item in the order they were applied based on
5400+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5401+
* -> minimums -> maximums).
5402+
*/
53675403
fun addAdjustment(monetaryMinimum: Adjustment.MonetaryMinimumAdjustment) =
53685404
addAdjustment(Adjustment.ofMonetaryMinimum(monetaryMinimum))
53695405

5370-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5406+
/**
5407+
* All adjustments applied to the line item in the order they were applied based on
5408+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5409+
* -> minimums -> maximums).
5410+
*/
53715411
fun addAdjustment(monetaryMaximum: Adjustment.MonetaryMaximumAdjustment) =
53725412
addAdjustment(Adjustment.ofMonetaryMaximum(monetaryMaximum))
53735413

orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4967,7 +4967,11 @@ private constructor(
49674967
*/
49684968
fun adjustedSubtotal(): String = adjustedSubtotal.getRequired("adjusted_subtotal")
49694969

4970-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
4970+
/**
4971+
* All adjustments applied to the line item in the order they were applied based on invoice
4972+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
4973+
* -> maximums).
4974+
*/
49714975
fun adjustments(): List<Adjustment> = adjustments.getRequired("adjustments")
49724976

49734977
/**
@@ -5069,7 +5073,11 @@ private constructor(
50695073
@ExcludeMissing
50705074
fun _adjustedSubtotal(): JsonField<String> = adjustedSubtotal
50715075

5072-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5076+
/**
5077+
* All adjustments applied to the line item in the order they were applied based on invoice
5078+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
5079+
* -> maximums).
5080+
*/
50735081
@JsonProperty("adjustments")
50745082
@ExcludeMissing
50755083
fun _adjustments(): JsonField<List<Adjustment>> = adjustments
@@ -5327,40 +5335,72 @@ private constructor(
53275335
this.adjustedSubtotal = adjustedSubtotal
53285336
}
53295337

5330-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5338+
/**
5339+
* All adjustments applied to the line item in the order they were applied based on
5340+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5341+
* -> minimums -> maximums).
5342+
*/
53315343
fun adjustments(adjustments: List<Adjustment>) = adjustments(JsonField.of(adjustments))
53325344

5333-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5345+
/**
5346+
* All adjustments applied to the line item in the order they were applied based on
5347+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5348+
* -> minimums -> maximums).
5349+
*/
53345350
fun adjustments(adjustments: JsonField<List<Adjustment>>) = apply {
53355351
this.adjustments = adjustments.map { it.toMutableList() }
53365352
}
53375353

5338-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5354+
/**
5355+
* All adjustments applied to the line item in the order they were applied based on
5356+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5357+
* -> minimums -> maximums).
5358+
*/
53395359
fun addAdjustment(adjustment: Adjustment) = apply {
53405360
adjustments =
53415361
(adjustments ?: JsonField.of(mutableListOf())).also {
53425362
checkKnown("adjustments", it).add(adjustment)
53435363
}
53445364
}
53455365

5346-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5366+
/**
5367+
* All adjustments applied to the line item in the order they were applied based on
5368+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5369+
* -> minimums -> maximums).
5370+
*/
53475371
fun addAdjustment(monetaryUsageDiscount: Adjustment.MonetaryUsageDiscountAdjustment) =
53485372
addAdjustment(Adjustment.ofMonetaryUsageDiscount(monetaryUsageDiscount))
53495373

5350-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5374+
/**
5375+
* All adjustments applied to the line item in the order they were applied based on
5376+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5377+
* -> minimums -> maximums).
5378+
*/
53515379
fun addAdjustment(monetaryAmountDiscount: Adjustment.MonetaryAmountDiscountAdjustment) =
53525380
addAdjustment(Adjustment.ofMonetaryAmountDiscount(monetaryAmountDiscount))
53535381

5354-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5382+
/**
5383+
* All adjustments applied to the line item in the order they were applied based on
5384+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5385+
* -> minimums -> maximums).
5386+
*/
53555387
fun addAdjustment(
53565388
monetaryPercentageDiscount: Adjustment.MonetaryPercentageDiscountAdjustment
53575389
) = addAdjustment(Adjustment.ofMonetaryPercentageDiscount(monetaryPercentageDiscount))
53585390

5359-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5391+
/**
5392+
* All adjustments applied to the line item in the order they were applied based on
5393+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5394+
* -> minimums -> maximums).
5395+
*/
53605396
fun addAdjustment(monetaryMinimum: Adjustment.MonetaryMinimumAdjustment) =
53615397
addAdjustment(Adjustment.ofMonetaryMinimum(monetaryMinimum))
53625398

5363-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
5399+
/**
5400+
* All adjustments applied to the line item in the order they were applied based on
5401+
* invoice calculations (ie. usage discounts -> amount discounts -> percentage discounts
5402+
* -> minimums -> maximums).
5403+
*/
53645404
fun addAdjustment(monetaryMaximum: Adjustment.MonetaryMaximumAdjustment) =
53655405
addAdjustment(Adjustment.ofMonetaryMaximum(monetaryMaximum))
53665406

orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ private constructor(
108108
*/
109109
fun adjustedSubtotal(): String = adjustedSubtotal.getRequired("adjusted_subtotal")
110110

111-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
111+
/**
112+
* All adjustments applied to the line item in the order they were applied based on invoice
113+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums ->
114+
* maximums).
115+
*/
112116
fun adjustments(): List<Adjustment> = adjustments.getRequired("adjustments")
113117

114118
/**
@@ -209,7 +213,11 @@ private constructor(
209213
@ExcludeMissing
210214
fun _adjustedSubtotal(): JsonField<String> = adjustedSubtotal
211215

212-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
216+
/**
217+
* All adjustments applied to the line item in the order they were applied based on invoice
218+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums ->
219+
* maximums).
220+
*/
213221
@JsonProperty("adjustments")
214222
@ExcludeMissing
215223
fun _adjustments(): JsonField<List<Adjustment>> = adjustments
@@ -466,40 +474,72 @@ private constructor(
466474
this.adjustedSubtotal = adjustedSubtotal
467475
}
468476

469-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
477+
/**
478+
* All adjustments applied to the line item in the order they were applied based on invoice
479+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
480+
* -> maximums).
481+
*/
470482
fun adjustments(adjustments: List<Adjustment>) = adjustments(JsonField.of(adjustments))
471483

472-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
484+
/**
485+
* All adjustments applied to the line item in the order they were applied based on invoice
486+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
487+
* -> maximums).
488+
*/
473489
fun adjustments(adjustments: JsonField<List<Adjustment>>) = apply {
474490
this.adjustments = adjustments.map { it.toMutableList() }
475491
}
476492

477-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
493+
/**
494+
* All adjustments applied to the line item in the order they were applied based on invoice
495+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
496+
* -> maximums).
497+
*/
478498
fun addAdjustment(adjustment: Adjustment) = apply {
479499
adjustments =
480500
(adjustments ?: JsonField.of(mutableListOf())).also {
481501
checkKnown("adjustments", it).add(adjustment)
482502
}
483503
}
484504

485-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
505+
/**
506+
* All adjustments applied to the line item in the order they were applied based on invoice
507+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
508+
* -> maximums).
509+
*/
486510
fun addAdjustment(monetaryUsageDiscount: Adjustment.MonetaryUsageDiscountAdjustment) =
487511
addAdjustment(Adjustment.ofMonetaryUsageDiscount(monetaryUsageDiscount))
488512

489-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
513+
/**
514+
* All adjustments applied to the line item in the order they were applied based on invoice
515+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
516+
* -> maximums).
517+
*/
490518
fun addAdjustment(monetaryAmountDiscount: Adjustment.MonetaryAmountDiscountAdjustment) =
491519
addAdjustment(Adjustment.ofMonetaryAmountDiscount(monetaryAmountDiscount))
492520

493-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
521+
/**
522+
* All adjustments applied to the line item in the order they were applied based on invoice
523+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
524+
* -> maximums).
525+
*/
494526
fun addAdjustment(
495527
monetaryPercentageDiscount: Adjustment.MonetaryPercentageDiscountAdjustment
496528
) = addAdjustment(Adjustment.ofMonetaryPercentageDiscount(monetaryPercentageDiscount))
497529

498-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
530+
/**
531+
* All adjustments applied to the line item in the order they were applied based on invoice
532+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
533+
* -> maximums).
534+
*/
499535
fun addAdjustment(monetaryMinimum: Adjustment.MonetaryMinimumAdjustment) =
500536
addAdjustment(Adjustment.ofMonetaryMinimum(monetaryMinimum))
501537

502-
/** All adjustments (ie. maximums, minimums, discounts) applied to the line item. */
538+
/**
539+
* All adjustments applied to the line item in the order they were applied based on invoice
540+
* calculations (ie. usage discounts -> amount discounts -> percentage discounts -> minimums
541+
* -> maximums).
542+
*/
503543
fun addAdjustment(monetaryMaximum: Adjustment.MonetaryMaximumAdjustment) =
504544
addAdjustment(Adjustment.ofMonetaryMaximum(monetaryMaximum))
505545

0 commit comments

Comments
 (0)