@@ -43,7 +43,17 @@ private constructor(
43
43
fun description (): Optional <String > = body.description()
44
44
45
45
/* *
46
- * Amount already collected to apply to the customer's balance.
46
+ * Mark all pending invoices that are payable as paid. If amount is also provided, mark as paid
47
+ * and credit the difference to the customer's balance.
48
+ *
49
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
50
+ * responded with an unexpected value).
51
+ */
52
+ fun markAsPaid (): Optional <Boolean > = body.markAsPaid()
53
+
54
+ /* *
55
+ * Amount already collected to apply to the customer's balance. If mark_as_paid is also
56
+ * provided, credit the difference to the customer's balance.
47
57
*
48
58
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
49
59
* responded with an unexpected value).
@@ -57,6 +67,13 @@ private constructor(
57
67
*/
58
68
fun _description (): JsonField <String > = body._description ()
59
69
70
+ /* *
71
+ * Returns the raw JSON value of [markAsPaid].
72
+ *
73
+ * Unlike [markAsPaid], this method doesn't throw if the JSON field has an unexpected type.
74
+ */
75
+ fun _markAsPaid (): JsonField <Boolean > = body._markAsPaid ()
76
+
60
77
/* *
61
78
* Returns the raw JSON value of [previouslyCollectedAmount].
62
79
*
@@ -119,6 +136,7 @@ private constructor(
119
136
* This is generally only useful if you are already constructing the body separately.
120
137
* Otherwise, it's more convenient to use the top-level setters instead:
121
138
* - [description]
139
+ * - [markAsPaid]
122
140
* - [previouslyCollectedAmount]
123
141
*/
124
142
fun body (body : Body ) = apply { this .body = body.toBuilder() }
@@ -138,7 +156,35 @@ private constructor(
138
156
*/
139
157
fun description (description : JsonField <String >) = apply { body.description(description) }
140
158
141
- /* * Amount already collected to apply to the customer's balance. */
159
+ /* *
160
+ * Mark all pending invoices that are payable as paid. If amount is also provided, mark as
161
+ * paid and credit the difference to the customer's balance.
162
+ */
163
+ fun markAsPaid (markAsPaid : Boolean? ) = apply { body.markAsPaid(markAsPaid) }
164
+
165
+ /* *
166
+ * Alias for [Builder.markAsPaid].
167
+ *
168
+ * This unboxed primitive overload exists for backwards compatibility.
169
+ */
170
+ fun markAsPaid (markAsPaid : Boolean ) = markAsPaid(markAsPaid as Boolean? )
171
+
172
+ /* * Alias for calling [Builder.markAsPaid] with `markAsPaid.orElse(null)`. */
173
+ fun markAsPaid (markAsPaid : Optional <Boolean >) = markAsPaid(markAsPaid.getOrNull())
174
+
175
+ /* *
176
+ * Sets [Builder.markAsPaid] to an arbitrary JSON value.
177
+ *
178
+ * You should usually call [Builder.markAsPaid] with a well-typed [Boolean] value instead.
179
+ * This method is primarily for setting the field to an undocumented or not yet supported
180
+ * value.
181
+ */
182
+ fun markAsPaid (markAsPaid : JsonField <Boolean >) = apply { body.markAsPaid(markAsPaid) }
183
+
184
+ /* *
185
+ * Amount already collected to apply to the customer's balance. If mark_as_paid is also
186
+ * provided, credit the difference to the customer's balance.
187
+ */
142
188
fun previouslyCollectedAmount (previouslyCollectedAmount : String? ) = apply {
143
189
body.previouslyCollectedAmount(previouslyCollectedAmount)
144
190
}
@@ -308,6 +354,7 @@ private constructor(
308
354
@JsonCreator(mode = JsonCreator .Mode .DISABLED )
309
355
private constructor (
310
356
private val description: JsonField <String >,
357
+ private val markAsPaid: JsonField <Boolean >,
311
358
private val previouslyCollectedAmount: JsonField <String >,
312
359
private val additionalProperties: MutableMap <String , JsonValue >,
313
360
) {
@@ -317,10 +364,13 @@ private constructor(
317
364
@JsonProperty(" description" )
318
365
@ExcludeMissing
319
366
description: JsonField <String > = JsonMissing .of(),
367
+ @JsonProperty(" mark_as_paid" )
368
+ @ExcludeMissing
369
+ markAsPaid: JsonField <Boolean > = JsonMissing .of(),
320
370
@JsonProperty(" previously_collected_amount" )
321
371
@ExcludeMissing
322
372
previouslyCollectedAmount: JsonField <String > = JsonMissing .of(),
323
- ) : this (description, previouslyCollectedAmount, mutableMapOf ())
373
+ ) : this (description, markAsPaid, previouslyCollectedAmount, mutableMapOf ())
324
374
325
375
/* *
326
376
* Description to apply to the balance transaction representing this credit.
@@ -331,7 +381,17 @@ private constructor(
331
381
fun description (): Optional <String > = description.getOptional(" description" )
332
382
333
383
/* *
334
- * Amount already collected to apply to the customer's balance.
384
+ * Mark all pending invoices that are payable as paid. If amount is also provided, mark as
385
+ * paid and credit the difference to the customer's balance.
386
+ *
387
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
388
+ * server responded with an unexpected value).
389
+ */
390
+ fun markAsPaid (): Optional <Boolean > = markAsPaid.getOptional(" mark_as_paid" )
391
+
392
+ /* *
393
+ * Amount already collected to apply to the customer's balance. If mark_as_paid is also
394
+ * provided, credit the difference to the customer's balance.
335
395
*
336
396
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
337
397
* server responded with an unexpected value).
@@ -348,6 +408,15 @@ private constructor(
348
408
@ExcludeMissing
349
409
fun _description (): JsonField <String > = description
350
410
411
+ /* *
412
+ * Returns the raw JSON value of [markAsPaid].
413
+ *
414
+ * Unlike [markAsPaid], this method doesn't throw if the JSON field has an unexpected type.
415
+ */
416
+ @JsonProperty(" mark_as_paid" )
417
+ @ExcludeMissing
418
+ fun _markAsPaid (): JsonField <Boolean > = markAsPaid
419
+
351
420
/* *
352
421
* Returns the raw JSON value of [previouslyCollectedAmount].
353
422
*
@@ -380,12 +449,14 @@ private constructor(
380
449
class Builder internal constructor() {
381
450
382
451
private var description: JsonField <String > = JsonMissing .of()
452
+ private var markAsPaid: JsonField <Boolean > = JsonMissing .of()
383
453
private var previouslyCollectedAmount: JsonField <String > = JsonMissing .of()
384
454
private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
385
455
386
456
@JvmSynthetic
387
457
internal fun from (body : Body ) = apply {
388
458
description = body.description
459
+ markAsPaid = body.markAsPaid
389
460
previouslyCollectedAmount = body.previouslyCollectedAmount
390
461
additionalProperties = body.additionalProperties.toMutableMap()
391
462
}
@@ -407,7 +478,35 @@ private constructor(
407
478
this .description = description
408
479
}
409
480
410
- /* * Amount already collected to apply to the customer's balance. */
481
+ /* *
482
+ * Mark all pending invoices that are payable as paid. If amount is also provided, mark
483
+ * as paid and credit the difference to the customer's balance.
484
+ */
485
+ fun markAsPaid (markAsPaid : Boolean? ) = markAsPaid(JsonField .ofNullable(markAsPaid))
486
+
487
+ /* *
488
+ * Alias for [Builder.markAsPaid].
489
+ *
490
+ * This unboxed primitive overload exists for backwards compatibility.
491
+ */
492
+ fun markAsPaid (markAsPaid : Boolean ) = markAsPaid(markAsPaid as Boolean? )
493
+
494
+ /* * Alias for calling [Builder.markAsPaid] with `markAsPaid.orElse(null)`. */
495
+ fun markAsPaid (markAsPaid : Optional <Boolean >) = markAsPaid(markAsPaid.getOrNull())
496
+
497
+ /* *
498
+ * Sets [Builder.markAsPaid] to an arbitrary JSON value.
499
+ *
500
+ * You should usually call [Builder.markAsPaid] with a well-typed [Boolean] value
501
+ * instead. This method is primarily for setting the field to an undocumented or not yet
502
+ * supported value.
503
+ */
504
+ fun markAsPaid (markAsPaid : JsonField <Boolean >) = apply { this .markAsPaid = markAsPaid }
505
+
506
+ /* *
507
+ * Amount already collected to apply to the customer's balance. If mark_as_paid is also
508
+ * provided, credit the difference to the customer's balance.
509
+ */
411
510
fun previouslyCollectedAmount (previouslyCollectedAmount : String? ) =
412
511
previouslyCollectedAmount(JsonField .ofNullable(previouslyCollectedAmount))
413
512
@@ -454,7 +553,12 @@ private constructor(
454
553
* Further updates to this [Builder] will not mutate the returned instance.
455
554
*/
456
555
fun build (): Body =
457
- Body (description, previouslyCollectedAmount, additionalProperties.toMutableMap())
556
+ Body (
557
+ description,
558
+ markAsPaid,
559
+ previouslyCollectedAmount,
560
+ additionalProperties.toMutableMap(),
561
+ )
458
562
}
459
563
460
564
private var validated: Boolean = false
@@ -465,6 +569,7 @@ private constructor(
465
569
}
466
570
467
571
description()
572
+ markAsPaid()
468
573
previouslyCollectedAmount()
469
574
validated = true
470
575
}
@@ -486,6 +591,7 @@ private constructor(
486
591
@JvmSynthetic
487
592
internal fun validity (): Int =
488
593
(if (description.asKnown().isPresent) 1 else 0 ) +
594
+ (if (markAsPaid.asKnown().isPresent) 1 else 0 ) +
489
595
(if (previouslyCollectedAmount.asKnown().isPresent) 1 else 0 )
490
596
491
597
override fun equals (other : Any? ): Boolean {
@@ -495,18 +601,19 @@ private constructor(
495
601
496
602
return other is Body &&
497
603
description == other.description &&
604
+ markAsPaid == other.markAsPaid &&
498
605
previouslyCollectedAmount == other.previouslyCollectedAmount &&
499
606
additionalProperties == other.additionalProperties
500
607
}
501
608
502
609
private val hashCode: Int by lazy {
503
- Objects .hash(description, previouslyCollectedAmount, additionalProperties)
610
+ Objects .hash(description, markAsPaid, previouslyCollectedAmount, additionalProperties)
504
611
}
505
612
506
613
override fun hashCode (): Int = hashCode
507
614
508
615
override fun toString () =
509
- " Body{description=$description , previouslyCollectedAmount=$previouslyCollectedAmount , additionalProperties=$additionalProperties }"
616
+ " Body{description=$description , markAsPaid= $markAsPaid , previouslyCollectedAmount=$previouslyCollectedAmount , additionalProperties=$additionalProperties }"
510
617
}
511
618
512
619
override fun equals (other : Any? ): Boolean {
0 commit comments