Skip to content

Commit f101f63

Browse files
feat(api): api update
1 parent 6c895f2 commit f101f63

File tree

7 files changed

+108
-4
lines changed

7 files changed

+108
-4
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-d0eaf664d43e26c42ebf8740ff1b6ee34c4d424c7048a7f04df994cb65627f89.yml
3-
openapi_spec_hash: 4d7622040380d5c7bd2e5a5ec9b86783
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-2b5eeb4a60cbec92f80b4a54f33c2d17b36cbac4739886f737108f2ad74ff12d.yml
3+
openapi_spec_hash: ebbe8419f5831506de5b4c0b4eb56acf
44
config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2

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

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,7 @@ private constructor(
11881188
private val netTerms: JsonField<Long>,
11891189
private val customDueDate: JsonField<CustomDueDate>,
11901190
private val invoiceDate: JsonField<InvoiceDate>,
1191+
private val itemId: JsonField<String>,
11911192
private val memo: JsonField<String>,
11921193
private val requireSuccessfulPayment: JsonField<Boolean>,
11931194
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -1207,6 +1208,9 @@ private constructor(
12071208
@JsonProperty("invoice_date")
12081209
@ExcludeMissing
12091210
invoiceDate: JsonField<InvoiceDate> = JsonMissing.of(),
1211+
@JsonProperty("item_id")
1212+
@ExcludeMissing
1213+
itemId: JsonField<String> = JsonMissing.of(),
12101214
@JsonProperty("memo")
12111215
@ExcludeMissing
12121216
memo: JsonField<String> = JsonMissing.of(),
@@ -1218,6 +1222,7 @@ private constructor(
12181222
netTerms,
12191223
customDueDate,
12201224
invoiceDate,
1225+
itemId,
12211226
memo,
12221227
requireSuccessfulPayment,
12231228
mutableMapOf(),
@@ -1265,6 +1270,15 @@ private constructor(
12651270
*/
12661271
fun invoiceDate(): Optional<InvoiceDate> = invoiceDate.getOptional("invoice_date")
12671272

1273+
/**
1274+
* The ID of the Item to be used for the invoice line item. If not provided, a
1275+
* default 'Credits' item will be used.
1276+
*
1277+
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
1278+
* the server responded with an unexpected value).
1279+
*/
1280+
fun itemId(): Optional<String> = itemId.getOptional("item_id")
1281+
12681282
/**
12691283
* An optional memo to display on the invoice.
12701284
*
@@ -1323,6 +1337,14 @@ private constructor(
13231337
@ExcludeMissing
13241338
fun _invoiceDate(): JsonField<InvoiceDate> = invoiceDate
13251339

1340+
/**
1341+
* Returns the raw JSON value of [itemId].
1342+
*
1343+
* Unlike [itemId], this method doesn't throw if the JSON field has an unexpected
1344+
* type.
1345+
*/
1346+
@JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField<String> = itemId
1347+
13261348
/**
13271349
* Returns the raw JSON value of [memo].
13281350
*
@@ -1374,6 +1396,7 @@ private constructor(
13741396
private var netTerms: JsonField<Long>? = null
13751397
private var customDueDate: JsonField<CustomDueDate> = JsonMissing.of()
13761398
private var invoiceDate: JsonField<InvoiceDate> = JsonMissing.of()
1399+
private var itemId: JsonField<String> = JsonMissing.of()
13771400
private var memo: JsonField<String> = JsonMissing.of()
13781401
private var requireSuccessfulPayment: JsonField<Boolean> = JsonMissing.of()
13791402
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -1384,6 +1407,7 @@ private constructor(
13841407
netTerms = invoiceSettings.netTerms
13851408
customDueDate = invoiceSettings.customDueDate
13861409
invoiceDate = invoiceSettings.invoiceDate
1410+
itemId = invoiceSettings.itemId
13871411
memo = invoiceSettings.memo
13881412
requireSuccessfulPayment = invoiceSettings.requireSuccessfulPayment
13891413
additionalProperties = invoiceSettings.additionalProperties.toMutableMap()
@@ -1499,6 +1523,24 @@ private constructor(
14991523
fun invoiceDate(dateTime: OffsetDateTime) =
15001524
invoiceDate(InvoiceDate.ofDateTime(dateTime))
15011525

1526+
/**
1527+
* The ID of the Item to be used for the invoice line item. If not provided, a
1528+
* default 'Credits' item will be used.
1529+
*/
1530+
fun itemId(itemId: String?) = itemId(JsonField.ofNullable(itemId))
1531+
1532+
/** Alias for calling [Builder.itemId] with `itemId.orElse(null)`. */
1533+
fun itemId(itemId: Optional<String>) = itemId(itemId.getOrNull())
1534+
1535+
/**
1536+
* Sets [Builder.itemId] to an arbitrary JSON value.
1537+
*
1538+
* You should usually call [Builder.itemId] with a well-typed [String] value
1539+
* instead. This method is primarily for setting the field to an undocumented or
1540+
* not yet supported value.
1541+
*/
1542+
fun itemId(itemId: JsonField<String>) = apply { this.itemId = itemId }
1543+
15021544
/** An optional memo to display on the invoice. */
15031545
fun memo(memo: String?) = memo(JsonField.ofNullable(memo))
15041546

@@ -1574,6 +1616,7 @@ private constructor(
15741616
checkRequired("netTerms", netTerms),
15751617
customDueDate,
15761618
invoiceDate,
1619+
itemId,
15771620
memo,
15781621
requireSuccessfulPayment,
15791622
additionalProperties.toMutableMap(),
@@ -1591,6 +1634,7 @@ private constructor(
15911634
netTerms()
15921635
customDueDate().ifPresent { it.validate() }
15931636
invoiceDate().ifPresent { it.validate() }
1637+
itemId()
15941638
memo()
15951639
requireSuccessfulPayment()
15961640
validated = true
@@ -1616,6 +1660,7 @@ private constructor(
16161660
(if (netTerms.asKnown().isPresent) 1 else 0) +
16171661
(customDueDate.asKnown().getOrNull()?.validity() ?: 0) +
16181662
(invoiceDate.asKnown().getOrNull()?.validity() ?: 0) +
1663+
(if (itemId.asKnown().isPresent) 1 else 0) +
16191664
(if (memo.asKnown().isPresent) 1 else 0) +
16201665
(if (requireSuccessfulPayment.asKnown().isPresent) 1 else 0)
16211666

@@ -1990,6 +2035,7 @@ private constructor(
19902035
netTerms == other.netTerms &&
19912036
customDueDate == other.customDueDate &&
19922037
invoiceDate == other.invoiceDate &&
2038+
itemId == other.itemId &&
19932039
memo == other.memo &&
19942040
requireSuccessfulPayment == other.requireSuccessfulPayment &&
19952041
additionalProperties == other.additionalProperties
@@ -2001,6 +2047,7 @@ private constructor(
20012047
netTerms,
20022048
customDueDate,
20032049
invoiceDate,
2050+
itemId,
20042051
memo,
20052052
requireSuccessfulPayment,
20062053
additionalProperties,
@@ -2010,7 +2057,7 @@ private constructor(
20102057
override fun hashCode(): Int = hashCode
20112058

20122059
override fun toString() =
2013-
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, customDueDate=$customDueDate, invoiceDate=$invoiceDate, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
2060+
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, customDueDate=$customDueDate, invoiceDate=$invoiceDate, itemId=$itemId, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
20142061
}
20152062

20162063
/**

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

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ private constructor(
11801180
private val netTerms: JsonField<Long>,
11811181
private val customDueDate: JsonField<CustomDueDate>,
11821182
private val invoiceDate: JsonField<InvoiceDate>,
1183+
private val itemId: JsonField<String>,
11831184
private val memo: JsonField<String>,
11841185
private val requireSuccessfulPayment: JsonField<Boolean>,
11851186
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -1199,6 +1200,9 @@ private constructor(
11991200
@JsonProperty("invoice_date")
12001201
@ExcludeMissing
12011202
invoiceDate: JsonField<InvoiceDate> = JsonMissing.of(),
1203+
@JsonProperty("item_id")
1204+
@ExcludeMissing
1205+
itemId: JsonField<String> = JsonMissing.of(),
12021206
@JsonProperty("memo")
12031207
@ExcludeMissing
12041208
memo: JsonField<String> = JsonMissing.of(),
@@ -1210,6 +1214,7 @@ private constructor(
12101214
netTerms,
12111215
customDueDate,
12121216
invoiceDate,
1217+
itemId,
12131218
memo,
12141219
requireSuccessfulPayment,
12151220
mutableMapOf(),
@@ -1257,6 +1262,15 @@ private constructor(
12571262
*/
12581263
fun invoiceDate(): Optional<InvoiceDate> = invoiceDate.getOptional("invoice_date")
12591264

1265+
/**
1266+
* The ID of the Item to be used for the invoice line item. If not provided, a
1267+
* default 'Credits' item will be used.
1268+
*
1269+
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
1270+
* the server responded with an unexpected value).
1271+
*/
1272+
fun itemId(): Optional<String> = itemId.getOptional("item_id")
1273+
12601274
/**
12611275
* An optional memo to display on the invoice.
12621276
*
@@ -1315,6 +1329,14 @@ private constructor(
13151329
@ExcludeMissing
13161330
fun _invoiceDate(): JsonField<InvoiceDate> = invoiceDate
13171331

1332+
/**
1333+
* Returns the raw JSON value of [itemId].
1334+
*
1335+
* Unlike [itemId], this method doesn't throw if the JSON field has an unexpected
1336+
* type.
1337+
*/
1338+
@JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField<String> = itemId
1339+
13181340
/**
13191341
* Returns the raw JSON value of [memo].
13201342
*
@@ -1366,6 +1388,7 @@ private constructor(
13661388
private var netTerms: JsonField<Long>? = null
13671389
private var customDueDate: JsonField<CustomDueDate> = JsonMissing.of()
13681390
private var invoiceDate: JsonField<InvoiceDate> = JsonMissing.of()
1391+
private var itemId: JsonField<String> = JsonMissing.of()
13691392
private var memo: JsonField<String> = JsonMissing.of()
13701393
private var requireSuccessfulPayment: JsonField<Boolean> = JsonMissing.of()
13711394
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -1376,6 +1399,7 @@ private constructor(
13761399
netTerms = invoiceSettings.netTerms
13771400
customDueDate = invoiceSettings.customDueDate
13781401
invoiceDate = invoiceSettings.invoiceDate
1402+
itemId = invoiceSettings.itemId
13791403
memo = invoiceSettings.memo
13801404
requireSuccessfulPayment = invoiceSettings.requireSuccessfulPayment
13811405
additionalProperties = invoiceSettings.additionalProperties.toMutableMap()
@@ -1491,6 +1515,24 @@ private constructor(
14911515
fun invoiceDate(dateTime: OffsetDateTime) =
14921516
invoiceDate(InvoiceDate.ofDateTime(dateTime))
14931517

1518+
/**
1519+
* The ID of the Item to be used for the invoice line item. If not provided, a
1520+
* default 'Credits' item will be used.
1521+
*/
1522+
fun itemId(itemId: String?) = itemId(JsonField.ofNullable(itemId))
1523+
1524+
/** Alias for calling [Builder.itemId] with `itemId.orElse(null)`. */
1525+
fun itemId(itemId: Optional<String>) = itemId(itemId.getOrNull())
1526+
1527+
/**
1528+
* Sets [Builder.itemId] to an arbitrary JSON value.
1529+
*
1530+
* You should usually call [Builder.itemId] with a well-typed [String] value
1531+
* instead. This method is primarily for setting the field to an undocumented or
1532+
* not yet supported value.
1533+
*/
1534+
fun itemId(itemId: JsonField<String>) = apply { this.itemId = itemId }
1535+
14941536
/** An optional memo to display on the invoice. */
14951537
fun memo(memo: String?) = memo(JsonField.ofNullable(memo))
14961538

@@ -1566,6 +1608,7 @@ private constructor(
15661608
checkRequired("netTerms", netTerms),
15671609
customDueDate,
15681610
invoiceDate,
1611+
itemId,
15691612
memo,
15701613
requireSuccessfulPayment,
15711614
additionalProperties.toMutableMap(),
@@ -1583,6 +1626,7 @@ private constructor(
15831626
netTerms()
15841627
customDueDate().ifPresent { it.validate() }
15851628
invoiceDate().ifPresent { it.validate() }
1629+
itemId()
15861630
memo()
15871631
requireSuccessfulPayment()
15881632
validated = true
@@ -1608,6 +1652,7 @@ private constructor(
16081652
(if (netTerms.asKnown().isPresent) 1 else 0) +
16091653
(customDueDate.asKnown().getOrNull()?.validity() ?: 0) +
16101654
(invoiceDate.asKnown().getOrNull()?.validity() ?: 0) +
1655+
(if (itemId.asKnown().isPresent) 1 else 0) +
16111656
(if (memo.asKnown().isPresent) 1 else 0) +
16121657
(if (requireSuccessfulPayment.asKnown().isPresent) 1 else 0)
16131658

@@ -1982,6 +2027,7 @@ private constructor(
19822027
netTerms == other.netTerms &&
19832028
customDueDate == other.customDueDate &&
19842029
invoiceDate == other.invoiceDate &&
2030+
itemId == other.itemId &&
19852031
memo == other.memo &&
19862032
requireSuccessfulPayment == other.requireSuccessfulPayment &&
19872033
additionalProperties == other.additionalProperties
@@ -1993,6 +2039,7 @@ private constructor(
19932039
netTerms,
19942040
customDueDate,
19952041
invoiceDate,
2042+
itemId,
19962043
memo,
19972044
requireSuccessfulPayment,
19982045
additionalProperties,
@@ -2002,7 +2049,7 @@ private constructor(
20022049
override fun hashCode(): Int = hashCode
20032050

20042051
override fun toString() =
2005-
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, customDueDate=$customDueDate, invoiceDate=$invoiceDate, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
2052+
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, customDueDate=$customDueDate, invoiceDate=$invoiceDate, itemId=$itemId, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
20062053
}
20072054

20082055
/**

orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdParamsTest {
2929
.netTerms(0L)
3030
.customDueDate(LocalDate.parse("2019-12-27"))
3131
.invoiceDate(LocalDate.parse("2019-12-27"))
32+
.itemId("item_id")
3233
.memo("memo")
3334
.requireSuccessfulPayment(true)
3435
.build()
@@ -78,6 +79,7 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdParamsTest {
7879
.netTerms(0L)
7980
.customDueDate(LocalDate.parse("2019-12-27"))
8081
.invoiceDate(LocalDate.parse("2019-12-27"))
82+
.itemId("item_id")
8183
.memo("memo")
8284
.requireSuccessfulPayment(true)
8385
.build()
@@ -113,6 +115,7 @@ internal class CustomerCreditLedgerCreateEntryByExternalIdParamsTest {
113115
.netTerms(0L)
114116
.customDueDate(LocalDate.parse("2019-12-27"))
115117
.invoiceDate(LocalDate.parse("2019-12-27"))
118+
.itemId("item_id")
116119
.memo("memo")
117120
.requireSuccessfulPayment(true)
118121
.build()

orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ internal class CustomerCreditLedgerCreateEntryParamsTest {
2828
.netTerms(0L)
2929
.customDueDate(LocalDate.parse("2019-12-27"))
3030
.invoiceDate(LocalDate.parse("2019-12-27"))
31+
.itemId("item_id")
3132
.memo("memo")
3233
.requireSuccessfulPayment(true)
3334
.build()
@@ -75,6 +76,7 @@ internal class CustomerCreditLedgerCreateEntryParamsTest {
7576
.netTerms(0L)
7677
.customDueDate(LocalDate.parse("2019-12-27"))
7778
.invoiceDate(LocalDate.parse("2019-12-27"))
79+
.itemId("item_id")
7880
.memo("memo")
7981
.requireSuccessfulPayment(true)
8082
.build()
@@ -107,6 +109,7 @@ internal class CustomerCreditLedgerCreateEntryParamsTest {
107109
.netTerms(0L)
108110
.customDueDate(LocalDate.parse("2019-12-27"))
109111
.invoiceDate(LocalDate.parse("2019-12-27"))
112+
.itemId("item_id")
110113
.memo("memo")
111114
.requireSuccessfulPayment(true)
112115
.build()

orb-java-core/src/test/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsyncTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ internal class LedgerServiceAsyncTest {
5757
.netTerms(0L)
5858
.customDueDate(LocalDate.parse("2019-12-27"))
5959
.invoiceDate(LocalDate.parse("2019-12-27"))
60+
.itemId("item_id")
6061
.memo("memo")
6162
.requireSuccessfulPayment(true)
6263
.build()
@@ -105,6 +106,7 @@ internal class LedgerServiceAsyncTest {
105106
.netTerms(0L)
106107
.customDueDate(LocalDate.parse("2019-12-27"))
107108
.invoiceDate(LocalDate.parse("2019-12-27"))
109+
.itemId("item_id")
108110
.memo("memo")
109111
.requireSuccessfulPayment(true)
110112
.build()

0 commit comments

Comments
 (0)