Skip to content

Commit e58761c

Browse files
feat(api): api update
1 parent 83c2707 commit e58761c

File tree

3 files changed

+128
-110
lines changed

3 files changed

+128
-110
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-62651294c6bdd7c8d1c183fe4e5ba844a7ac29d80bef9e150739354a9c431ab4.yml
3-
openapi_spec_hash: 46c5d7f541c0c2143b975be9725c9189
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-9d6e0a988df83c0e2baa559ef57ec96981669a7a294de2188adb2cd6bbc0be8a.yml
3+
openapi_spec_hash: 7f5e7221872d7ee799141f546c394f48
44
config_hash: 3c3524be9607afb24d2139ce26ce5389

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

Lines changed: 63 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,17 @@ private constructor(
232232
fun body(expirationChange: Body.ExpirationChange) =
233233
body(Body.ofExpirationChange(expirationChange))
234234

235+
/**
236+
* Alias for calling [body] with the following:
237+
* ```java
238+
* Body.ExpirationChange.builder()
239+
* .targetExpiryDate(targetExpiryDate)
240+
* .build()
241+
* ```
242+
*/
243+
fun expirationChangeBody(targetExpiryDate: LocalDate) =
244+
body(Body.ExpirationChange.builder().targetExpiryDate(targetExpiryDate).build())
245+
235246
/** Alias for calling [body] with `Body.ofVoid(void_)`. */
236247
fun body(void_: Body.Void) = body(Body.ofVoid(void_))
237248

@@ -2069,22 +2080,19 @@ private constructor(
20692080
class ExpirationChange
20702081
private constructor(
20712082
private val entryType: JsonValue,
2072-
private val expiryDate: JsonField<OffsetDateTime>,
20732083
private val targetExpiryDate: JsonField<LocalDate>,
20742084
private val amount: JsonField<Double>,
20752085
private val blockId: JsonField<String>,
20762086
private val currency: JsonField<String>,
20772087
private val description: JsonField<String>,
2088+
private val expiryDate: JsonField<OffsetDateTime>,
20782089
private val metadata: JsonField<Metadata>,
20792090
private val additionalProperties: MutableMap<String, JsonValue>,
20802091
) {
20812092

20822093
@JsonCreator
20832094
private constructor(
20842095
@JsonProperty("entry_type") @ExcludeMissing entryType: JsonValue = JsonMissing.of(),
2085-
@JsonProperty("expiry_date")
2086-
@ExcludeMissing
2087-
expiryDate: JsonField<OffsetDateTime> = JsonMissing.of(),
20882096
@JsonProperty("target_expiry_date")
20892097
@ExcludeMissing
20902098
targetExpiryDate: JsonField<LocalDate> = JsonMissing.of(),
@@ -2100,17 +2108,20 @@ private constructor(
21002108
@JsonProperty("description")
21012109
@ExcludeMissing
21022110
description: JsonField<String> = JsonMissing.of(),
2111+
@JsonProperty("expiry_date")
2112+
@ExcludeMissing
2113+
expiryDate: JsonField<OffsetDateTime> = JsonMissing.of(),
21032114
@JsonProperty("metadata")
21042115
@ExcludeMissing
21052116
metadata: JsonField<Metadata> = JsonMissing.of(),
21062117
) : this(
21072118
entryType,
2108-
expiryDate,
21092119
targetExpiryDate,
21102120
amount,
21112121
blockId,
21122122
currency,
21132123
description,
2124+
expiryDate,
21142125
metadata,
21152126
mutableMapOf(),
21162127
)
@@ -2126,14 +2137,6 @@ private constructor(
21262137
*/
21272138
@JsonProperty("entry_type") @ExcludeMissing fun _entryType(): JsonValue = entryType
21282139

2129-
/**
2130-
* An ISO 8601 format date that identifies the origination credit block to expire
2131-
*
2132-
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
2133-
* server responded with an unexpected value).
2134-
*/
2135-
fun expiryDate(): Optional<OffsetDateTime> = expiryDate.getOptional("expiry_date")
2136-
21372140
/**
21382141
* A future date (specified in YYYY-MM-DD format) used for expiration change, denoting
21392142
* when credits transferred (as part of a partial block expiration) should expire.
@@ -2182,24 +2185,22 @@ private constructor(
21822185
fun description(): Optional<String> = description.getOptional("description")
21832186

21842187
/**
2185-
* User-specified key/value pairs for the resource. Individual keys can be removed by
2186-
* setting the value to `null`, and the entire metadata mapping can be cleared by
2187-
* setting `metadata` to `null`.
2188+
* An ISO 8601 format date that identifies the origination credit block to expire
21882189
*
21892190
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
21902191
* server responded with an unexpected value).
21912192
*/
2192-
fun metadata(): Optional<Metadata> = metadata.getOptional("metadata")
2193+
fun expiryDate(): Optional<OffsetDateTime> = expiryDate.getOptional("expiry_date")
21932194

21942195
/**
2195-
* Returns the raw JSON value of [expiryDate].
2196+
* User-specified key/value pairs for the resource. Individual keys can be removed by
2197+
* setting the value to `null`, and the entire metadata mapping can be cleared by
2198+
* setting `metadata` to `null`.
21962199
*
2197-
* Unlike [expiryDate], this method doesn't throw if the JSON field has an unexpected
2198-
* type.
2200+
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
2201+
* server responded with an unexpected value).
21992202
*/
2200-
@JsonProperty("expiry_date")
2201-
@ExcludeMissing
2202-
fun _expiryDate(): JsonField<OffsetDateTime> = expiryDate
2203+
fun metadata(): Optional<Metadata> = metadata.getOptional("metadata")
22032204

22042205
/**
22052206
* Returns the raw JSON value of [targetExpiryDate].
@@ -2243,6 +2244,16 @@ private constructor(
22432244
@ExcludeMissing
22442245
fun _description(): JsonField<String> = description
22452246

2247+
/**
2248+
* Returns the raw JSON value of [expiryDate].
2249+
*
2250+
* Unlike [expiryDate], this method doesn't throw if the JSON field has an unexpected
2251+
* type.
2252+
*/
2253+
@JsonProperty("expiry_date")
2254+
@ExcludeMissing
2255+
fun _expiryDate(): JsonField<OffsetDateTime> = expiryDate
2256+
22462257
/**
22472258
* Returns the raw JSON value of [metadata].
22482259
*
@@ -2272,7 +2283,6 @@ private constructor(
22722283
*
22732284
* The following fields are required:
22742285
* ```java
2275-
* .expiryDate()
22762286
* .targetExpiryDate()
22772287
* ```
22782288
*/
@@ -2283,24 +2293,24 @@ private constructor(
22832293
class Builder internal constructor() {
22842294

22852295
private var entryType: JsonValue = JsonValue.from("expiration_change")
2286-
private var expiryDate: JsonField<OffsetDateTime>? = null
22872296
private var targetExpiryDate: JsonField<LocalDate>? = null
22882297
private var amount: JsonField<Double> = JsonMissing.of()
22892298
private var blockId: JsonField<String> = JsonMissing.of()
22902299
private var currency: JsonField<String> = JsonMissing.of()
22912300
private var description: JsonField<String> = JsonMissing.of()
2301+
private var expiryDate: JsonField<OffsetDateTime> = JsonMissing.of()
22922302
private var metadata: JsonField<Metadata> = JsonMissing.of()
22932303
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
22942304

22952305
@JvmSynthetic
22962306
internal fun from(expirationChange: ExpirationChange) = apply {
22972307
entryType = expirationChange.entryType
2298-
expiryDate = expirationChange.expiryDate
22992308
targetExpiryDate = expirationChange.targetExpiryDate
23002309
amount = expirationChange.amount
23012310
blockId = expirationChange.blockId
23022311
currency = expirationChange.currency
23032312
description = expirationChange.description
2313+
expiryDate = expirationChange.expiryDate
23042314
metadata = expirationChange.metadata
23052315
additionalProperties = expirationChange.additionalProperties.toMutableMap()
23062316
}
@@ -2319,27 +2329,6 @@ private constructor(
23192329
*/
23202330
fun entryType(entryType: JsonValue) = apply { this.entryType = entryType }
23212331

2322-
/**
2323-
* An ISO 8601 format date that identifies the origination credit block to expire
2324-
*/
2325-
fun expiryDate(expiryDate: OffsetDateTime?) =
2326-
expiryDate(JsonField.ofNullable(expiryDate))
2327-
2328-
/** Alias for calling [Builder.expiryDate] with `expiryDate.orElse(null)`. */
2329-
fun expiryDate(expiryDate: Optional<OffsetDateTime>) =
2330-
expiryDate(expiryDate.getOrNull())
2331-
2332-
/**
2333-
* Sets [Builder.expiryDate] to an arbitrary JSON value.
2334-
*
2335-
* You should usually call [Builder.expiryDate] with a well-typed [OffsetDateTime]
2336-
* value instead. This method is primarily for setting the field to an undocumented
2337-
* or not yet supported value.
2338-
*/
2339-
fun expiryDate(expiryDate: JsonField<OffsetDateTime>) = apply {
2340-
this.expiryDate = expiryDate
2341-
}
2342-
23432332
/**
23442333
* A future date (specified in YYYY-MM-DD format) used for expiration change,
23452334
* denoting when credits transferred (as part of a partial block expiration) should
@@ -2443,6 +2432,27 @@ private constructor(
24432432
this.description = description
24442433
}
24452434

2435+
/**
2436+
* An ISO 8601 format date that identifies the origination credit block to expire
2437+
*/
2438+
fun expiryDate(expiryDate: OffsetDateTime?) =
2439+
expiryDate(JsonField.ofNullable(expiryDate))
2440+
2441+
/** Alias for calling [Builder.expiryDate] with `expiryDate.orElse(null)`. */
2442+
fun expiryDate(expiryDate: Optional<OffsetDateTime>) =
2443+
expiryDate(expiryDate.getOrNull())
2444+
2445+
/**
2446+
* Sets [Builder.expiryDate] to an arbitrary JSON value.
2447+
*
2448+
* You should usually call [Builder.expiryDate] with a well-typed [OffsetDateTime]
2449+
* value instead. This method is primarily for setting the field to an undocumented
2450+
* or not yet supported value.
2451+
*/
2452+
fun expiryDate(expiryDate: JsonField<OffsetDateTime>) = apply {
2453+
this.expiryDate = expiryDate
2454+
}
2455+
24462456
/**
24472457
* User-specified key/value pairs for the resource. Individual keys can be removed
24482458
* by setting the value to `null`, and the entire metadata mapping can be cleared by
@@ -2491,7 +2501,6 @@ private constructor(
24912501
*
24922502
* The following fields are required:
24932503
* ```java
2494-
* .expiryDate()
24952504
* .targetExpiryDate()
24962505
* ```
24972506
*
@@ -2500,12 +2509,12 @@ private constructor(
25002509
fun build(): ExpirationChange =
25012510
ExpirationChange(
25022511
entryType,
2503-
checkRequired("expiryDate", expiryDate),
25042512
checkRequired("targetExpiryDate", targetExpiryDate),
25052513
amount,
25062514
blockId,
25072515
currency,
25082516
description,
2517+
expiryDate,
25092518
metadata,
25102519
additionalProperties.toMutableMap(),
25112520
)
@@ -2523,12 +2532,12 @@ private constructor(
25232532
throw OrbInvalidDataException("'entryType' is invalid, received $it")
25242533
}
25252534
}
2526-
expiryDate()
25272535
targetExpiryDate()
25282536
amount()
25292537
blockId()
25302538
currency()
25312539
description()
2540+
expiryDate()
25322541
metadata().ifPresent { it.validate() }
25332542
validated = true
25342543
}
@@ -2550,12 +2559,12 @@ private constructor(
25502559
@JvmSynthetic
25512560
internal fun validity(): Int =
25522561
entryType.let { if (it == JsonValue.from("expiration_change")) 1 else 0 } +
2553-
(if (expiryDate.asKnown().isPresent) 1 else 0) +
25542562
(if (targetExpiryDate.asKnown().isPresent) 1 else 0) +
25552563
(if (amount.asKnown().isPresent) 1 else 0) +
25562564
(if (blockId.asKnown().isPresent) 1 else 0) +
25572565
(if (currency.asKnown().isPresent) 1 else 0) +
25582566
(if (description.asKnown().isPresent) 1 else 0) +
2567+
(if (expiryDate.asKnown().isPresent) 1 else 0) +
25592568
(metadata.asKnown().getOrNull()?.validity() ?: 0)
25602569

25612570
/**
@@ -2674,17 +2683,17 @@ private constructor(
26742683
return true
26752684
}
26762685

2677-
return /* spotless:off */ other is ExpirationChange && entryType == other.entryType && expiryDate == other.expiryDate && targetExpiryDate == other.targetExpiryDate && amount == other.amount && blockId == other.blockId && currency == other.currency && description == other.description && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
2686+
return /* spotless:off */ other is ExpirationChange && entryType == other.entryType && targetExpiryDate == other.targetExpiryDate && amount == other.amount && blockId == other.blockId && currency == other.currency && description == other.description && expiryDate == other.expiryDate && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
26782687
}
26792688

26802689
/* spotless:off */
2681-
private val hashCode: Int by lazy { Objects.hash(entryType, expiryDate, targetExpiryDate, amount, blockId, currency, description, metadata, additionalProperties) }
2690+
private val hashCode: Int by lazy { Objects.hash(entryType, targetExpiryDate, amount, blockId, currency, description, expiryDate, metadata, additionalProperties) }
26822691
/* spotless:on */
26832692

26842693
override fun hashCode(): Int = hashCode
26852694

26862695
override fun toString() =
2687-
"ExpirationChange{entryType=$entryType, expiryDate=$expiryDate, targetExpiryDate=$targetExpiryDate, amount=$amount, blockId=$blockId, currency=$currency, description=$description, metadata=$metadata, additionalProperties=$additionalProperties}"
2696+
"ExpirationChange{entryType=$entryType, targetExpiryDate=$targetExpiryDate, amount=$amount, blockId=$blockId, currency=$currency, description=$description, expiryDate=$expiryDate, metadata=$metadata, additionalProperties=$additionalProperties}"
26882697
}
26892698

26902699
class Void

0 commit comments

Comments
 (0)