@@ -232,6 +232,17 @@ private constructor(
232
232
fun body (expirationChange : Body .ExpirationChange ) =
233
233
body(Body .ofExpirationChange(expirationChange))
234
234
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
+
235
246
/* * Alias for calling [body] with `Body.ofVoid(void_)`. */
236
247
fun body (void_ : Body .Void ) = body(Body .ofVoid(void_))
237
248
@@ -2069,22 +2080,19 @@ private constructor(
2069
2080
class ExpirationChange
2070
2081
private constructor (
2071
2082
private val entryType: JsonValue ,
2072
- private val expiryDate: JsonField <OffsetDateTime >,
2073
2083
private val targetExpiryDate: JsonField <LocalDate >,
2074
2084
private val amount: JsonField <Double >,
2075
2085
private val blockId: JsonField <String >,
2076
2086
private val currency: JsonField <String >,
2077
2087
private val description: JsonField <String >,
2088
+ private val expiryDate: JsonField <OffsetDateTime >,
2078
2089
private val metadata: JsonField <Metadata >,
2079
2090
private val additionalProperties: MutableMap <String , JsonValue >,
2080
2091
) {
2081
2092
2082
2093
@JsonCreator
2083
2094
private constructor (
2084
2095
@JsonProperty(" entry_type" ) @ExcludeMissing entryType: JsonValue = JsonMissing .of(),
2085
- @JsonProperty(" expiry_date" )
2086
- @ExcludeMissing
2087
- expiryDate: JsonField <OffsetDateTime > = JsonMissing .of(),
2088
2096
@JsonProperty(" target_expiry_date" )
2089
2097
@ExcludeMissing
2090
2098
targetExpiryDate: JsonField <LocalDate > = JsonMissing .of(),
@@ -2100,17 +2108,20 @@ private constructor(
2100
2108
@JsonProperty(" description" )
2101
2109
@ExcludeMissing
2102
2110
description: JsonField <String > = JsonMissing .of(),
2111
+ @JsonProperty(" expiry_date" )
2112
+ @ExcludeMissing
2113
+ expiryDate: JsonField <OffsetDateTime > = JsonMissing .of(),
2103
2114
@JsonProperty(" metadata" )
2104
2115
@ExcludeMissing
2105
2116
metadata: JsonField <Metadata > = JsonMissing .of(),
2106
2117
) : this (
2107
2118
entryType,
2108
- expiryDate,
2109
2119
targetExpiryDate,
2110
2120
amount,
2111
2121
blockId,
2112
2122
currency,
2113
2123
description,
2124
+ expiryDate,
2114
2125
metadata,
2115
2126
mutableMapOf (),
2116
2127
)
@@ -2126,14 +2137,6 @@ private constructor(
2126
2137
*/
2127
2138
@JsonProperty(" entry_type" ) @ExcludeMissing fun _entryType (): JsonValue = entryType
2128
2139
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
-
2137
2140
/* *
2138
2141
* A future date (specified in YYYY-MM-DD format) used for expiration change, denoting
2139
2142
* when credits transferred (as part of a partial block expiration) should expire.
@@ -2182,24 +2185,22 @@ private constructor(
2182
2185
fun description (): Optional <String > = description.getOptional(" description" )
2183
2186
2184
2187
/* *
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
2188
2189
*
2189
2190
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
2190
2191
* server responded with an unexpected value).
2191
2192
*/
2192
- fun metadata (): Optional <Metadata > = metadata .getOptional(" metadata " )
2193
+ fun expiryDate (): Optional <OffsetDateTime > = expiryDate .getOptional(" expiry_date " )
2193
2194
2194
2195
/* *
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`.
2196
2199
*
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) .
2199
2202
*/
2200
- @JsonProperty(" expiry_date" )
2201
- @ExcludeMissing
2202
- fun _expiryDate (): JsonField <OffsetDateTime > = expiryDate
2203
+ fun metadata (): Optional <Metadata > = metadata.getOptional(" metadata" )
2203
2204
2204
2205
/* *
2205
2206
* Returns the raw JSON value of [targetExpiryDate].
@@ -2243,6 +2244,16 @@ private constructor(
2243
2244
@ExcludeMissing
2244
2245
fun _description (): JsonField <String > = description
2245
2246
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
+
2246
2257
/* *
2247
2258
* Returns the raw JSON value of [metadata].
2248
2259
*
@@ -2272,7 +2283,6 @@ private constructor(
2272
2283
*
2273
2284
* The following fields are required:
2274
2285
* ```java
2275
- * .expiryDate()
2276
2286
* .targetExpiryDate()
2277
2287
* ```
2278
2288
*/
@@ -2283,24 +2293,24 @@ private constructor(
2283
2293
class Builder internal constructor() {
2284
2294
2285
2295
private var entryType: JsonValue = JsonValue .from(" expiration_change" )
2286
- private var expiryDate: JsonField <OffsetDateTime >? = null
2287
2296
private var targetExpiryDate: JsonField <LocalDate >? = null
2288
2297
private var amount: JsonField <Double > = JsonMissing .of()
2289
2298
private var blockId: JsonField <String > = JsonMissing .of()
2290
2299
private var currency: JsonField <String > = JsonMissing .of()
2291
2300
private var description: JsonField <String > = JsonMissing .of()
2301
+ private var expiryDate: JsonField <OffsetDateTime > = JsonMissing .of()
2292
2302
private var metadata: JsonField <Metadata > = JsonMissing .of()
2293
2303
private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
2294
2304
2295
2305
@JvmSynthetic
2296
2306
internal fun from (expirationChange : ExpirationChange ) = apply {
2297
2307
entryType = expirationChange.entryType
2298
- expiryDate = expirationChange.expiryDate
2299
2308
targetExpiryDate = expirationChange.targetExpiryDate
2300
2309
amount = expirationChange.amount
2301
2310
blockId = expirationChange.blockId
2302
2311
currency = expirationChange.currency
2303
2312
description = expirationChange.description
2313
+ expiryDate = expirationChange.expiryDate
2304
2314
metadata = expirationChange.metadata
2305
2315
additionalProperties = expirationChange.additionalProperties.toMutableMap()
2306
2316
}
@@ -2319,27 +2329,6 @@ private constructor(
2319
2329
*/
2320
2330
fun entryType (entryType : JsonValue ) = apply { this .entryType = entryType }
2321
2331
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
-
2343
2332
/* *
2344
2333
* A future date (specified in YYYY-MM-DD format) used for expiration change,
2345
2334
* denoting when credits transferred (as part of a partial block expiration) should
@@ -2443,6 +2432,27 @@ private constructor(
2443
2432
this .description = description
2444
2433
}
2445
2434
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
+
2446
2456
/* *
2447
2457
* User-specified key/value pairs for the resource. Individual keys can be removed
2448
2458
* by setting the value to `null`, and the entire metadata mapping can be cleared by
@@ -2491,7 +2501,6 @@ private constructor(
2491
2501
*
2492
2502
* The following fields are required:
2493
2503
* ```java
2494
- * .expiryDate()
2495
2504
* .targetExpiryDate()
2496
2505
* ```
2497
2506
*
@@ -2500,12 +2509,12 @@ private constructor(
2500
2509
fun build (): ExpirationChange =
2501
2510
ExpirationChange (
2502
2511
entryType,
2503
- checkRequired(" expiryDate" , expiryDate),
2504
2512
checkRequired(" targetExpiryDate" , targetExpiryDate),
2505
2513
amount,
2506
2514
blockId,
2507
2515
currency,
2508
2516
description,
2517
+ expiryDate,
2509
2518
metadata,
2510
2519
additionalProperties.toMutableMap(),
2511
2520
)
@@ -2523,12 +2532,12 @@ private constructor(
2523
2532
throw OrbInvalidDataException (" 'entryType' is invalid, received $it " )
2524
2533
}
2525
2534
}
2526
- expiryDate()
2527
2535
targetExpiryDate()
2528
2536
amount()
2529
2537
blockId()
2530
2538
currency()
2531
2539
description()
2540
+ expiryDate()
2532
2541
metadata().ifPresent { it.validate() }
2533
2542
validated = true
2534
2543
}
@@ -2550,12 +2559,12 @@ private constructor(
2550
2559
@JvmSynthetic
2551
2560
internal fun validity (): Int =
2552
2561
entryType.let { if (it == JsonValue .from(" expiration_change" )) 1 else 0 } +
2553
- (if (expiryDate.asKnown().isPresent) 1 else 0 ) +
2554
2562
(if (targetExpiryDate.asKnown().isPresent) 1 else 0 ) +
2555
2563
(if (amount.asKnown().isPresent) 1 else 0 ) +
2556
2564
(if (blockId.asKnown().isPresent) 1 else 0 ) +
2557
2565
(if (currency.asKnown().isPresent) 1 else 0 ) +
2558
2566
(if (description.asKnown().isPresent) 1 else 0 ) +
2567
+ (if (expiryDate.asKnown().isPresent) 1 else 0 ) +
2559
2568
(metadata.asKnown().getOrNull()?.validity() ? : 0 )
2560
2569
2561
2570
/* *
@@ -2674,17 +2683,17 @@ private constructor(
2674
2683
return true
2675
2684
}
2676
2685
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 */
2678
2687
}
2679
2688
2680
2689
/* 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) }
2682
2691
/* spotless:on */
2683
2692
2684
2693
override fun hashCode (): Int = hashCode
2685
2694
2686
2695
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 }"
2688
2697
}
2689
2698
2690
2699
class Void
0 commit comments