Skip to content

Commit 38298ff

Browse files
feat(api)!: add semi_annual cadence and remove metadata from update items (#2)
1 parent 846d155 commit 38298ff

18 files changed

+2828
-336
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 90
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-a6a1b7ffd49d131bfc4a1e8e508ac1fe23875c64b27c99f97dd4df06ea5e3ff5.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-6bef7452aabfcad0e298c7e0bbbd90aa6a1d954ad99a04fe756b827fd12a7ce9.yml

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,7 @@ private constructor(
15471547
private val nextAttemptAt: JsonField<OffsetDateTime>,
15481548
private val previouslyAttemptedAt: JsonField<OffsetDateTime>,
15491549
private val enabled: JsonField<Boolean>,
1550+
private val numAttempts: JsonField<Long>,
15501551
private val additionalProperties: Map<String, JsonValue>,
15511552
) {
15521553

@@ -1576,6 +1577,10 @@ private constructor(
15761577
/** True only if auto-collection is enabled for this invoice. */
15771578
fun enabled(): Optional<Boolean> = Optional.ofNullable(enabled.getNullable("enabled"))
15781579

1580+
/** Number of auto-collection payment attempts. */
1581+
fun numAttempts(): Optional<Long> =
1582+
Optional.ofNullable(numAttempts.getNullable("num_attempts"))
1583+
15791584
/**
15801585
* If the invoice is scheduled for auto-collection, this field will reflect when the next
15811586
* attempt will occur. If dunning has been exhausted, or auto-collection is not enabled for
@@ -1598,6 +1603,9 @@ private constructor(
15981603
/** True only if auto-collection is enabled for this invoice. */
15991604
@JsonProperty("enabled") @ExcludeMissing fun _enabled() = enabled
16001605

1606+
/** Number of auto-collection payment attempts. */
1607+
@JsonProperty("num_attempts") @ExcludeMissing fun _numAttempts() = numAttempts
1608+
16011609
@JsonAnyGetter
16021610
@ExcludeMissing
16031611
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
@@ -1607,6 +1615,7 @@ private constructor(
16071615
nextAttemptAt()
16081616
previouslyAttemptedAt()
16091617
enabled()
1618+
numAttempts()
16101619
validated = true
16111620
}
16121621
}
@@ -1622,6 +1631,7 @@ private constructor(
16221631
this.nextAttemptAt == other.nextAttemptAt &&
16231632
this.previouslyAttemptedAt == other.previouslyAttemptedAt &&
16241633
this.enabled == other.enabled &&
1634+
this.numAttempts == other.numAttempts &&
16251635
this.additionalProperties == other.additionalProperties
16261636
}
16271637

@@ -1632,14 +1642,15 @@ private constructor(
16321642
nextAttemptAt,
16331643
previouslyAttemptedAt,
16341644
enabled,
1645+
numAttempts,
16351646
additionalProperties,
16361647
)
16371648
}
16381649
return hashCode
16391650
}
16401651

16411652
override fun toString() =
1642-
"AutoCollection{nextAttemptAt=$nextAttemptAt, previouslyAttemptedAt=$previouslyAttemptedAt, enabled=$enabled, additionalProperties=$additionalProperties}"
1653+
"AutoCollection{nextAttemptAt=$nextAttemptAt, previouslyAttemptedAt=$previouslyAttemptedAt, enabled=$enabled, numAttempts=$numAttempts, additionalProperties=$additionalProperties}"
16431654

16441655
companion object {
16451656

@@ -1651,13 +1662,15 @@ private constructor(
16511662
private var nextAttemptAt: JsonField<OffsetDateTime> = JsonMissing.of()
16521663
private var previouslyAttemptedAt: JsonField<OffsetDateTime> = JsonMissing.of()
16531664
private var enabled: JsonField<Boolean> = JsonMissing.of()
1665+
private var numAttempts: JsonField<Long> = JsonMissing.of()
16541666
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
16551667

16561668
@JvmSynthetic
16571669
internal fun from(autoCollection: AutoCollection) = apply {
16581670
this.nextAttemptAt = autoCollection.nextAttemptAt
16591671
this.previouslyAttemptedAt = autoCollection.previouslyAttemptedAt
16601672
this.enabled = autoCollection.enabled
1673+
this.numAttempts = autoCollection.numAttempts
16611674
additionalProperties(autoCollection.additionalProperties)
16621675
}
16631676

@@ -1713,6 +1726,14 @@ private constructor(
17131726
@ExcludeMissing
17141727
fun enabled(enabled: JsonField<Boolean>) = apply { this.enabled = enabled }
17151728

1729+
/** Number of auto-collection payment attempts. */
1730+
fun numAttempts(numAttempts: Long) = numAttempts(JsonField.of(numAttempts))
1731+
1732+
/** Number of auto-collection payment attempts. */
1733+
@JsonProperty("num_attempts")
1734+
@ExcludeMissing
1735+
fun numAttempts(numAttempts: JsonField<Long>) = apply { this.numAttempts = numAttempts }
1736+
17161737
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
17171738
this.additionalProperties.clear()
17181739
this.additionalProperties.putAll(additionalProperties)
@@ -1732,6 +1753,7 @@ private constructor(
17321753
nextAttemptAt,
17331754
previouslyAttemptedAt,
17341755
enabled,
1756+
numAttempts,
17351757
additionalProperties.toUnmodifiable(),
17361758
)
17371759
}

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

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ constructor(
2727
private val lineItems: List<LineItem>,
2828
private val netTerms: Long,
2929
private val customerId: String?,
30+
private val discount: Discount?,
3031
private val externalCustomerId: String?,
3132
private val memo: String?,
3233
private val metadata: Metadata?,
@@ -46,6 +47,8 @@ constructor(
4647

4748
fun customerId(): Optional<String> = Optional.ofNullable(customerId)
4849

50+
fun discount(): Optional<Discount> = Optional.ofNullable(discount)
51+
4952
fun externalCustomerId(): Optional<String> = Optional.ofNullable(externalCustomerId)
5053

5154
fun memo(): Optional<String> = Optional.ofNullable(memo)
@@ -62,6 +65,7 @@ constructor(
6265
lineItems,
6366
netTerms,
6467
customerId,
68+
discount,
6569
externalCustomerId,
6670
memo,
6771
metadata,
@@ -83,6 +87,7 @@ constructor(
8387
private val lineItems: List<LineItem>?,
8488
private val netTerms: Long?,
8589
private val customerId: String?,
90+
private val discount: Discount?,
8691
private val externalCustomerId: String?,
8792
private val memo: String?,
8893
private val metadata: Metadata?,
@@ -118,6 +123,9 @@ constructor(
118123
*/
119124
@JsonProperty("customer_id") fun customerId(): String? = customerId
120125

126+
/** An optional discount to attach to the invoice. */
127+
@JsonProperty("discount") fun discount(): Discount? = discount
128+
121129
/**
122130
* The `external_customer_id` of the `Customer` to create this invoice for. One of
123131
* `customer_id` and `external_customer_id` are required.
@@ -157,6 +165,7 @@ constructor(
157165
this.lineItems == other.lineItems &&
158166
this.netTerms == other.netTerms &&
159167
this.customerId == other.customerId &&
168+
this.discount == other.discount &&
160169
this.externalCustomerId == other.externalCustomerId &&
161170
this.memo == other.memo &&
162171
this.metadata == other.metadata &&
@@ -173,6 +182,7 @@ constructor(
173182
lineItems,
174183
netTerms,
175184
customerId,
185+
discount,
176186
externalCustomerId,
177187
memo,
178188
metadata,
@@ -184,7 +194,7 @@ constructor(
184194
}
185195

186196
override fun toString() =
187-
"InvoiceCreateBody{currency=$currency, invoiceDate=$invoiceDate, lineItems=$lineItems, netTerms=$netTerms, customerId=$customerId, externalCustomerId=$externalCustomerId, memo=$memo, metadata=$metadata, willAutoIssue=$willAutoIssue, additionalProperties=$additionalProperties}"
197+
"InvoiceCreateBody{currency=$currency, invoiceDate=$invoiceDate, lineItems=$lineItems, netTerms=$netTerms, customerId=$customerId, discount=$discount, externalCustomerId=$externalCustomerId, memo=$memo, metadata=$metadata, willAutoIssue=$willAutoIssue, additionalProperties=$additionalProperties}"
188198

189199
companion object {
190200

@@ -198,6 +208,7 @@ constructor(
198208
private var lineItems: List<LineItem>? = null
199209
private var netTerms: Long? = null
200210
private var customerId: String? = null
211+
private var discount: Discount? = null
201212
private var externalCustomerId: String? = null
202213
private var memo: String? = null
203214
private var metadata: Metadata? = null
@@ -211,6 +222,7 @@ constructor(
211222
this.lineItems = invoiceCreateBody.lineItems
212223
this.netTerms = invoiceCreateBody.netTerms
213224
this.customerId = invoiceCreateBody.customerId
225+
this.discount = invoiceCreateBody.discount
214226
this.externalCustomerId = invoiceCreateBody.externalCustomerId
215227
this.memo = invoiceCreateBody.memo
216228
this.metadata = invoiceCreateBody.metadata
@@ -251,6 +263,10 @@ constructor(
251263
@JsonProperty("customer_id")
252264
fun customerId(customerId: String) = apply { this.customerId = customerId }
253265

266+
/** An optional discount to attach to the invoice. */
267+
@JsonProperty("discount")
268+
fun discount(discount: Discount) = apply { this.discount = discount }
269+
254270
/**
255271
* The `external_customer_id` of the `Customer` to create this invoice for. One of
256272
* `customer_id` and `external_customer_id` are required.
@@ -300,6 +316,7 @@ constructor(
300316
.toUnmodifiable(),
301317
checkNotNull(netTerms) { "`netTerms` is required but was not set" },
302318
customerId,
319+
discount,
303320
externalCustomerId,
304321
memo,
305322
metadata,
@@ -326,6 +343,7 @@ constructor(
326343
this.lineItems == other.lineItems &&
327344
this.netTerms == other.netTerms &&
328345
this.customerId == other.customerId &&
346+
this.discount == other.discount &&
329347
this.externalCustomerId == other.externalCustomerId &&
330348
this.memo == other.memo &&
331349
this.metadata == other.metadata &&
@@ -342,6 +360,7 @@ constructor(
342360
lineItems,
343361
netTerms,
344362
customerId,
363+
discount,
345364
externalCustomerId,
346365
memo,
347366
metadata,
@@ -353,7 +372,7 @@ constructor(
353372
}
354373

355374
override fun toString() =
356-
"InvoiceCreateParams{currency=$currency, invoiceDate=$invoiceDate, lineItems=$lineItems, netTerms=$netTerms, customerId=$customerId, externalCustomerId=$externalCustomerId, memo=$memo, metadata=$metadata, willAutoIssue=$willAutoIssue, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
375+
"InvoiceCreateParams{currency=$currency, invoiceDate=$invoiceDate, lineItems=$lineItems, netTerms=$netTerms, customerId=$customerId, discount=$discount, externalCustomerId=$externalCustomerId, memo=$memo, metadata=$metadata, willAutoIssue=$willAutoIssue, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
357376

358377
fun toBuilder() = Builder().from(this)
359378

@@ -370,6 +389,7 @@ constructor(
370389
private var lineItems: MutableList<LineItem> = mutableListOf()
371390
private var netTerms: Long? = null
372391
private var customerId: String? = null
392+
private var discount: Discount? = null
373393
private var externalCustomerId: String? = null
374394
private var memo: String? = null
375395
private var metadata: Metadata? = null
@@ -385,6 +405,7 @@ constructor(
385405
this.lineItems(invoiceCreateParams.lineItems)
386406
this.netTerms = invoiceCreateParams.netTerms
387407
this.customerId = invoiceCreateParams.customerId
408+
this.discount = invoiceCreateParams.discount
388409
this.externalCustomerId = invoiceCreateParams.externalCustomerId
389410
this.memo = invoiceCreateParams.memo
390411
this.metadata = invoiceCreateParams.metadata
@@ -425,6 +446,29 @@ constructor(
425446
*/
426447
fun customerId(customerId: String) = apply { this.customerId = customerId }
427448

449+
/** An optional discount to attach to the invoice. */
450+
fun discount(discount: Discount) = apply { this.discount = discount }
451+
452+
/** An optional discount to attach to the invoice. */
453+
fun discount(percentageDiscount: Discount.PercentageDiscount) = apply {
454+
this.discount = Discount.ofPercentageDiscount(percentageDiscount)
455+
}
456+
457+
/** An optional discount to attach to the invoice. */
458+
fun discount(trialDiscount: Discount.TrialDiscount) = apply {
459+
this.discount = Discount.ofTrialDiscount(trialDiscount)
460+
}
461+
462+
/** An optional discount to attach to the invoice. */
463+
fun discount(usageDiscount: Discount.UsageDiscount) = apply {
464+
this.discount = Discount.ofUsageDiscount(usageDiscount)
465+
}
466+
467+
/** An optional discount to attach to the invoice. */
468+
fun discount(amountDiscount: Discount.AmountDiscount) = apply {
469+
this.discount = Discount.ofAmountDiscount(amountDiscount)
470+
}
471+
428472
/**
429473
* The `external_customer_id` of the `Customer` to create this invoice for. One of
430474
* `customer_id` and `external_customer_id` are required.
@@ -511,6 +555,7 @@ constructor(
511555
.toUnmodifiable(),
512556
checkNotNull(netTerms) { "`netTerms` is required but was not set" },
513557
customerId,
558+
discount,
514559
externalCustomerId,
515560
memo,
516561
metadata,

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ private constructor(
15411541
private val nextAttemptAt: JsonField<OffsetDateTime>,
15421542
private val previouslyAttemptedAt: JsonField<OffsetDateTime>,
15431543
private val enabled: JsonField<Boolean>,
1544+
private val numAttempts: JsonField<Long>,
15441545
private val additionalProperties: Map<String, JsonValue>,
15451546
) {
15461547

@@ -1570,6 +1571,10 @@ private constructor(
15701571
/** True only if auto-collection is enabled for this invoice. */
15711572
fun enabled(): Optional<Boolean> = Optional.ofNullable(enabled.getNullable("enabled"))
15721573

1574+
/** Number of auto-collection payment attempts. */
1575+
fun numAttempts(): Optional<Long> =
1576+
Optional.ofNullable(numAttempts.getNullable("num_attempts"))
1577+
15731578
/**
15741579
* If the invoice is scheduled for auto-collection, this field will reflect when the next
15751580
* attempt will occur. If dunning has been exhausted, or auto-collection is not enabled for
@@ -1592,6 +1597,9 @@ private constructor(
15921597
/** True only if auto-collection is enabled for this invoice. */
15931598
@JsonProperty("enabled") @ExcludeMissing fun _enabled() = enabled
15941599

1600+
/** Number of auto-collection payment attempts. */
1601+
@JsonProperty("num_attempts") @ExcludeMissing fun _numAttempts() = numAttempts
1602+
15951603
@JsonAnyGetter
15961604
@ExcludeMissing
15971605
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
@@ -1601,6 +1609,7 @@ private constructor(
16011609
nextAttemptAt()
16021610
previouslyAttemptedAt()
16031611
enabled()
1612+
numAttempts()
16041613
validated = true
16051614
}
16061615
}
@@ -1616,6 +1625,7 @@ private constructor(
16161625
this.nextAttemptAt == other.nextAttemptAt &&
16171626
this.previouslyAttemptedAt == other.previouslyAttemptedAt &&
16181627
this.enabled == other.enabled &&
1628+
this.numAttempts == other.numAttempts &&
16191629
this.additionalProperties == other.additionalProperties
16201630
}
16211631

@@ -1626,14 +1636,15 @@ private constructor(
16261636
nextAttemptAt,
16271637
previouslyAttemptedAt,
16281638
enabled,
1639+
numAttempts,
16291640
additionalProperties,
16301641
)
16311642
}
16321643
return hashCode
16331644
}
16341645

16351646
override fun toString() =
1636-
"AutoCollection{nextAttemptAt=$nextAttemptAt, previouslyAttemptedAt=$previouslyAttemptedAt, enabled=$enabled, additionalProperties=$additionalProperties}"
1647+
"AutoCollection{nextAttemptAt=$nextAttemptAt, previouslyAttemptedAt=$previouslyAttemptedAt, enabled=$enabled, numAttempts=$numAttempts, additionalProperties=$additionalProperties}"
16371648

16381649
companion object {
16391650

@@ -1645,13 +1656,15 @@ private constructor(
16451656
private var nextAttemptAt: JsonField<OffsetDateTime> = JsonMissing.of()
16461657
private var previouslyAttemptedAt: JsonField<OffsetDateTime> = JsonMissing.of()
16471658
private var enabled: JsonField<Boolean> = JsonMissing.of()
1659+
private var numAttempts: JsonField<Long> = JsonMissing.of()
16481660
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
16491661

16501662
@JvmSynthetic
16511663
internal fun from(autoCollection: AutoCollection) = apply {
16521664
this.nextAttemptAt = autoCollection.nextAttemptAt
16531665
this.previouslyAttemptedAt = autoCollection.previouslyAttemptedAt
16541666
this.enabled = autoCollection.enabled
1667+
this.numAttempts = autoCollection.numAttempts
16551668
additionalProperties(autoCollection.additionalProperties)
16561669
}
16571670

@@ -1707,6 +1720,14 @@ private constructor(
17071720
@ExcludeMissing
17081721
fun enabled(enabled: JsonField<Boolean>) = apply { this.enabled = enabled }
17091722

1723+
/** Number of auto-collection payment attempts. */
1724+
fun numAttempts(numAttempts: Long) = numAttempts(JsonField.of(numAttempts))
1725+
1726+
/** Number of auto-collection payment attempts. */
1727+
@JsonProperty("num_attempts")
1728+
@ExcludeMissing
1729+
fun numAttempts(numAttempts: JsonField<Long>) = apply { this.numAttempts = numAttempts }
1730+
17101731
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
17111732
this.additionalProperties.clear()
17121733
this.additionalProperties.putAll(additionalProperties)
@@ -1726,6 +1747,7 @@ private constructor(
17261747
nextAttemptAt,
17271748
previouslyAttemptedAt,
17281749
enabled,
1750+
numAttempts,
17291751
additionalProperties.toUnmodifiable(),
17301752
)
17311753
}

0 commit comments

Comments
 (0)