Skip to content

Commit 5b5091a

Browse files
feat(api): add Optional parameter overloads to transaction response builders
1 parent 6b438b7 commit 5b5091a

14 files changed

Lines changed: 47 additions & 23 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 214
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-2d2600072500797474f0d7798c1a8b668bfbc4e0c6a8f076ca7b4cc7ad82058b.yml
3-
openapi_spec_hash: 7605eb6be77a3d150078916f0eb0e9ac
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-6683cf82e93cfd95e17b0386f070333486fe8e7b857b47c62e09682362d5991d.yml
3+
openapi_spec_hash: ce2c1f6201bb2036d05602238503eb6b
44
config_hash: 5bb913c05ebeb301ec925b16e75bb251

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import kotlin.jvm.optionals.getOrNull
2424
/**
2525
* Card program's response to Authorization Challenge. Programs that have Authorization Challenges
2626
* configured as Out of Band receive a
27-
* [card_authorization.challenge](https://docs.lithic.com/reference/post_card-authorization-challenge)
27+
* [card_authorization.challenge](https://docs.lithic.com/reference/cardauthorizationchallengewebhook)
2828
* webhook when an authorization attempt triggers a challenge. The card program should respond using
2929
* this endpoint after the cardholder completes the challenge.
3030
*/

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private constructor(
151151
* receiving this request, the Card Program should issue its own challenge to the cardholder.
152152
* After a cardholder challenge is successfully completed, the Card Program needs to respond
153153
* back to Lithic by call to
154-
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response).
154+
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/postthreedschallengeresponse).
155155
* Then the cardholder must navigate back to the merchant checkout flow to complete the
156156
* transaction. Some merchants will include an `app_requestor_url` for app-based purchases;
157157
* Lithic recommends triggering a redirect to that URL after the cardholder completes an
@@ -374,7 +374,7 @@ private constructor(
374374
* receiving this request, the Card Program should issue its own challenge to the
375375
* cardholder. After a cardholder challenge is successfully completed, the Card Program
376376
* needs to respond back to Lithic by call to
377-
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response).
377+
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/postthreedschallengeresponse).
378378
* Then the cardholder must navigate back to the merchant checkout flow to complete the
379379
* transaction. Some merchants will include an `app_requestor_url` for app-based
380380
* purchases; Lithic recommends triggering a redirect to that URL after the cardholder
@@ -588,7 +588,7 @@ private constructor(
588588
* receiving this request, the Card Program should issue its own challenge to the cardholder.
589589
* After a cardholder challenge is successfully completed, the Card Program needs to respond
590590
* back to Lithic by call to
591-
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response).
591+
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/postthreedschallengeresponse).
592592
* Then the cardholder must navigate back to the merchant checkout flow to complete the
593593
* transaction. Some merchants will include an `app_requestor_url` for app-based purchases;
594594
* Lithic recommends triggering a redirect to that URL after the cardholder completes an

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ private constructor(
409409
* receiving this request, the Card Program should issue its own challenge to the cardholder.
410410
* After a cardholder challenge is successfully completed, the Card Program needs to respond
411411
* back to Lithic by call to
412-
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response).
412+
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/postthreedschallengeresponse).
413413
* Then the cardholder must navigate back to the merchant checkout flow to complete the
414414
* transaction. Some merchants will include an `app_requestor_url` for app-based purchases;
415415
* Lithic recommends triggering a redirect to that URL after the cardholder completes an

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ private constructor(
419419
* receiving this request, the Card Program should issue its own challenge to the cardholder.
420420
* After a cardholder challenge is successfully completed, the Card Program needs to respond
421421
* back to Lithic by call to
422-
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response).
422+
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/postthreedschallengeresponse).
423423
* Then the cardholder must navigate back to the merchant checkout flow to complete the
424424
* transaction. Some merchants will include an `app_requestor_url` for app-based purchases;
425425
* Lithic recommends triggering a redirect to that URL after the cardholder completes an

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ private constructor(
742742
* receiving this request, the Card Program should issue its own challenge to the cardholder.
743743
* After a cardholder challenge is successfully completed, the Card Program needs to respond
744744
* back to Lithic by call to
745-
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response).
745+
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/postthreedschallengeresponse).
746746
* Then the cardholder must navigate back to the merchant checkout flow to complete the
747747
* transaction. Some merchants will include an `app_requestor_url` for app-based purchases;
748748
* Lithic recommends triggering a redirect to that URL after the cardholder completes an

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private constructor(
765765
* receiving this request, the Card Program should issue its own challenge to the cardholder.
766766
* After a cardholder challenge is successfully completed, the Card Program needs to respond
767767
* back to Lithic by call to
768-
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response).
768+
* [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/postthreedschallengeresponse).
769769
* Then the cardholder must navigate back to the merchant checkout flow to complete the
770770
* transaction. Some merchants will include an `app_requestor_url` for app-based purchases;
771771
* Lithic recommends triggering a redirect to that URL after the cardholder completes an

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import java.util.Objects
1111

1212
/**
1313
* Card program's response to a 3DS Challenge Request. Challenge Request is emitted as a webhook
14-
* [three_ds_authentication.challenge](https://docs.lithic.com/reference/post_three-ds-authentication-challenge)
14+
* [three_ds_authentication.challenge](https://docs.lithic.com/reference/threedsauthenticationchallengewebhook)
1515
* and your Card Program needs to be configured with Out of Band (OOB) Challenges in order to
1616
* receive it (see https://docs.lithic.com/docs/3ds-challenge-flow for more information).
1717
*/

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ private constructor(
278278
}
279279

280280
/** Provides additional context or details about the fraud report. */
281-
fun comment(comment: String) = comment(JsonField.of(comment))
281+
fun comment(comment: String?) = comment(JsonField.ofNullable(comment))
282+
283+
/** Alias for calling [Builder.comment] with `comment.orElse(null)`. */
284+
fun comment(comment: Optional<String>) = comment(comment.getOrNull())
282285

283286
/**
284287
* Sets [Builder.comment] to an arbitrary JSON value.
@@ -289,7 +292,10 @@ private constructor(
289292
fun comment(comment: JsonField<String>) = apply { this.comment = comment }
290293

291294
/** Timestamp representing when the fraud report was created. */
292-
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
295+
fun createdAt(createdAt: OffsetDateTime?) = createdAt(JsonField.ofNullable(createdAt))
296+
297+
/** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */
298+
fun createdAt(createdAt: Optional<OffsetDateTime>) = createdAt(createdAt.getOrNull())
293299

294300
/**
295301
* Sets [Builder.createdAt] to an arbitrary JSON value.
@@ -320,7 +326,10 @@ private constructor(
320326
* coerces a legitimate cardholder into unauthorized transactions, often through social
321327
* engineering tactics.
322328
*/
323-
fun fraudType(fraudType: FraudType) = fraudType(JsonField.of(fraudType))
329+
fun fraudType(fraudType: FraudType?) = fraudType(JsonField.ofNullable(fraudType))
330+
331+
/** Alias for calling [Builder.fraudType] with `fraudType.orElse(null)`. */
332+
fun fraudType(fraudType: Optional<FraudType>) = fraudType(fraudType.getOrNull())
324333

325334
/**
326335
* Sets [Builder.fraudType] to an arbitrary JSON value.
@@ -332,7 +341,10 @@ private constructor(
332341
fun fraudType(fraudType: JsonField<FraudType>) = apply { this.fraudType = fraudType }
333342

334343
/** Timestamp representing the last update to the fraud report. */
335-
fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt))
344+
fun updatedAt(updatedAt: OffsetDateTime?) = updatedAt(JsonField.ofNullable(updatedAt))
345+
346+
/** Alias for calling [Builder.updatedAt] with `updatedAt.orElse(null)`. */
347+
fun updatedAt(updatedAt: Optional<OffsetDateTime>) = updatedAt(updatedAt.getOrNull())
336348

337349
/**
338350
* Sets [Builder.updatedAt] to an arbitrary JSON value.

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ private constructor(
278278
}
279279

280280
/** Provides additional context or details about the fraud report. */
281-
fun comment(comment: String) = comment(JsonField.of(comment))
281+
fun comment(comment: String?) = comment(JsonField.ofNullable(comment))
282+
283+
/** Alias for calling [Builder.comment] with `comment.orElse(null)`. */
284+
fun comment(comment: Optional<String>) = comment(comment.getOrNull())
282285

283286
/**
284287
* Sets [Builder.comment] to an arbitrary JSON value.
@@ -289,7 +292,10 @@ private constructor(
289292
fun comment(comment: JsonField<String>) = apply { this.comment = comment }
290293

291294
/** Timestamp representing when the fraud report was created. */
292-
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
295+
fun createdAt(createdAt: OffsetDateTime?) = createdAt(JsonField.ofNullable(createdAt))
296+
297+
/** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */
298+
fun createdAt(createdAt: Optional<OffsetDateTime>) = createdAt(createdAt.getOrNull())
293299

294300
/**
295301
* Sets [Builder.createdAt] to an arbitrary JSON value.
@@ -320,7 +326,10 @@ private constructor(
320326
* coerces a legitimate cardholder into unauthorized transactions, often through social
321327
* engineering tactics.
322328
*/
323-
fun fraudType(fraudType: FraudType) = fraudType(JsonField.of(fraudType))
329+
fun fraudType(fraudType: FraudType?) = fraudType(JsonField.ofNullable(fraudType))
330+
331+
/** Alias for calling [Builder.fraudType] with `fraudType.orElse(null)`. */
332+
fun fraudType(fraudType: Optional<FraudType>) = fraudType(fraudType.getOrNull())
324333

325334
/**
326335
* Sets [Builder.fraudType] to an arbitrary JSON value.
@@ -332,7 +341,10 @@ private constructor(
332341
fun fraudType(fraudType: JsonField<FraudType>) = apply { this.fraudType = fraudType }
333342

334343
/** Timestamp representing the last update to the fraud report. */
335-
fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt))
344+
fun updatedAt(updatedAt: OffsetDateTime?) = updatedAt(JsonField.ofNullable(updatedAt))
345+
346+
/** Alias for calling [Builder.updatedAt] with `updatedAt.orElse(null)`. */
347+
fun updatedAt(updatedAt: Optional<OffsetDateTime>) = updatedAt(updatedAt.getOrNull())
336348

337349
/**
338350
* Sets [Builder.updatedAt] to an arbitrary JSON value.

0 commit comments

Comments
 (0)