Skip to content

Commit 2c02d15

Browse files
feat(api): api update
1 parent c7d3dda commit 2c02d15

15 files changed

+146
-198
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: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d1abf71a1a70a43bdcc4da7104dabcbd67aa7e2d3e6cf21e33f50904b6997bb2.yml
3-
openapi_spec_hash: 28b0b31a997588cf3692458889321e1b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d74790c0b5540235e8387ccad7b806c11bcbb968fbdf99ea7dfbfc004bceb9dc.yml
3+
openapi_spec_hash: eae212fa0114d8c3b4293c35f6ed7f7f
44
config_hash: dd4343ce95871032ef6e0735a4ca038c

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import java.util.Optional
1111
import kotlin.jvm.optionals.getOrNull
1212

1313
/**
14-
* This API endpoint is in beta and its interface may change. It is recommended for use only in test
15-
* mode.
16-
*
1714
* This endpoint is used to fetch a plan version. It returns the phases, prices, and adjustments
1815
* present on this version of the plan.
1916
*/

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ import java.util.Objects
2020
import java.util.Optional
2121
import kotlin.jvm.optionals.getOrNull
2222

23-
/**
24-
* This API endpoint is in beta and its interface may change. It is recommended for use only in test
25-
* mode.
26-
*
27-
* This endpoint allows setting the default version of a plan.
28-
*/
23+
/** This endpoint allows setting the default version of a plan. */
2924
class BetaExternalPlanIdSetDefaultPlanVersionParams
3025
private constructor(
3126
private val externalPlanId: String?,

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import java.util.Optional
1111
import kotlin.jvm.optionals.getOrNull
1212

1313
/**
14-
* This API endpoint is in beta and its interface may change. It is recommended for use only in test
15-
* mode.
16-
*
1714
* This endpoint is used to fetch a plan version. It returns the phases, prices, and adjustments
1815
* present on this version of the plan.
1916
*/

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ import java.util.Objects
2020
import java.util.Optional
2121
import kotlin.jvm.optionals.getOrNull
2222

23-
/**
24-
* This API endpoint is in beta and its interface may change. It is recommended for use only in test
25-
* mode.
26-
*
27-
* This endpoint allows setting the default version of a plan.
28-
*/
23+
/** This endpoint allows setting the default version of a plan. */
2924
class BetaSetDefaultPlanVersionParams
3025
private constructor(
3126
private val planId: String?,

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

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,11 +1783,11 @@ private constructor(
17831783
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
17841784
private constructor(
17851785
private val autoCollection: JsonField<Boolean>,
1786-
private val netTerms: JsonField<Long>,
17871786
private val customDueDate: JsonField<CustomDueDate>,
17881787
private val invoiceDate: JsonField<InvoiceDate>,
17891788
private val itemId: JsonField<String>,
17901789
private val memo: JsonField<String>,
1790+
private val netTerms: JsonField<Long>,
17911791
private val requireSuccessfulPayment: JsonField<Boolean>,
17921792
private val additionalProperties: MutableMap<String, JsonValue>,
17931793
) {
@@ -1797,9 +1797,6 @@ private constructor(
17971797
@JsonProperty("auto_collection")
17981798
@ExcludeMissing
17991799
autoCollection: JsonField<Boolean> = JsonMissing.of(),
1800-
@JsonProperty("net_terms")
1801-
@ExcludeMissing
1802-
netTerms: JsonField<Long> = JsonMissing.of(),
18031800
@JsonProperty("custom_due_date")
18041801
@ExcludeMissing
18051802
customDueDate: JsonField<CustomDueDate> = JsonMissing.of(),
@@ -1812,16 +1809,19 @@ private constructor(
18121809
@JsonProperty("memo")
18131810
@ExcludeMissing
18141811
memo: JsonField<String> = JsonMissing.of(),
1812+
@JsonProperty("net_terms")
1813+
@ExcludeMissing
1814+
netTerms: JsonField<Long> = JsonMissing.of(),
18151815
@JsonProperty("require_successful_payment")
18161816
@ExcludeMissing
18171817
requireSuccessfulPayment: JsonField<Boolean> = JsonMissing.of(),
18181818
) : this(
18191819
autoCollection,
1820-
netTerms,
18211820
customDueDate,
18221821
invoiceDate,
18231822
itemId,
18241823
memo,
1824+
netTerms,
18251825
requireSuccessfulPayment,
18261826
mutableMapOf(),
18271827
)
@@ -1836,18 +1836,6 @@ private constructor(
18361836
*/
18371837
fun autoCollection(): Boolean = autoCollection.getRequired("auto_collection")
18381838

1839-
/**
1840-
* The net terms determines the due date of the invoice. Due date is calculated
1841-
* based on the invoice or issuance date, depending on the account's configured due
1842-
* date calculation method. A value of '0' here represents that the invoice is due
1843-
* on issue, whereas a value of '30' represents that the customer has 30 days to pay
1844-
* the invoice. Do not set this field if you want to set a custom due date.
1845-
*
1846-
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
1847-
* the server responded with an unexpected value).
1848-
*/
1849-
fun netTerms(): Optional<Long> = netTerms.getOptional("net_terms")
1850-
18511839
/**
18521840
* An optional custom due date for the invoice. If not set, the due date will be
18531841
* calculated based on the `net_terms` value.
@@ -1885,6 +1873,18 @@ private constructor(
18851873
*/
18861874
fun memo(): Optional<String> = memo.getOptional("memo")
18871875

1876+
/**
1877+
* The net terms determines the due date of the invoice. Due date is calculated
1878+
* based on the invoice or issuance date, depending on the account's configured due
1879+
* date calculation method. A value of '0' here represents that the invoice is due
1880+
* on issue, whereas a value of '30' represents that the customer has 30 days to pay
1881+
* the invoice. Do not set this field if you want to set a custom due date.
1882+
*
1883+
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
1884+
* the server responded with an unexpected value).
1885+
*/
1886+
fun netTerms(): Optional<Long> = netTerms.getOptional("net_terms")
1887+
18881888
/**
18891889
* If true, the new credit block will require that the corresponding invoice is paid
18901890
* before it can be drawn down from.
@@ -1905,16 +1905,6 @@ private constructor(
19051905
@ExcludeMissing
19061906
fun _autoCollection(): JsonField<Boolean> = autoCollection
19071907

1908-
/**
1909-
* Returns the raw JSON value of [netTerms].
1910-
*
1911-
* Unlike [netTerms], this method doesn't throw if the JSON field has an unexpected
1912-
* type.
1913-
*/
1914-
@JsonProperty("net_terms")
1915-
@ExcludeMissing
1916-
fun _netTerms(): JsonField<Long> = netTerms
1917-
19181908
/**
19191909
* Returns the raw JSON value of [customDueDate].
19201910
*
@@ -1951,6 +1941,16 @@ private constructor(
19511941
*/
19521942
@JsonProperty("memo") @ExcludeMissing fun _memo(): JsonField<String> = memo
19531943

1944+
/**
1945+
* Returns the raw JSON value of [netTerms].
1946+
*
1947+
* Unlike [netTerms], this method doesn't throw if the JSON field has an unexpected
1948+
* type.
1949+
*/
1950+
@JsonProperty("net_terms")
1951+
@ExcludeMissing
1952+
fun _netTerms(): JsonField<Long> = netTerms
1953+
19541954
/**
19551955
* Returns the raw JSON value of [requireSuccessfulPayment].
19561956
*
@@ -1981,7 +1981,6 @@ private constructor(
19811981
* The following fields are required:
19821982
* ```java
19831983
* .autoCollection()
1984-
* .netTerms()
19851984
* ```
19861985
*/
19871986
@JvmStatic fun builder() = Builder()
@@ -1991,22 +1990,22 @@ private constructor(
19911990
class Builder internal constructor() {
19921991

19931992
private var autoCollection: JsonField<Boolean>? = null
1994-
private var netTerms: JsonField<Long>? = null
19951993
private var customDueDate: JsonField<CustomDueDate> = JsonMissing.of()
19961994
private var invoiceDate: JsonField<InvoiceDate> = JsonMissing.of()
19971995
private var itemId: JsonField<String> = JsonMissing.of()
19981996
private var memo: JsonField<String> = JsonMissing.of()
1997+
private var netTerms: JsonField<Long> = JsonMissing.of()
19991998
private var requireSuccessfulPayment: JsonField<Boolean> = JsonMissing.of()
20001999
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
20012000

20022001
@JvmSynthetic
20032002
internal fun from(invoiceSettings: InvoiceSettings) = apply {
20042003
autoCollection = invoiceSettings.autoCollection
2005-
netTerms = invoiceSettings.netTerms
20062004
customDueDate = invoiceSettings.customDueDate
20072005
invoiceDate = invoiceSettings.invoiceDate
20082006
itemId = invoiceSettings.itemId
20092007
memo = invoiceSettings.memo
2008+
netTerms = invoiceSettings.netTerms
20102009
requireSuccessfulPayment = invoiceSettings.requireSuccessfulPayment
20112010
additionalProperties = invoiceSettings.additionalProperties.toMutableMap()
20122011
}
@@ -2029,35 +2028,6 @@ private constructor(
20292028
this.autoCollection = autoCollection
20302029
}
20312030

2032-
/**
2033-
* The net terms determines the due date of the invoice. Due date is calculated
2034-
* based on the invoice or issuance date, depending on the account's configured
2035-
* due date calculation method. A value of '0' here represents that the invoice
2036-
* is due on issue, whereas a value of '30' represents that the customer has 30
2037-
* days to pay the invoice. Do not set this field if you want to set a custom
2038-
* due date.
2039-
*/
2040-
fun netTerms(netTerms: Long?) = netTerms(JsonField.ofNullable(netTerms))
2041-
2042-
/**
2043-
* Alias for [Builder.netTerms].
2044-
*
2045-
* This unboxed primitive overload exists for backwards compatibility.
2046-
*/
2047-
fun netTerms(netTerms: Long) = netTerms(netTerms as Long?)
2048-
2049-
/** Alias for calling [Builder.netTerms] with `netTerms.orElse(null)`. */
2050-
fun netTerms(netTerms: Optional<Long>) = netTerms(netTerms.getOrNull())
2051-
2052-
/**
2053-
* Sets [Builder.netTerms] to an arbitrary JSON value.
2054-
*
2055-
* You should usually call [Builder.netTerms] with a well-typed [Long] value
2056-
* instead. This method is primarily for setting the field to an undocumented or
2057-
* not yet supported value.
2058-
*/
2059-
fun netTerms(netTerms: JsonField<Long>) = apply { this.netTerms = netTerms }
2060-
20612031
/**
20622032
* An optional custom due date for the invoice. If not set, the due date will be
20632033
* calculated based on the `net_terms` value.
@@ -2154,6 +2124,35 @@ private constructor(
21542124
*/
21552125
fun memo(memo: JsonField<String>) = apply { this.memo = memo }
21562126

2127+
/**
2128+
* The net terms determines the due date of the invoice. Due date is calculated
2129+
* based on the invoice or issuance date, depending on the account's configured
2130+
* due date calculation method. A value of '0' here represents that the invoice
2131+
* is due on issue, whereas a value of '30' represents that the customer has 30
2132+
* days to pay the invoice. Do not set this field if you want to set a custom
2133+
* due date.
2134+
*/
2135+
fun netTerms(netTerms: Long?) = netTerms(JsonField.ofNullable(netTerms))
2136+
2137+
/**
2138+
* Alias for [Builder.netTerms].
2139+
*
2140+
* This unboxed primitive overload exists for backwards compatibility.
2141+
*/
2142+
fun netTerms(netTerms: Long) = netTerms(netTerms as Long?)
2143+
2144+
/** Alias for calling [Builder.netTerms] with `netTerms.orElse(null)`. */
2145+
fun netTerms(netTerms: Optional<Long>) = netTerms(netTerms.getOrNull())
2146+
2147+
/**
2148+
* Sets [Builder.netTerms] to an arbitrary JSON value.
2149+
*
2150+
* You should usually call [Builder.netTerms] with a well-typed [Long] value
2151+
* instead. This method is primarily for setting the field to an undocumented or
2152+
* not yet supported value.
2153+
*/
2154+
fun netTerms(netTerms: JsonField<Long>) = apply { this.netTerms = netTerms }
2155+
21572156
/**
21582157
* If true, the new credit block will require that the corresponding invoice is
21592158
* paid before it can be drawn down from.
@@ -2203,19 +2202,18 @@ private constructor(
22032202
* The following fields are required:
22042203
* ```java
22052204
* .autoCollection()
2206-
* .netTerms()
22072205
* ```
22082206
*
22092207
* @throws IllegalStateException if any required field is unset.
22102208
*/
22112209
fun build(): InvoiceSettings =
22122210
InvoiceSettings(
22132211
checkRequired("autoCollection", autoCollection),
2214-
checkRequired("netTerms", netTerms),
22152212
customDueDate,
22162213
invoiceDate,
22172214
itemId,
22182215
memo,
2216+
netTerms,
22192217
requireSuccessfulPayment,
22202218
additionalProperties.toMutableMap(),
22212219
)
@@ -2229,11 +2227,11 @@ private constructor(
22292227
}
22302228

22312229
autoCollection()
2232-
netTerms()
22332230
customDueDate().ifPresent { it.validate() }
22342231
invoiceDate().ifPresent { it.validate() }
22352232
itemId()
22362233
memo()
2234+
netTerms()
22372235
requireSuccessfulPayment()
22382236
validated = true
22392237
}
@@ -2255,11 +2253,11 @@ private constructor(
22552253
@JvmSynthetic
22562254
internal fun validity(): Int =
22572255
(if (autoCollection.asKnown().isPresent) 1 else 0) +
2258-
(if (netTerms.asKnown().isPresent) 1 else 0) +
22592256
(customDueDate.asKnown().getOrNull()?.validity() ?: 0) +
22602257
(invoiceDate.asKnown().getOrNull()?.validity() ?: 0) +
22612258
(if (itemId.asKnown().isPresent) 1 else 0) +
22622259
(if (memo.asKnown().isPresent) 1 else 0) +
2260+
(if (netTerms.asKnown().isPresent) 1 else 0) +
22632261
(if (requireSuccessfulPayment.asKnown().isPresent) 1 else 0)
22642262

22652263
/**
@@ -2630,23 +2628,23 @@ private constructor(
26302628

26312629
return other is InvoiceSettings &&
26322630
autoCollection == other.autoCollection &&
2633-
netTerms == other.netTerms &&
26342631
customDueDate == other.customDueDate &&
26352632
invoiceDate == other.invoiceDate &&
26362633
itemId == other.itemId &&
26372634
memo == other.memo &&
2635+
netTerms == other.netTerms &&
26382636
requireSuccessfulPayment == other.requireSuccessfulPayment &&
26392637
additionalProperties == other.additionalProperties
26402638
}
26412639

26422640
private val hashCode: Int by lazy {
26432641
Objects.hash(
26442642
autoCollection,
2645-
netTerms,
26462643
customDueDate,
26472644
invoiceDate,
26482645
itemId,
26492646
memo,
2647+
netTerms,
26502648
requireSuccessfulPayment,
26512649
additionalProperties,
26522650
)
@@ -2655,7 +2653,7 @@ private constructor(
26552653
override fun hashCode(): Int = hashCode
26562654

26572655
override fun toString() =
2658-
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, customDueDate=$customDueDate, invoiceDate=$invoiceDate, itemId=$itemId, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
2656+
"InvoiceSettings{autoCollection=$autoCollection, customDueDate=$customDueDate, invoiceDate=$invoiceDate, itemId=$itemId, memo=$memo, netTerms=$netTerms, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
26592657
}
26602658

26612659
/**

0 commit comments

Comments
 (0)