Skip to content

Commit 0145df2

Browse files
fix(api): Correct token_metadata field name in tokenization.approval_request schema
1 parent 113c645 commit 0145df2

10 files changed

Lines changed: 511 additions & 534 deletions

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 185
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-179734893d610c68eb1c49d41be91edc2ad243885e4972fd901835eec233b122.yml
3-
openapi_spec_hash: c60105fa2dd66c0d5b15d17c556db7c1
4-
config_hash: 925e84bc73b1b9b5eb0ffd230fc9800f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a45946df228eec554b3cd2491f658bd5a45cb91509da0a9f92d50468ea88072f.yml
3+
openapi_spec_hash: 24c7c13e1e7385cab5442ca66091ffc6
4+
config_hash: 50031f78031362c2e4900222b9ce7ada

lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalWalletTokenizationApprovalRequestWebhookEvent.kt

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ private constructor(
2828
private val cardToken: JsonField<String>,
2929
private val created: JsonField<OffsetDateTime>,
3030
private val customerTokenizationDecision: JsonField<CustomerTokenizationDecision>,
31+
private val digitalWalletTokenMetadata: JsonField<TokenMetadata>,
3132
private val eventType: JsonField<EventType>,
3233
private val issuerDecision: JsonField<IssuerDecision>,
3334
private val tokenizationChannel: JsonField<TokenizationChannel>,
3435
private val tokenizationToken: JsonField<String>,
3536
private val walletDecisioningInfo: JsonField<WalletDecisioningInfo>,
3637
private val device: JsonField<Device>,
37-
private val digitalWalletTokenMetadata: JsonField<DigitalWalletTokenMetadata>,
3838
private val ruleResults: JsonField<List<TokenizationRuleResult>>,
3939
private val tokenizationDeclineReasons: JsonField<List<TokenizationDeclineReason>>,
4040
private val tokenizationSource: JsonField<TokenizationSource>,
@@ -54,6 +54,9 @@ private constructor(
5454
@JsonProperty("customer_tokenization_decision")
5555
@ExcludeMissing
5656
customerTokenizationDecision: JsonField<CustomerTokenizationDecision> = JsonMissing.of(),
57+
@JsonProperty("digital_wallet_token_metadata")
58+
@ExcludeMissing
59+
digitalWalletTokenMetadata: JsonField<TokenMetadata> = JsonMissing.of(),
5760
@JsonProperty("event_type")
5861
@ExcludeMissing
5962
eventType: JsonField<EventType> = JsonMissing.of(),
@@ -70,9 +73,6 @@ private constructor(
7073
@ExcludeMissing
7174
walletDecisioningInfo: JsonField<WalletDecisioningInfo> = JsonMissing.of(),
7275
@JsonProperty("device") @ExcludeMissing device: JsonField<Device> = JsonMissing.of(),
73-
@JsonProperty("digital_wallet_token_metadata")
74-
@ExcludeMissing
75-
digitalWalletTokenMetadata: JsonField<DigitalWalletTokenMetadata> = JsonMissing.of(),
7676
@JsonProperty("rule_results")
7777
@ExcludeMissing
7878
ruleResults: JsonField<List<TokenizationRuleResult>> = JsonMissing.of(),
@@ -90,13 +90,13 @@ private constructor(
9090
cardToken,
9191
created,
9292
customerTokenizationDecision,
93+
digitalWalletTokenMetadata,
9394
eventType,
9495
issuerDecision,
9596
tokenizationChannel,
9697
tokenizationToken,
9798
walletDecisioningInfo,
9899
device,
99-
digitalWalletTokenMetadata,
100100
ruleResults,
101101
tokenizationDeclineReasons,
102102
tokenizationSource,
@@ -137,6 +137,15 @@ private constructor(
137137
fun customerTokenizationDecision(): Optional<CustomerTokenizationDecision> =
138138
customerTokenizationDecision.getOptional("customer_tokenization_decision")
139139

140+
/**
141+
* Contains the metadata for the digital wallet being tokenized.
142+
*
143+
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
144+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
145+
*/
146+
fun digitalWalletTokenMetadata(): TokenMetadata =
147+
digitalWalletTokenMetadata.getRequired("digital_wallet_token_metadata")
148+
140149
/**
141150
* The name of this event
142151
*
@@ -184,15 +193,6 @@ private constructor(
184193
*/
185194
fun device(): Optional<Device> = device.getOptional("device")
186195

187-
/**
188-
* Contains the metadata for the digital wallet being tokenized.
189-
*
190-
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
191-
* server responded with an unexpected value).
192-
*/
193-
fun digitalWalletTokenMetadata(): Optional<DigitalWalletTokenMetadata> =
194-
digitalWalletTokenMetadata.getOptional("digital_wallet_token_metadata")
195-
196196
/**
197197
* Results from rules that were evaluated for this tokenization
198198
*
@@ -263,6 +263,16 @@ private constructor(
263263
fun _customerTokenizationDecision(): JsonField<CustomerTokenizationDecision> =
264264
customerTokenizationDecision
265265

266+
/**
267+
* Returns the raw JSON value of [digitalWalletTokenMetadata].
268+
*
269+
* Unlike [digitalWalletTokenMetadata], this method doesn't throw if the JSON field has an
270+
* unexpected type.
271+
*/
272+
@JsonProperty("digital_wallet_token_metadata")
273+
@ExcludeMissing
274+
fun _digitalWalletTokenMetadata(): JsonField<TokenMetadata> = digitalWalletTokenMetadata
275+
266276
/**
267277
* Returns the raw JSON value of [eventType].
268278
*
@@ -316,17 +326,6 @@ private constructor(
316326
*/
317327
@JsonProperty("device") @ExcludeMissing fun _device(): JsonField<Device> = device
318328

319-
/**
320-
* Returns the raw JSON value of [digitalWalletTokenMetadata].
321-
*
322-
* Unlike [digitalWalletTokenMetadata], this method doesn't throw if the JSON field has an
323-
* unexpected type.
324-
*/
325-
@JsonProperty("digital_wallet_token_metadata")
326-
@ExcludeMissing
327-
fun _digitalWalletTokenMetadata(): JsonField<DigitalWalletTokenMetadata> =
328-
digitalWalletTokenMetadata
329-
330329
/**
331330
* Returns the raw JSON value of [ruleResults].
332331
*
@@ -391,6 +390,7 @@ private constructor(
391390
* .cardToken()
392391
* .created()
393392
* .customerTokenizationDecision()
393+
* .digitalWalletTokenMetadata()
394394
* .eventType()
395395
* .issuerDecision()
396396
* .tokenizationChannel()
@@ -408,14 +408,13 @@ private constructor(
408408
private var cardToken: JsonField<String>? = null
409409
private var created: JsonField<OffsetDateTime>? = null
410410
private var customerTokenizationDecision: JsonField<CustomerTokenizationDecision>? = null
411+
private var digitalWalletTokenMetadata: JsonField<TokenMetadata>? = null
411412
private var eventType: JsonField<EventType>? = null
412413
private var issuerDecision: JsonField<IssuerDecision>? = null
413414
private var tokenizationChannel: JsonField<TokenizationChannel>? = null
414415
private var tokenizationToken: JsonField<String>? = null
415416
private var walletDecisioningInfo: JsonField<WalletDecisioningInfo>? = null
416417
private var device: JsonField<Device> = JsonMissing.of()
417-
private var digitalWalletTokenMetadata: JsonField<DigitalWalletTokenMetadata> =
418-
JsonMissing.of()
419418
private var ruleResults: JsonField<MutableList<TokenizationRuleResult>>? = null
420419
private var tokenizationDeclineReasons: JsonField<MutableList<TokenizationDeclineReason>>? =
421420
null
@@ -433,6 +432,8 @@ private constructor(
433432
created = digitalWalletTokenizationApprovalRequestWebhookEvent.created
434433
customerTokenizationDecision =
435434
digitalWalletTokenizationApprovalRequestWebhookEvent.customerTokenizationDecision
435+
digitalWalletTokenMetadata =
436+
digitalWalletTokenizationApprovalRequestWebhookEvent.digitalWalletTokenMetadata
436437
eventType = digitalWalletTokenizationApprovalRequestWebhookEvent.eventType
437438
issuerDecision = digitalWalletTokenizationApprovalRequestWebhookEvent.issuerDecision
438439
tokenizationChannel =
@@ -442,8 +443,6 @@ private constructor(
442443
walletDecisioningInfo =
443444
digitalWalletTokenizationApprovalRequestWebhookEvent.walletDecisioningInfo
444445
device = digitalWalletTokenizationApprovalRequestWebhookEvent.device
445-
digitalWalletTokenMetadata =
446-
digitalWalletTokenizationApprovalRequestWebhookEvent.digitalWalletTokenMetadata
447446
ruleResults =
448447
digitalWalletTokenizationApprovalRequestWebhookEvent.ruleResults.map {
449448
it.toMutableList()
@@ -524,6 +523,22 @@ private constructor(
524523
customerTokenizationDecision: JsonField<CustomerTokenizationDecision>
525524
) = apply { this.customerTokenizationDecision = customerTokenizationDecision }
526525

526+
/** Contains the metadata for the digital wallet being tokenized. */
527+
fun digitalWalletTokenMetadata(digitalWalletTokenMetadata: TokenMetadata) =
528+
digitalWalletTokenMetadata(JsonField.of(digitalWalletTokenMetadata))
529+
530+
/**
531+
* Sets [Builder.digitalWalletTokenMetadata] to an arbitrary JSON value.
532+
*
533+
* You should usually call [Builder.digitalWalletTokenMetadata] with a well-typed
534+
* [TokenMetadata] value instead. This method is primarily for setting the field to an
535+
* undocumented or not yet supported value.
536+
*/
537+
fun digitalWalletTokenMetadata(digitalWalletTokenMetadata: JsonField<TokenMetadata>) =
538+
apply {
539+
this.digitalWalletTokenMetadata = digitalWalletTokenMetadata
540+
}
541+
527542
/** The name of this event */
528543
fun eventType(eventType: EventType) = eventType(JsonField.of(eventType))
529544

@@ -608,21 +623,6 @@ private constructor(
608623
*/
609624
fun device(device: JsonField<Device>) = apply { this.device = device }
610625

611-
/** Contains the metadata for the digital wallet being tokenized. */
612-
fun digitalWalletTokenMetadata(digitalWalletTokenMetadata: DigitalWalletTokenMetadata) =
613-
digitalWalletTokenMetadata(JsonField.of(digitalWalletTokenMetadata))
614-
615-
/**
616-
* Sets [Builder.digitalWalletTokenMetadata] to an arbitrary JSON value.
617-
*
618-
* You should usually call [Builder.digitalWalletTokenMetadata] with a well-typed
619-
* [DigitalWalletTokenMetadata] value instead. This method is primarily for setting the
620-
* field to an undocumented or not yet supported value.
621-
*/
622-
fun digitalWalletTokenMetadata(
623-
digitalWalletTokenMetadata: JsonField<DigitalWalletTokenMetadata>
624-
) = apply { this.digitalWalletTokenMetadata = digitalWalletTokenMetadata }
625-
626626
/** Results from rules that were evaluated for this tokenization */
627627
fun ruleResults(ruleResults: List<TokenizationRuleResult>) =
628628
ruleResults(JsonField.of(ruleResults))
@@ -754,6 +754,7 @@ private constructor(
754754
* .cardToken()
755755
* .created()
756756
* .customerTokenizationDecision()
757+
* .digitalWalletTokenMetadata()
757758
* .eventType()
758759
* .issuerDecision()
759760
* .tokenizationChannel()
@@ -769,13 +770,13 @@ private constructor(
769770
checkRequired("cardToken", cardToken),
770771
checkRequired("created", created),
771772
checkRequired("customerTokenizationDecision", customerTokenizationDecision),
773+
checkRequired("digitalWalletTokenMetadata", digitalWalletTokenMetadata),
772774
checkRequired("eventType", eventType),
773775
checkRequired("issuerDecision", issuerDecision),
774776
checkRequired("tokenizationChannel", tokenizationChannel),
775777
checkRequired("tokenizationToken", tokenizationToken),
776778
checkRequired("walletDecisioningInfo", walletDecisioningInfo),
777779
device,
778-
digitalWalletTokenMetadata,
779780
(ruleResults ?: JsonMissing.of()).map { it.toImmutable() },
780781
(tokenizationDeclineReasons ?: JsonMissing.of()).map { it.toImmutable() },
781782
tokenizationSource,
@@ -795,13 +796,13 @@ private constructor(
795796
cardToken()
796797
created()
797798
customerTokenizationDecision().ifPresent { it.validate() }
799+
digitalWalletTokenMetadata().validate()
798800
eventType().validate()
799801
issuerDecision().validate()
800802
tokenizationChannel().validate()
801803
tokenizationToken()
802804
walletDecisioningInfo().validate()
803805
device().ifPresent { it.validate() }
804-
digitalWalletTokenMetadata().ifPresent { it.validate() }
805806
ruleResults().ifPresent { it.forEach { it.validate() } }
806807
tokenizationDeclineReasons().ifPresent { it.forEach { it.validate() } }
807808
tokenizationSource().ifPresent { it.validate() }
@@ -828,13 +829,13 @@ private constructor(
828829
(if (cardToken.asKnown().isPresent) 1 else 0) +
829830
(if (created.asKnown().isPresent) 1 else 0) +
830831
(customerTokenizationDecision.asKnown().getOrNull()?.validity() ?: 0) +
832+
(digitalWalletTokenMetadata.asKnown().getOrNull()?.validity() ?: 0) +
831833
(eventType.asKnown().getOrNull()?.validity() ?: 0) +
832834
(issuerDecision.asKnown().getOrNull()?.validity() ?: 0) +
833835
(tokenizationChannel.asKnown().getOrNull()?.validity() ?: 0) +
834836
(if (tokenizationToken.asKnown().isPresent) 1 else 0) +
835837
(walletDecisioningInfo.asKnown().getOrNull()?.validity() ?: 0) +
836838
(device.asKnown().getOrNull()?.validity() ?: 0) +
837-
(digitalWalletTokenMetadata.asKnown().getOrNull()?.validity() ?: 0) +
838839
(ruleResults.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
839840
(tokenizationDeclineReasons.asKnown().getOrNull()?.sumOf { it.validity().toInt() }
840841
?: 0) +
@@ -1845,13 +1846,13 @@ private constructor(
18451846
cardToken == other.cardToken &&
18461847
created == other.created &&
18471848
customerTokenizationDecision == other.customerTokenizationDecision &&
1849+
digitalWalletTokenMetadata == other.digitalWalletTokenMetadata &&
18481850
eventType == other.eventType &&
18491851
issuerDecision == other.issuerDecision &&
18501852
tokenizationChannel == other.tokenizationChannel &&
18511853
tokenizationToken == other.tokenizationToken &&
18521854
walletDecisioningInfo == other.walletDecisioningInfo &&
18531855
device == other.device &&
1854-
digitalWalletTokenMetadata == other.digitalWalletTokenMetadata &&
18551856
ruleResults == other.ruleResults &&
18561857
tokenizationDeclineReasons == other.tokenizationDeclineReasons &&
18571858
tokenizationSource == other.tokenizationSource &&
@@ -1865,13 +1866,13 @@ private constructor(
18651866
cardToken,
18661867
created,
18671868
customerTokenizationDecision,
1869+
digitalWalletTokenMetadata,
18681870
eventType,
18691871
issuerDecision,
18701872
tokenizationChannel,
18711873
tokenizationToken,
18721874
walletDecisioningInfo,
18731875
device,
1874-
digitalWalletTokenMetadata,
18751876
ruleResults,
18761877
tokenizationDeclineReasons,
18771878
tokenizationSource,
@@ -1883,5 +1884,5 @@ private constructor(
18831884
override fun hashCode(): Int = hashCode
18841885

18851886
override fun toString() =
1886-
"DigitalWalletTokenizationApprovalRequestWebhookEvent{accountToken=$accountToken, cardToken=$cardToken, created=$created, customerTokenizationDecision=$customerTokenizationDecision, eventType=$eventType, issuerDecision=$issuerDecision, tokenizationChannel=$tokenizationChannel, tokenizationToken=$tokenizationToken, walletDecisioningInfo=$walletDecisioningInfo, device=$device, digitalWalletTokenMetadata=$digitalWalletTokenMetadata, ruleResults=$ruleResults, tokenizationDeclineReasons=$tokenizationDeclineReasons, tokenizationSource=$tokenizationSource, tokenizationTfaReasons=$tokenizationTfaReasons, additionalProperties=$additionalProperties}"
1887+
"DigitalWalletTokenizationApprovalRequestWebhookEvent{accountToken=$accountToken, cardToken=$cardToken, created=$created, customerTokenizationDecision=$customerTokenizationDecision, digitalWalletTokenMetadata=$digitalWalletTokenMetadata, eventType=$eventType, issuerDecision=$issuerDecision, tokenizationChannel=$tokenizationChannel, tokenizationToken=$tokenizationToken, walletDecisioningInfo=$walletDecisioningInfo, device=$device, ruleResults=$ruleResults, tokenizationDeclineReasons=$tokenizationDeclineReasons, tokenizationSource=$tokenizationSource, tokenizationTfaReasons=$tokenizationTfaReasons, additionalProperties=$additionalProperties}"
18871888
}

0 commit comments

Comments
 (0)