Skip to content

Commit d9b5f74

Browse files
feat(api): api update
1 parent 0fac99b commit d9b5f74

11 files changed

+83
-43
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 116
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-a44cccd16bb58080f7cc0669999403f6ed3f77287fad901caa6fd2523f2fbafd.yml
3-
openapi_spec_hash: af6444648d0b2a70b7f7ad234bd37541
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-1aabbd8715a871e993abf67f0bf9c1d6793b4f197c4b2f11fc7a76453590cd6c.yml
3+
openapi_spec_hash: 3e5878f87e74881d882a69e1ccdc25a3
44
config_hash: 1f535c1fa222aacf28b636eed21bec72

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private constructor(
136136

137137
fun externalCustomerId(): Optional<String> = Optional.ofNullable(externalCustomerId)
138138

139-
/** The currency to use. */
139+
/** The currency or custom pricing unit to use. */
140140
fun currency(): Optional<String> = Optional.ofNullable(currency)
141141

142142
/** Costs returned are exclusive of `timeframe_end`. */
@@ -205,7 +205,7 @@ private constructor(
205205
fun externalCustomerId(externalCustomerId: Optional<String>) =
206206
externalCustomerId(externalCustomerId.getOrNull())
207207

208-
/** The currency to use. */
208+
/** The currency or custom pricing unit to use. */
209209
fun currency(currency: String?) = apply { this.currency = currency }
210210

211211
/** Alias for calling [Builder.currency] with `currency.orElse(null)`. */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private constructor(
136136

137137
fun customerId(): Optional<String> = Optional.ofNullable(customerId)
138138

139-
/** The currency to use. */
139+
/** The currency or custom pricing unit to use. */
140140
fun currency(): Optional<String> = Optional.ofNullable(currency)
141141

142142
/** Costs returned are exclusive of `timeframe_end`. */
@@ -195,7 +195,7 @@ private constructor(
195195
/** Alias for calling [Builder.customerId] with `customerId.orElse(null)`. */
196196
fun customerId(customerId: Optional<String>) = customerId(customerId.getOrNull())
197197

198-
/** The currency to use. */
198+
/** The currency or custom pricing unit to use. */
199199
fun currency(currency: String?) = apply { this.currency = currency }
200200

201201
/** Alias for calling [Builder.currency] with `currency.orElse(null)`. */

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,11 +1229,10 @@ private constructor(
12291229
* date for the invoice. If you intend the invoice to be due on issue, set this
12301230
* to 0.
12311231
*
1232-
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is
1233-
* unexpectedly missing or null (e.g. if the server responded with an unexpected
1234-
* value).
1232+
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
1233+
* the server responded with an unexpected value).
12351234
*/
1236-
fun netTerms(): Long = netTerms.getRequired("net_terms")
1235+
fun netTerms(): Optional<Long> = netTerms.getOptional("net_terms")
12371236

12381237
/**
12391238
* An ISO 8601 format date that denotes when this invoice should be dated in the
@@ -1380,7 +1379,17 @@ private constructor(
13801379
* issue date for the invoice. If you intend the invoice to be due on issue, set
13811380
* this to 0.
13821381
*/
1383-
fun netTerms(netTerms: Long) = netTerms(JsonField.of(netTerms))
1382+
fun netTerms(netTerms: Long?) = netTerms(JsonField.ofNullable(netTerms))
1383+
1384+
/**
1385+
* Alias for [Builder.netTerms].
1386+
*
1387+
* This unboxed primitive overload exists for backwards compatibility.
1388+
*/
1389+
fun netTerms(netTerms: Long) = netTerms(netTerms as Long?)
1390+
1391+
/** Alias for calling [Builder.netTerms] with `netTerms.orElse(null)`. */
1392+
fun netTerms(netTerms: Optional<Long>) = netTerms(netTerms.getOrNull())
13841393

13851394
/**
13861395
* Sets [Builder.netTerms] to an arbitrary JSON value.

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,11 +1221,10 @@ private constructor(
12211221
* date for the invoice. If you intend the invoice to be due on issue, set this
12221222
* to 0.
12231223
*
1224-
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is
1225-
* unexpectedly missing or null (e.g. if the server responded with an unexpected
1226-
* value).
1224+
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
1225+
* the server responded with an unexpected value).
12271226
*/
1228-
fun netTerms(): Long = netTerms.getRequired("net_terms")
1227+
fun netTerms(): Optional<Long> = netTerms.getOptional("net_terms")
12291228

12301229
/**
12311230
* An ISO 8601 format date that denotes when this invoice should be dated in the
@@ -1372,7 +1371,17 @@ private constructor(
13721371
* issue date for the invoice. If you intend the invoice to be due on issue, set
13731372
* this to 0.
13741373
*/
1375-
fun netTerms(netTerms: Long) = netTerms(JsonField.of(netTerms))
1374+
fun netTerms(netTerms: Long?) = netTerms(JsonField.ofNullable(netTerms))
1375+
1376+
/**
1377+
* Alias for [Builder.netTerms].
1378+
*
1379+
* This unboxed primitive overload exists for backwards compatibility.
1380+
*/
1381+
fun netTerms(netTerms: Long) = netTerms(netTerms as Long?)
1382+
1383+
/** Alias for calling [Builder.netTerms] with `netTerms.orElse(null)`. */
1384+
fun netTerms(netTerms: Optional<Long>) = netTerms(netTerms.getOrNull())
13761385

13771386
/**
13781387
* Sets [Builder.netTerms] to an arbitrary JSON value.

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ private constructor(
103103
fun emailDelivery(): Optional<Boolean> = body.emailDelivery()
104104

105105
/**
106-
* The external customer ID. This can only be set if empty and the customer has no past or
107-
* current subscriptions.
106+
* The external customer ID. This can only be set if the customer has no existing external
107+
* customer ID. Since this action may change usage quantities for all existing subscriptions, it
108+
* is disallowed if the customer has issued invoices with usage line items and subject to the
109+
* same restrictions as backdated subscription creation.
108110
*
109111
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
110112
* responded with an unexpected value).
@@ -632,8 +634,10 @@ private constructor(
632634
}
633635

634636
/**
635-
* The external customer ID. This can only be set if empty and the customer has no past or
636-
* current subscriptions.
637+
* The external customer ID. This can only be set if the customer has no existing external
638+
* customer ID. Since this action may change usage quantities for all existing
639+
* subscriptions, it is disallowed if the customer has issued invoices with usage line items
640+
* and subject to the same restrictions as backdated subscription creation.
637641
*/
638642
fun externalCustomerId(externalCustomerId: String?) = apply {
639643
body.externalCustomerId(externalCustomerId)
@@ -1284,8 +1288,10 @@ private constructor(
12841288
fun emailDelivery(): Optional<Boolean> = emailDelivery.getOptional("email_delivery")
12851289

12861290
/**
1287-
* The external customer ID. This can only be set if empty and the customer has no past or
1288-
* current subscriptions.
1291+
* The external customer ID. This can only be set if the customer has no existing external
1292+
* customer ID. Since this action may change usage quantities for all existing
1293+
* subscriptions, it is disallowed if the customer has issued invoices with usage line items
1294+
* and subject to the same restrictions as backdated subscription creation.
12891295
*
12901296
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
12911297
* server responded with an unexpected value).
@@ -1859,8 +1865,10 @@ private constructor(
18591865
}
18601866

18611867
/**
1862-
* The external customer ID. This can only be set if empty and the customer has no past
1863-
* or current subscriptions.
1868+
* The external customer ID. This can only be set if the customer has no existing
1869+
* external customer ID. Since this action may change usage quantities for all existing
1870+
* subscriptions, it is disallowed if the customer has issued invoices with usage line
1871+
* items and subject to the same restrictions as backdated subscription creation.
18641872
*/
18651873
fun externalCustomerId(externalCustomerId: String?) =
18661874
externalCustomerId(JsonField.ofNullable(externalCustomerId))

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ private constructor(
104104
fun emailDelivery(): Optional<Boolean> = body.emailDelivery()
105105

106106
/**
107-
* The external customer ID. This can only be set if empty and the customer has no past or
108-
* current subscriptions.
107+
* The external customer ID. This can only be set if the customer has no existing external
108+
* customer ID. Since this action may change usage quantities for all existing subscriptions, it
109+
* is disallowed if the customer has issued invoices with usage line items and subject to the
110+
* same restrictions as backdated subscription creation.
109111
*
110112
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
111113
* responded with an unexpected value).
@@ -628,8 +630,10 @@ private constructor(
628630
}
629631

630632
/**
631-
* The external customer ID. This can only be set if empty and the customer has no past or
632-
* current subscriptions.
633+
* The external customer ID. This can only be set if the customer has no existing external
634+
* customer ID. Since this action may change usage quantities for all existing
635+
* subscriptions, it is disallowed if the customer has issued invoices with usage line items
636+
* and subject to the same restrictions as backdated subscription creation.
633637
*/
634638
fun externalCustomerId(externalCustomerId: String?) = apply {
635639
body.externalCustomerId(externalCustomerId)
@@ -1280,8 +1284,10 @@ private constructor(
12801284
fun emailDelivery(): Optional<Boolean> = emailDelivery.getOptional("email_delivery")
12811285

12821286
/**
1283-
* The external customer ID. This can only be set if empty and the customer has no past or
1284-
* current subscriptions.
1287+
* The external customer ID. This can only be set if the customer has no existing external
1288+
* customer ID. Since this action may change usage quantities for all existing
1289+
* subscriptions, it is disallowed if the customer has issued invoices with usage line items
1290+
* and subject to the same restrictions as backdated subscription creation.
12851291
*
12861292
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
12871293
* server responded with an unexpected value).
@@ -1855,8 +1861,10 @@ private constructor(
18551861
}
18561862

18571863
/**
1858-
* The external customer ID. This can only be set if empty and the customer has no past
1859-
* or current subscriptions.
1864+
* The external customer ID. This can only be set if the customer has no existing
1865+
* external customer ID. Since this action may change usage quantities for all existing
1866+
* subscriptions, it is disallowed if the customer has issued invoices with usage line
1867+
* items and subject to the same restrictions as backdated subscription creation.
18601868
*/
18611869
fun externalCustomerId(externalCustomerId: String?) =
18621870
externalCustomerId(JsonField.ofNullable(externalCustomerId))

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ import java.util.Optional
2121
import kotlin.jvm.optionals.getOrNull
2222

2323
/**
24-
* This endpoint allows you to update the `metadata` property on an invoice. If you pass null for
25-
* the metadata value, it will clear any existing metadata for that invoice.
24+
* This endpoint allows you to update the `metadata`, `net_terms`, and `due_date` properties on an
25+
* invoice. If you pass null for the metadata value, it will clear any existing metadata for that
26+
* invoice.
2627
*
27-
* `metadata` can be modified regardless of invoice state.
28+
* `metadata` can be modified regardless of invoice state. `net_terms` and `due_date` can only be
29+
* modified if the invoice is in a `draft` state.
2830
*/
2931
class InvoiceUpdateParams
3032
private constructor(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private constructor(
3939

4040
fun subscriptionId(): Optional<String> = Optional.ofNullable(subscriptionId)
4141

42-
/** The currency to use. */
42+
/** The currency or custom pricing unit to use. */
4343
fun currency(): Optional<String> = Optional.ofNullable(currency)
4444

4545
/** Costs returned are exclusive of `timeframe_end`. */
@@ -101,7 +101,7 @@ private constructor(
101101
fun subscriptionId(subscriptionId: Optional<String>) =
102102
subscriptionId(subscriptionId.getOrNull())
103103

104-
/** The currency to use. */
104+
/** The currency or custom pricing unit to use. */
105105
fun currency(currency: String?) = apply { this.currency = currency }
106106

107107
/** Alias for calling [Builder.currency] with `currency.orElse(null)`. */

orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsync.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ interface InvoiceServiceAsync {
4545
): CompletableFuture<Invoice>
4646

4747
/**
48-
* This endpoint allows you to update the `metadata` property on an invoice. If you pass null
49-
* for the metadata value, it will clear any existing metadata for that invoice.
48+
* This endpoint allows you to update the `metadata`, `net_terms`, and `due_date` properties on
49+
* an invoice. If you pass null for the metadata value, it will clear any existing metadata for
50+
* that invoice.
5051
*
51-
* `metadata` can be modified regardless of invoice state.
52+
* `metadata` can be modified regardless of invoice state. `net_terms` and `due_date` can only
53+
* be modified if the invoice is in a `draft` state.
5254
*/
5355
fun update(invoiceId: String): CompletableFuture<Invoice> =
5456
update(invoiceId, InvoiceUpdateParams.none())

0 commit comments

Comments
 (0)