diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ae680287b..508a7081b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.102.2" + ".": "0.103.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 1297b8759..bfde9d73c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 169 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-e16df7d65a6ababc8e0ca1f2a65070893d82d3b2b046394ab708d56fe717b3ad.yml -openapi_spec_hash: ee82cf8fd5bb6b86abbae304f6c43934 -config_hash: c6d56596249e319c59d49d8e49a190b1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-117e0ee9b030a2efc3b09e189e445fb1a26fd32f1c563f385b9d7071a959c550.yml +openapi_spec_hash: e529a3fa8c3a79d3664db391683334c3 +config_hash: 22e4b128e110e2767daa9d95428ebf9d diff --git a/CHANGELOG.md b/CHANGELOG.md index e84bc4606..e96859fd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.103.0 (2025-09-03) + +Full Changelog: [v0.102.2...v0.103.0](https://github.com/lithic-com/lithic-java/compare/v0.102.2...v0.103.0) + +### Features + +* **api:** adds support for delegated KYB onboarding and more device details in 3DS Authentications ([bd0d218](https://github.com/lithic-com/lithic-java/commit/bd0d218d1258c9a8e0d964ce726e682a9c9251cc)) + ## 0.102.2 (2025-09-03) Full Changelog: [v0.102.1...v0.102.2](https://github.com/lithic-com/lithic-java/compare/v0.102.1...v0.102.2) diff --git a/README.md b/README.md index 734513af3..cef9e62fb 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.102.2) -[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.102.2/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.102.2) +[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.103.0) +[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.103.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.103.0) @@ -13,7 +13,7 @@ The Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differenc -The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.102.2). +The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.103.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic ### Gradle ```kotlin -implementation("com.lithic.api:lithic-java:0.102.2") +implementation("com.lithic.api:lithic-java:0.103.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.lithic.api:lithic-java:0.102.2") com.lithic.api lithic-java - 0.102.2 + 0.103.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index ce35cde4c..c51a2cf97 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.lithic.api" - version = "0.102.2" // x-release-please-version + version = "0.103.0" // x-release-please-version } subprojects { diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt index d9b6c8fd3..c75cd40ed 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt @@ -4482,6 +4482,8 @@ private constructor( @JvmField val TRANSFER = of("TRANSFER") + @JvmField val COLLECTION = of("COLLECTION") + @JvmStatic fun of(value: String) = BookTransferType(JsonField.of(value)) } @@ -4520,6 +4522,7 @@ private constructor( DISPUTE_WON, SERVICE, TRANSFER, + COLLECTION, } /** @@ -4567,6 +4570,7 @@ private constructor( DISPUTE_WON, SERVICE, TRANSFER, + COLLECTION, /** * An enum member indicating that [BookTransferType] was instantiated with an * unknown value. @@ -4616,6 +4620,7 @@ private constructor( DISPUTE_WON -> Value.DISPUTE_WON SERVICE -> Value.SERVICE TRANSFER -> Value.TRANSFER + COLLECTION -> Value.COLLECTION else -> Value._UNKNOWN } @@ -4663,6 +4668,7 @@ private constructor( DISPUTE_WON -> Known.DISPUTE_WON SERVICE -> Known.SERVICE TRANSFER -> Known.TRANSFER + COLLECTION -> Known.COLLECTION else -> throw LithicInvalidDataException("Unknown BookTransferType: $value") } @@ -7320,6 +7326,7 @@ private constructor( private val currency: JsonField, private val expectedReleaseDate: JsonField, private val externalBankAccountToken: JsonField, + private val type: JsonField, private val userDefinedId: JsonField, private val additionalProperties: MutableMap, ) { @@ -7380,6 +7387,7 @@ private constructor( @JsonProperty("external_bank_account_token") @ExcludeMissing externalBankAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing userDefinedId: JsonField = JsonMissing.of(), @@ -7404,6 +7412,7 @@ private constructor( currency, expectedReleaseDate, externalBankAccountToken, + type, userDefinedId, mutableMapOf(), ) @@ -7570,6 +7579,12 @@ private constructor( fun externalBankAccountToken(): Optional = externalBankAccountToken.getOptional("external_bank_account_token") + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun type(): Optional = type.getOptional("type") + /** * User-defined identifier * @@ -7749,6 +7764,13 @@ private constructor( @ExcludeMissing fun _externalBankAccountToken(): JsonField = externalBankAccountToken + /** + * Returns the raw JSON value of [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + /** * Returns the raw JSON value of [userDefinedId]. * @@ -7823,6 +7845,7 @@ private constructor( private var currency: JsonField = JsonMissing.of() private var expectedReleaseDate: JsonField = JsonMissing.of() private var externalBankAccountToken: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -7848,6 +7871,7 @@ private constructor( currency = paymentTransaction.currency expectedReleaseDate = paymentTransaction.expectedReleaseDate externalBankAccountToken = paymentTransaction.externalBankAccountToken + type = paymentTransaction.type userDefinedId = paymentTransaction.userDefinedId additionalProperties = paymentTransaction.additionalProperties.toMutableMap() } @@ -8149,6 +8173,17 @@ private constructor( this.externalBankAccountToken = externalBankAccountToken } + fun type(type: TransferType) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [TransferType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun type(type: JsonField) = apply { this.type = type } + /** User-defined identifier */ fun userDefinedId(userDefinedId: String?) = userDefinedId(JsonField.ofNullable(userDefinedId)) @@ -8237,6 +8272,7 @@ private constructor( currency, expectedReleaseDate, externalBankAccountToken, + type, userDefinedId, additionalProperties.toMutableMap(), ) @@ -8269,6 +8305,7 @@ private constructor( currency() expectedReleaseDate() externalBankAccountToken() + type().ifPresent { it.validate() } userDefinedId() validated = true } @@ -8309,6 +8346,7 @@ private constructor( (if (currency.asKnown().isPresent) 1 else 0) + (if (expectedReleaseDate.asKnown().isPresent) 1 else 0) + (if (externalBankAccountToken.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + (if (userDefinedId.asKnown().isPresent) 1 else 0) /** Transaction category */ @@ -10694,67 +10732,42 @@ private constructor( class WireMethodAttributes private constructor( - private val wireTransferType: JsonField, - private val externalBankName: JsonField, - private val externalBankRoutingNumber: JsonField, - private val externalIndividualName: JsonField, - private val imad: JsonField, - private val lithicBankName: JsonField, - private val lithicBankRoutingNumber: JsonField, - private val lithicIndividualName: JsonField, - private val omad: JsonField, - private val previousTransfer: JsonField, - private val wireToken: JsonField, + private val wireNetwork: JsonField, + private val creditor: JsonField, + private val debtor: JsonField, + private val messageId: JsonField, + private val remittanceInformation: JsonField, + private val wireMessageType: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("wire_transfer_type") - @ExcludeMissing - wireTransferType: JsonField = JsonMissing.of(), - @JsonProperty("external_bank_name") - @ExcludeMissing - externalBankName: JsonField = JsonMissing.of(), - @JsonProperty("external_bank_routing_number") - @ExcludeMissing - externalBankRoutingNumber: JsonField = JsonMissing.of(), - @JsonProperty("external_individual_name") - @ExcludeMissing - externalIndividualName: JsonField = JsonMissing.of(), - @JsonProperty("imad") + @JsonProperty("wire_network") @ExcludeMissing - imad: JsonField = JsonMissing.of(), - @JsonProperty("lithic_bank_name") + wireNetwork: JsonField = JsonMissing.of(), + @JsonProperty("creditor") @ExcludeMissing - lithicBankName: JsonField = JsonMissing.of(), - @JsonProperty("lithic_bank_routing_number") + creditor: JsonField = JsonMissing.of(), + @JsonProperty("debtor") @ExcludeMissing - lithicBankRoutingNumber: JsonField = JsonMissing.of(), - @JsonProperty("lithic_individual_name") + debtor: JsonField = JsonMissing.of(), + @JsonProperty("message_id") @ExcludeMissing - lithicIndividualName: JsonField = JsonMissing.of(), - @JsonProperty("omad") + messageId: JsonField = JsonMissing.of(), + @JsonProperty("remittance_information") @ExcludeMissing - omad: JsonField = JsonMissing.of(), - @JsonProperty("previous_transfer") + remittanceInformation: JsonField = JsonMissing.of(), + @JsonProperty("wire_message_type") @ExcludeMissing - previousTransfer: JsonField = JsonMissing.of(), - @JsonProperty("wire_token") - @ExcludeMissing - wireToken: JsonField = JsonMissing.of(), + wireMessageType: JsonField = JsonMissing.of(), ) : this( - wireTransferType, - externalBankName, - externalBankRoutingNumber, - externalIndividualName, - imad, - lithicBankName, - lithicBankRoutingNumber, - lithicIndividualName, - omad, - previousTransfer, - wireToken, + wireNetwork, + creditor, + debtor, + messageId, + remittanceInformation, + wireMessageType, mutableMapOf(), ) @@ -10765,201 +10778,106 @@ private constructor( * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun wireTransferType(): WireTransferType = - wireTransferType.getRequired("wire_transfer_type") + fun wireNetwork(): WireNetwork = wireNetwork.getRequired("wire_network") /** - * External bank name - * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun externalBankName(): Optional = - externalBankName.getOptional("external_bank_name") + fun creditor(): Optional = creditor.getOptional("creditor") /** - * External bank routing number - * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun externalBankRoutingNumber(): Optional = - externalBankRoutingNumber.getOptional("external_bank_routing_number") + fun debtor(): Optional = debtor.getOptional("debtor") /** - * External individual name + * Point to point reference identifier, as assigned by the instructing party, used + * for tracking the message through the Fedwire system * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun externalIndividualName(): Optional = - externalIndividualName.getOptional("external_individual_name") + fun messageId(): Optional = messageId.getOptional("message_id") /** - * IMAD + * Payment details or invoice reference * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun imad(): Optional = imad.getOptional("imad") + fun remittanceInformation(): Optional = + remittanceInformation.getOptional("remittance_information") /** - * Lithic bank name + * Type of wire message * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun lithicBankName(): Optional = - lithicBankName.getOptional("lithic_bank_name") + fun wireMessageType(): Optional = + wireMessageType.getOptional("wire_message_type") /** - * Lithic bank routing number + * Returns the raw JSON value of [wireNetwork]. * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun lithicBankRoutingNumber(): Optional = - lithicBankRoutingNumber.getOptional("lithic_bank_routing_number") - - /** - * Lithic individual name - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun lithicIndividualName(): Optional = - lithicIndividualName.getOptional("lithic_individual_name") - - /** - * OMAD - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun omad(): Optional = omad.getOptional("omad") - - /** - * UUID of previous transfer if this is a retry - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun previousTransfer(): Optional = - previousTransfer.getOptional("previous_transfer") - - /** - * Wire token - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun wireToken(): Optional = wireToken.getOptional("wire_token") - - /** - * Returns the raw JSON value of [wireTransferType]. - * - * Unlike [wireTransferType], this method doesn't throw if the JSON field has an + * Unlike [wireNetwork], this method doesn't throw if the JSON field has an * unexpected type. */ - @JsonProperty("wire_transfer_type") + @JsonProperty("wire_network") @ExcludeMissing - fun _wireTransferType(): JsonField = wireTransferType + fun _wireNetwork(): JsonField = wireNetwork /** - * Returns the raw JSON value of [externalBankName]. + * Returns the raw JSON value of [creditor]. * - * Unlike [externalBankName], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("external_bank_name") - @ExcludeMissing - fun _externalBankName(): JsonField = externalBankName - - /** - * Returns the raw JSON value of [externalBankRoutingNumber]. - * - * Unlike [externalBankRoutingNumber], this method doesn't throw if the JSON field - * has an unexpected type. + * Unlike [creditor], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("external_bank_routing_number") + @JsonProperty("creditor") @ExcludeMissing - fun _externalBankRoutingNumber(): JsonField = externalBankRoutingNumber + fun _creditor(): JsonField = creditor /** - * Returns the raw JSON value of [externalIndividualName]. + * Returns the raw JSON value of [debtor]. * - * Unlike [externalIndividualName], this method doesn't throw if the JSON field has - * an unexpected type. + * Unlike [debtor], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("external_individual_name") + @JsonProperty("debtor") @ExcludeMissing - fun _externalIndividualName(): JsonField = externalIndividualName + fun _debtor(): JsonField = debtor /** - * Returns the raw JSON value of [imad]. + * Returns the raw JSON value of [messageId]. * - * Unlike [imad], this method doesn't throw if the JSON field has an unexpected + * Unlike [messageId], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("imad") @ExcludeMissing fun _imad(): JsonField = imad - - /** - * Returns the raw JSON value of [lithicBankName]. - * - * Unlike [lithicBankName], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("lithic_bank_name") + @JsonProperty("message_id") @ExcludeMissing - fun _lithicBankName(): JsonField = lithicBankName + fun _messageId(): JsonField = messageId /** - * Returns the raw JSON value of [lithicBankRoutingNumber]. + * Returns the raw JSON value of [remittanceInformation]. * - * Unlike [lithicBankRoutingNumber], this method doesn't throw if the JSON field has + * Unlike [remittanceInformation], this method doesn't throw if the JSON field has * an unexpected type. */ - @JsonProperty("lithic_bank_routing_number") - @ExcludeMissing - fun _lithicBankRoutingNumber(): JsonField = lithicBankRoutingNumber - - /** - * Returns the raw JSON value of [lithicIndividualName]. - * - * Unlike [lithicIndividualName], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("lithic_individual_name") + @JsonProperty("remittance_information") @ExcludeMissing - fun _lithicIndividualName(): JsonField = lithicIndividualName + fun _remittanceInformation(): JsonField = remittanceInformation /** - * Returns the raw JSON value of [omad]. + * Returns the raw JSON value of [wireMessageType]. * - * Unlike [omad], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("omad") @ExcludeMissing fun _omad(): JsonField = omad - - /** - * Returns the raw JSON value of [previousTransfer]. - * - * Unlike [previousTransfer], this method doesn't throw if the JSON field has an + * Unlike [wireMessageType], this method doesn't throw if the JSON field has an * unexpected type. */ - @JsonProperty("previous_transfer") + @JsonProperty("wire_message_type") @ExcludeMissing - fun _previousTransfer(): JsonField = previousTransfer - - /** - * Returns the raw JSON value of [wireToken]. - * - * Unlike [wireToken], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("wire_token") - @ExcludeMissing - fun _wireToken(): JsonField = wireToken + fun _wireMessageType(): JsonField = wireMessageType @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -10981,7 +10899,7 @@ private constructor( * * The following fields are required: * ```java - * .wireTransferType() + * .wireNetwork() * ``` */ @JvmStatic fun builder() = Builder() @@ -10990,252 +10908,120 @@ private constructor( /** A builder for [WireMethodAttributes]. */ class Builder internal constructor() { - private var wireTransferType: JsonField? = null - private var externalBankName: JsonField = JsonMissing.of() - private var externalBankRoutingNumber: JsonField = JsonMissing.of() - private var externalIndividualName: JsonField = JsonMissing.of() - private var imad: JsonField = JsonMissing.of() - private var lithicBankName: JsonField = JsonMissing.of() - private var lithicBankRoutingNumber: JsonField = JsonMissing.of() - private var lithicIndividualName: JsonField = JsonMissing.of() - private var omad: JsonField = JsonMissing.of() - private var previousTransfer: JsonField = JsonMissing.of() - private var wireToken: JsonField = JsonMissing.of() + private var wireNetwork: JsonField? = null + private var creditor: JsonField = JsonMissing.of() + private var debtor: JsonField = JsonMissing.of() + private var messageId: JsonField = JsonMissing.of() + private var remittanceInformation: JsonField = JsonMissing.of() + private var wireMessageType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(wireMethodAttributes: WireMethodAttributes) = apply { - wireTransferType = wireMethodAttributes.wireTransferType - externalBankName = wireMethodAttributes.externalBankName - externalBankRoutingNumber = wireMethodAttributes.externalBankRoutingNumber - externalIndividualName = wireMethodAttributes.externalIndividualName - imad = wireMethodAttributes.imad - lithicBankName = wireMethodAttributes.lithicBankName - lithicBankRoutingNumber = wireMethodAttributes.lithicBankRoutingNumber - lithicIndividualName = wireMethodAttributes.lithicIndividualName - omad = wireMethodAttributes.omad - previousTransfer = wireMethodAttributes.previousTransfer - wireToken = wireMethodAttributes.wireToken + wireNetwork = wireMethodAttributes.wireNetwork + creditor = wireMethodAttributes.creditor + debtor = wireMethodAttributes.debtor + messageId = wireMethodAttributes.messageId + remittanceInformation = wireMethodAttributes.remittanceInformation + wireMessageType = wireMethodAttributes.wireMessageType additionalProperties = wireMethodAttributes.additionalProperties.toMutableMap() } /** Type of wire transfer */ - fun wireTransferType(wireTransferType: WireTransferType) = - wireTransferType(JsonField.of(wireTransferType)) + fun wireNetwork(wireNetwork: WireNetwork) = + wireNetwork(JsonField.of(wireNetwork)) /** - * Sets [Builder.wireTransferType] to an arbitrary JSON value. + * Sets [Builder.wireNetwork] to an arbitrary JSON value. * - * You should usually call [Builder.wireTransferType] with a well-typed - * [WireTransferType] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. + * You should usually call [Builder.wireNetwork] with a well-typed [WireNetwork] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. */ - fun wireTransferType(wireTransferType: JsonField) = apply { - this.wireTransferType = wireTransferType + fun wireNetwork(wireNetwork: JsonField) = apply { + this.wireNetwork = wireNetwork } - /** External bank name */ - fun externalBankName(externalBankName: String?) = - externalBankName(JsonField.ofNullable(externalBankName)) + fun creditor(creditor: WirePartyDetails) = creditor(JsonField.of(creditor)) /** - * Alias for calling [Builder.externalBankName] with - * `externalBankName.orElse(null)`. - */ - fun externalBankName(externalBankName: Optional) = - externalBankName(externalBankName.getOrNull()) - - /** - * Sets [Builder.externalBankName] to an arbitrary JSON value. + * Sets [Builder.creditor] to an arbitrary JSON value. * - * You should usually call [Builder.externalBankName] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. + * You should usually call [Builder.creditor] with a well-typed + * [WirePartyDetails] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. */ - fun externalBankName(externalBankName: JsonField) = apply { - this.externalBankName = externalBankName + fun creditor(creditor: JsonField) = apply { + this.creditor = creditor } - /** External bank routing number */ - fun externalBankRoutingNumber(externalBankRoutingNumber: String?) = - externalBankRoutingNumber(JsonField.ofNullable(externalBankRoutingNumber)) + fun debtor(debtor: WirePartyDetails) = debtor(JsonField.of(debtor)) /** - * Alias for calling [Builder.externalBankRoutingNumber] with - * `externalBankRoutingNumber.orElse(null)`. - */ - fun externalBankRoutingNumber(externalBankRoutingNumber: Optional) = - externalBankRoutingNumber(externalBankRoutingNumber.getOrNull()) - - /** - * Sets [Builder.externalBankRoutingNumber] to an arbitrary JSON value. + * Sets [Builder.debtor] to an arbitrary JSON value. * - * You should usually call [Builder.externalBankRoutingNumber] with a well-typed - * [String] value instead. This method is primarily for setting the field to an + * You should usually call [Builder.debtor] with a well-typed [WirePartyDetails] + * value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ - fun externalBankRoutingNumber(externalBankRoutingNumber: JsonField) = - apply { - this.externalBankRoutingNumber = externalBankRoutingNumber - } - - /** External individual name */ - fun externalIndividualName(externalIndividualName: String?) = - externalIndividualName(JsonField.ofNullable(externalIndividualName)) + fun debtor(debtor: JsonField) = apply { this.debtor = debtor } /** - * Alias for calling [Builder.externalIndividualName] with - * `externalIndividualName.orElse(null)`. + * Point to point reference identifier, as assigned by the instructing party, + * used for tracking the message through the Fedwire system */ - fun externalIndividualName(externalIndividualName: Optional) = - externalIndividualName(externalIndividualName.getOrNull()) + fun messageId(messageId: String?) = messageId(JsonField.ofNullable(messageId)) - /** - * Sets [Builder.externalIndividualName] to an arbitrary JSON value. - * - * You should usually call [Builder.externalIndividualName] with a well-typed - * [String] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun externalIndividualName(externalIndividualName: JsonField) = apply { - this.externalIndividualName = externalIndividualName - } - - /** IMAD */ - fun imad(imad: String?) = imad(JsonField.ofNullable(imad)) - - /** Alias for calling [Builder.imad] with `imad.orElse(null)`. */ - fun imad(imad: Optional) = imad(imad.getOrNull()) + /** Alias for calling [Builder.messageId] with `messageId.orElse(null)`. */ + fun messageId(messageId: Optional) = messageId(messageId.getOrNull()) /** - * Sets [Builder.imad] to an arbitrary JSON value. + * Sets [Builder.messageId] to an arbitrary JSON value. * - * You should usually call [Builder.imad] with a well-typed [String] value + * You should usually call [Builder.messageId] with a well-typed [String] value * instead. This method is primarily for setting the field to an undocumented or * not yet supported value. */ - fun imad(imad: JsonField) = apply { this.imad = imad } - - /** Lithic bank name */ - fun lithicBankName(lithicBankName: String?) = - lithicBankName(JsonField.ofNullable(lithicBankName)) - - /** - * Alias for calling [Builder.lithicBankName] with - * `lithicBankName.orElse(null)`. - */ - fun lithicBankName(lithicBankName: Optional) = - lithicBankName(lithicBankName.getOrNull()) - - /** - * Sets [Builder.lithicBankName] to an arbitrary JSON value. - * - * You should usually call [Builder.lithicBankName] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun lithicBankName(lithicBankName: JsonField) = apply { - this.lithicBankName = lithicBankName + fun messageId(messageId: JsonField) = apply { + this.messageId = messageId } - /** Lithic bank routing number */ - fun lithicBankRoutingNumber(lithicBankRoutingNumber: String?) = - lithicBankRoutingNumber(JsonField.ofNullable(lithicBankRoutingNumber)) - - /** - * Alias for calling [Builder.lithicBankRoutingNumber] with - * `lithicBankRoutingNumber.orElse(null)`. - */ - fun lithicBankRoutingNumber(lithicBankRoutingNumber: Optional) = - lithicBankRoutingNumber(lithicBankRoutingNumber.getOrNull()) - - /** - * Sets [Builder.lithicBankRoutingNumber] to an arbitrary JSON value. - * - * You should usually call [Builder.lithicBankRoutingNumber] with a well-typed - * [String] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun lithicBankRoutingNumber(lithicBankRoutingNumber: JsonField) = - apply { - this.lithicBankRoutingNumber = lithicBankRoutingNumber - } - - /** Lithic individual name */ - fun lithicIndividualName(lithicIndividualName: String?) = - lithicIndividualName(JsonField.ofNullable(lithicIndividualName)) + /** Payment details or invoice reference */ + fun remittanceInformation(remittanceInformation: String?) = + remittanceInformation(JsonField.ofNullable(remittanceInformation)) /** - * Alias for calling [Builder.lithicIndividualName] with - * `lithicIndividualName.orElse(null)`. + * Alias for calling [Builder.remittanceInformation] with + * `remittanceInformation.orElse(null)`. */ - fun lithicIndividualName(lithicIndividualName: Optional) = - lithicIndividualName(lithicIndividualName.getOrNull()) + fun remittanceInformation(remittanceInformation: Optional) = + remittanceInformation(remittanceInformation.getOrNull()) /** - * Sets [Builder.lithicIndividualName] to an arbitrary JSON value. + * Sets [Builder.remittanceInformation] to an arbitrary JSON value. * - * You should usually call [Builder.lithicIndividualName] with a well-typed + * You should usually call [Builder.remittanceInformation] with a well-typed * [String] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ - fun lithicIndividualName(lithicIndividualName: JsonField) = apply { - this.lithicIndividualName = lithicIndividualName + fun remittanceInformation(remittanceInformation: JsonField) = apply { + this.remittanceInformation = remittanceInformation } - /** OMAD */ - fun omad(omad: String?) = omad(JsonField.ofNullable(omad)) - - /** Alias for calling [Builder.omad] with `omad.orElse(null)`. */ - fun omad(omad: Optional) = omad(omad.getOrNull()) - - /** - * Sets [Builder.omad] to an arbitrary JSON value. - * - * You should usually call [Builder.omad] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun omad(omad: JsonField) = apply { this.omad = omad } - - /** UUID of previous transfer if this is a retry */ - fun previousTransfer(previousTransfer: String?) = - previousTransfer(JsonField.ofNullable(previousTransfer)) - - /** - * Alias for calling [Builder.previousTransfer] with - * `previousTransfer.orElse(null)`. - */ - fun previousTransfer(previousTransfer: Optional) = - previousTransfer(previousTransfer.getOrNull()) + /** Type of wire message */ + fun wireMessageType(wireMessageType: String) = + wireMessageType(JsonField.of(wireMessageType)) /** - * Sets [Builder.previousTransfer] to an arbitrary JSON value. + * Sets [Builder.wireMessageType] to an arbitrary JSON value. * - * You should usually call [Builder.previousTransfer] with a well-typed [String] + * You should usually call [Builder.wireMessageType] with a well-typed [String] * value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ - fun previousTransfer(previousTransfer: JsonField) = apply { - this.previousTransfer = previousTransfer - } - - /** Wire token */ - fun wireToken(wireToken: String?) = wireToken(JsonField.ofNullable(wireToken)) - - /** Alias for calling [Builder.wireToken] with `wireToken.orElse(null)`. */ - fun wireToken(wireToken: Optional) = wireToken(wireToken.getOrNull()) - - /** - * Sets [Builder.wireToken] to an arbitrary JSON value. - * - * You should usually call [Builder.wireToken] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun wireToken(wireToken: JsonField) = apply { - this.wireToken = wireToken + fun wireMessageType(wireMessageType: JsonField) = apply { + this.wireMessageType = wireMessageType } fun additionalProperties(additionalProperties: Map) = apply { @@ -11267,24 +11053,19 @@ private constructor( * * The following fields are required: * ```java - * .wireTransferType() + * .wireNetwork() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): WireMethodAttributes = WireMethodAttributes( - checkRequired("wireTransferType", wireTransferType), - externalBankName, - externalBankRoutingNumber, - externalIndividualName, - imad, - lithicBankName, - lithicBankRoutingNumber, - lithicIndividualName, - omad, - previousTransfer, - wireToken, + checkRequired("wireNetwork", wireNetwork), + creditor, + debtor, + messageId, + remittanceInformation, + wireMessageType, additionalProperties.toMutableMap(), ) } @@ -11296,17 +11077,12 @@ private constructor( return@apply } - wireTransferType().validate() - externalBankName() - externalBankRoutingNumber() - externalIndividualName() - imad() - lithicBankName() - lithicBankRoutingNumber() - lithicIndividualName() - omad() - previousTransfer() - wireToken() + wireNetwork().validate() + creditor().ifPresent { it.validate() } + debtor().ifPresent { it.validate() } + messageId() + remittanceInformation() + wireMessageType() validated = true } @@ -11326,20 +11102,15 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (wireTransferType.asKnown().getOrNull()?.validity() ?: 0) + - (if (externalBankName.asKnown().isPresent) 1 else 0) + - (if (externalBankRoutingNumber.asKnown().isPresent) 1 else 0) + - (if (externalIndividualName.asKnown().isPresent) 1 else 0) + - (if (imad.asKnown().isPresent) 1 else 0) + - (if (lithicBankName.asKnown().isPresent) 1 else 0) + - (if (lithicBankRoutingNumber.asKnown().isPresent) 1 else 0) + - (if (lithicIndividualName.asKnown().isPresent) 1 else 0) + - (if (omad.asKnown().isPresent) 1 else 0) + - (if (previousTransfer.asKnown().isPresent) 1 else 0) + - (if (wireToken.asKnown().isPresent) 1 else 0) + (wireNetwork.asKnown().getOrNull()?.validity() ?: 0) + + (creditor.asKnown().getOrNull()?.validity() ?: 0) + + (debtor.asKnown().getOrNull()?.validity() ?: 0) + + (if (messageId.asKnown().isPresent) 1 else 0) + + (if (remittanceInformation.asKnown().isPresent) 1 else 0) + + (if (wireMessageType.asKnown().isPresent) 1 else 0) /** Type of wire transfer */ - class WireTransferType + class WireNetwork @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -11360,20 +11131,20 @@ private constructor( @JvmField val SWIFT = of("SWIFT") - @JvmStatic fun of(value: String) = WireTransferType(JsonField.of(value)) + @JvmStatic fun of(value: String) = WireNetwork(JsonField.of(value)) } - /** An enum containing [WireTransferType]'s known values. */ + /** An enum containing [WireNetwork]'s known values. */ enum class Known { FEDWIRE, SWIFT, } /** - * An enum containing [WireTransferType]'s known values, as well as an - * [_UNKNOWN] member. + * An enum containing [WireNetwork]'s known values, as well as an [_UNKNOWN] + * member. * - * An instance of [WireTransferType] can contain an unknown value in a couple of + * An instance of [WireNetwork] can contain an unknown value in a couple of * cases: * - It was deserialized from data that doesn't match any known member. For * example, if the SDK is on an older version than the API, then the API may @@ -11384,8 +11155,8 @@ private constructor( FEDWIRE, SWIFT, /** - * An enum member indicating that [WireTransferType] was instantiated with - * an unknown value. + * An enum member indicating that [WireNetwork] was instantiated with an + * unknown value. */ _UNKNOWN, } @@ -11417,8 +11188,7 @@ private constructor( when (this) { FEDWIRE -> Known.FEDWIRE SWIFT -> Known.SWIFT - else -> - throw LithicInvalidDataException("Unknown WireTransferType: $value") + else -> throw LithicInvalidDataException("Unknown WireNetwork: $value") } /** @@ -11437,7 +11207,7 @@ private constructor( private var validated: Boolean = false - fun validate(): WireTransferType = apply { + fun validate(): WireNetwork = apply { if (validated) { return@apply } @@ -11468,7 +11238,7 @@ private constructor( return true } - return other is WireTransferType && value == other.value + return other is WireNetwork && value == other.value } override fun hashCode() = value.hashCode() @@ -11482,33 +11252,23 @@ private constructor( } return other is WireMethodAttributes && - wireTransferType == other.wireTransferType && - externalBankName == other.externalBankName && - externalBankRoutingNumber == other.externalBankRoutingNumber && - externalIndividualName == other.externalIndividualName && - imad == other.imad && - lithicBankName == other.lithicBankName && - lithicBankRoutingNumber == other.lithicBankRoutingNumber && - lithicIndividualName == other.lithicIndividualName && - omad == other.omad && - previousTransfer == other.previousTransfer && - wireToken == other.wireToken && + wireNetwork == other.wireNetwork && + creditor == other.creditor && + debtor == other.debtor && + messageId == other.messageId && + remittanceInformation == other.remittanceInformation && + wireMessageType == other.wireMessageType && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { Objects.hash( - wireTransferType, - externalBankName, - externalBankRoutingNumber, - externalIndividualName, - imad, - lithicBankName, - lithicBankRoutingNumber, - lithicIndividualName, - omad, - previousTransfer, - wireToken, + wireNetwork, + creditor, + debtor, + messageId, + remittanceInformation, + wireMessageType, additionalProperties, ) } @@ -11516,7 +11276,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WireMethodAttributes{wireTransferType=$wireTransferType, externalBankName=$externalBankName, externalBankRoutingNumber=$externalBankRoutingNumber, externalIndividualName=$externalIndividualName, imad=$imad, lithicBankName=$lithicBankName, lithicBankRoutingNumber=$lithicBankRoutingNumber, lithicIndividualName=$lithicIndividualName, omad=$omad, previousTransfer=$previousTransfer, wireToken=$wireToken, additionalProperties=$additionalProperties}" + "WireMethodAttributes{wireNetwork=$wireNetwork, creditor=$creditor, debtor=$debtor, messageId=$messageId, remittanceInformation=$remittanceInformation, wireMessageType=$wireMessageType, additionalProperties=$additionalProperties}" } } @@ -12173,6 +11933,173 @@ private constructor( override fun toString() = value.toString() } + class TransferType @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ORIGINATION_CREDIT = of("ORIGINATION_CREDIT") + + @JvmField val ORIGINATION_DEBIT = of("ORIGINATION_DEBIT") + + @JvmField val RECEIPT_CREDIT = of("RECEIPT_CREDIT") + + @JvmField val RECEIPT_DEBIT = of("RECEIPT_DEBIT") + + @JvmField val WIRE_INBOUND_PAYMENT = of("WIRE_INBOUND_PAYMENT") + + @JvmField val WIRE_INBOUND_ADMIN = of("WIRE_INBOUND_ADMIN") + + @JvmField val WIRE_OUTBOUND_PAYMENT = of("WIRE_OUTBOUND_PAYMENT") + + @JvmField val WIRE_OUTBOUND_ADMIN = of("WIRE_OUTBOUND_ADMIN") + + @JvmStatic fun of(value: String) = TransferType(JsonField.of(value)) + } + + /** An enum containing [TransferType]'s known values. */ + enum class Known { + ORIGINATION_CREDIT, + ORIGINATION_DEBIT, + RECEIPT_CREDIT, + RECEIPT_DEBIT, + WIRE_INBOUND_PAYMENT, + WIRE_INBOUND_ADMIN, + WIRE_OUTBOUND_PAYMENT, + WIRE_OUTBOUND_ADMIN, + } + + /** + * An enum containing [TransferType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TransferType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ORIGINATION_CREDIT, + ORIGINATION_DEBIT, + RECEIPT_CREDIT, + RECEIPT_DEBIT, + WIRE_INBOUND_PAYMENT, + WIRE_INBOUND_ADMIN, + WIRE_OUTBOUND_PAYMENT, + WIRE_OUTBOUND_ADMIN, + /** + * An enum member indicating that [TransferType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ORIGINATION_CREDIT -> Value.ORIGINATION_CREDIT + ORIGINATION_DEBIT -> Value.ORIGINATION_DEBIT + RECEIPT_CREDIT -> Value.RECEIPT_CREDIT + RECEIPT_DEBIT -> Value.RECEIPT_DEBIT + WIRE_INBOUND_PAYMENT -> Value.WIRE_INBOUND_PAYMENT + WIRE_INBOUND_ADMIN -> Value.WIRE_INBOUND_ADMIN + WIRE_OUTBOUND_PAYMENT -> Value.WIRE_OUTBOUND_PAYMENT + WIRE_OUTBOUND_ADMIN -> Value.WIRE_OUTBOUND_ADMIN + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws LithicInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ORIGINATION_CREDIT -> Known.ORIGINATION_CREDIT + ORIGINATION_DEBIT -> Known.ORIGINATION_DEBIT + RECEIPT_CREDIT -> Known.RECEIPT_CREDIT + RECEIPT_DEBIT -> Known.RECEIPT_DEBIT + WIRE_INBOUND_PAYMENT -> Known.WIRE_INBOUND_PAYMENT + WIRE_INBOUND_ADMIN -> Known.WIRE_INBOUND_ADMIN + WIRE_OUTBOUND_PAYMENT -> Known.WIRE_OUTBOUND_PAYMENT + WIRE_OUTBOUND_ADMIN -> Known.WIRE_OUTBOUND_ADMIN + else -> throw LithicInvalidDataException("Unknown TransferType: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LithicInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): TransferType = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransferType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -12199,6 +12126,7 @@ private constructor( currency == other.currency && expectedReleaseDate == other.expectedReleaseDate && externalBankAccountToken == other.externalBankAccountToken && + type == other.type && userDefinedId == other.userDefinedId && additionalProperties == other.additionalProperties } @@ -12225,6 +12153,7 @@ private constructor( currency, expectedReleaseDate, externalBankAccountToken, + type, userDefinedId, additionalProperties, ) @@ -12233,6 +12162,6 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PaymentTransaction{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" + "PaymentTransaction{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, type=$type, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" } } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt index 042108621..1e8946198 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt @@ -4512,6 +4512,8 @@ private constructor( @JvmField val TRANSFER = of("TRANSFER") + @JvmField val COLLECTION = of("COLLECTION") + @JvmStatic fun of(value: String) = BookTransferType(JsonField.of(value)) } @@ -4550,6 +4552,7 @@ private constructor( DISPUTE_WON, SERVICE, TRANSFER, + COLLECTION, } /** @@ -4597,6 +4600,7 @@ private constructor( DISPUTE_WON, SERVICE, TRANSFER, + COLLECTION, /** * An enum member indicating that [BookTransferType] was instantiated with an * unknown value. @@ -4646,6 +4650,7 @@ private constructor( DISPUTE_WON -> Value.DISPUTE_WON SERVICE -> Value.SERVICE TRANSFER -> Value.TRANSFER + COLLECTION -> Value.COLLECTION else -> Value._UNKNOWN } @@ -4693,6 +4698,7 @@ private constructor( DISPUTE_WON -> Known.DISPUTE_WON SERVICE -> Known.SERVICE TRANSFER -> Known.TRANSFER + COLLECTION -> Known.COLLECTION else -> throw LithicInvalidDataException("Unknown BookTransferType: $value") } @@ -7350,6 +7356,7 @@ private constructor( private val currency: JsonField, private val expectedReleaseDate: JsonField, private val externalBankAccountToken: JsonField, + private val type: JsonField, private val userDefinedId: JsonField, private val additionalProperties: MutableMap, ) { @@ -7410,6 +7417,7 @@ private constructor( @JsonProperty("external_bank_account_token") @ExcludeMissing externalBankAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing userDefinedId: JsonField = JsonMissing.of(), @@ -7434,6 +7442,7 @@ private constructor( currency, expectedReleaseDate, externalBankAccountToken, + type, userDefinedId, mutableMapOf(), ) @@ -7600,6 +7609,12 @@ private constructor( fun externalBankAccountToken(): Optional = externalBankAccountToken.getOptional("external_bank_account_token") + /** + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun type(): Optional = type.getOptional("type") + /** * User-defined identifier * @@ -7779,6 +7794,13 @@ private constructor( @ExcludeMissing fun _externalBankAccountToken(): JsonField = externalBankAccountToken + /** + * Returns the raw JSON value of [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + /** * Returns the raw JSON value of [userDefinedId]. * @@ -7853,6 +7875,7 @@ private constructor( private var currency: JsonField = JsonMissing.of() private var expectedReleaseDate: JsonField = JsonMissing.of() private var externalBankAccountToken: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -7878,6 +7901,7 @@ private constructor( currency = paymentTransaction.currency expectedReleaseDate = paymentTransaction.expectedReleaseDate externalBankAccountToken = paymentTransaction.externalBankAccountToken + type = paymentTransaction.type userDefinedId = paymentTransaction.userDefinedId additionalProperties = paymentTransaction.additionalProperties.toMutableMap() } @@ -8179,6 +8203,17 @@ private constructor( this.externalBankAccountToken = externalBankAccountToken } + fun type(type: TransferType) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [TransferType] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun type(type: JsonField) = apply { this.type = type } + /** User-defined identifier */ fun userDefinedId(userDefinedId: String?) = userDefinedId(JsonField.ofNullable(userDefinedId)) @@ -8267,6 +8302,7 @@ private constructor( currency, expectedReleaseDate, externalBankAccountToken, + type, userDefinedId, additionalProperties.toMutableMap(), ) @@ -8299,6 +8335,7 @@ private constructor( currency() expectedReleaseDate() externalBankAccountToken() + type().ifPresent { it.validate() } userDefinedId() validated = true } @@ -8339,6 +8376,7 @@ private constructor( (if (currency.asKnown().isPresent) 1 else 0) + (if (expectedReleaseDate.asKnown().isPresent) 1 else 0) + (if (externalBankAccountToken.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + (if (userDefinedId.asKnown().isPresent) 1 else 0) /** Transaction category */ @@ -10724,67 +10762,42 @@ private constructor( class WireMethodAttributes private constructor( - private val wireTransferType: JsonField, - private val externalBankName: JsonField, - private val externalBankRoutingNumber: JsonField, - private val externalIndividualName: JsonField, - private val imad: JsonField, - private val lithicBankName: JsonField, - private val lithicBankRoutingNumber: JsonField, - private val lithicIndividualName: JsonField, - private val omad: JsonField, - private val previousTransfer: JsonField, - private val wireToken: JsonField, + private val wireNetwork: JsonField, + private val creditor: JsonField, + private val debtor: JsonField, + private val messageId: JsonField, + private val remittanceInformation: JsonField, + private val wireMessageType: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("wire_transfer_type") - @ExcludeMissing - wireTransferType: JsonField = JsonMissing.of(), - @JsonProperty("external_bank_name") - @ExcludeMissing - externalBankName: JsonField = JsonMissing.of(), - @JsonProperty("external_bank_routing_number") - @ExcludeMissing - externalBankRoutingNumber: JsonField = JsonMissing.of(), - @JsonProperty("external_individual_name") - @ExcludeMissing - externalIndividualName: JsonField = JsonMissing.of(), - @JsonProperty("imad") + @JsonProperty("wire_network") @ExcludeMissing - imad: JsonField = JsonMissing.of(), - @JsonProperty("lithic_bank_name") + wireNetwork: JsonField = JsonMissing.of(), + @JsonProperty("creditor") @ExcludeMissing - lithicBankName: JsonField = JsonMissing.of(), - @JsonProperty("lithic_bank_routing_number") + creditor: JsonField = JsonMissing.of(), + @JsonProperty("debtor") @ExcludeMissing - lithicBankRoutingNumber: JsonField = JsonMissing.of(), - @JsonProperty("lithic_individual_name") + debtor: JsonField = JsonMissing.of(), + @JsonProperty("message_id") @ExcludeMissing - lithicIndividualName: JsonField = JsonMissing.of(), - @JsonProperty("omad") + messageId: JsonField = JsonMissing.of(), + @JsonProperty("remittance_information") @ExcludeMissing - omad: JsonField = JsonMissing.of(), - @JsonProperty("previous_transfer") + remittanceInformation: JsonField = JsonMissing.of(), + @JsonProperty("wire_message_type") @ExcludeMissing - previousTransfer: JsonField = JsonMissing.of(), - @JsonProperty("wire_token") - @ExcludeMissing - wireToken: JsonField = JsonMissing.of(), + wireMessageType: JsonField = JsonMissing.of(), ) : this( - wireTransferType, - externalBankName, - externalBankRoutingNumber, - externalIndividualName, - imad, - lithicBankName, - lithicBankRoutingNumber, - lithicIndividualName, - omad, - previousTransfer, - wireToken, + wireNetwork, + creditor, + debtor, + messageId, + remittanceInformation, + wireMessageType, mutableMapOf(), ) @@ -10795,201 +10808,106 @@ private constructor( * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun wireTransferType(): WireTransferType = - wireTransferType.getRequired("wire_transfer_type") + fun wireNetwork(): WireNetwork = wireNetwork.getRequired("wire_network") /** - * External bank name - * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun externalBankName(): Optional = - externalBankName.getOptional("external_bank_name") + fun creditor(): Optional = creditor.getOptional("creditor") /** - * External bank routing number - * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun externalBankRoutingNumber(): Optional = - externalBankRoutingNumber.getOptional("external_bank_routing_number") + fun debtor(): Optional = debtor.getOptional("debtor") /** - * External individual name + * Point to point reference identifier, as assigned by the instructing party, used + * for tracking the message through the Fedwire system * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun externalIndividualName(): Optional = - externalIndividualName.getOptional("external_individual_name") + fun messageId(): Optional = messageId.getOptional("message_id") /** - * IMAD + * Payment details or invoice reference * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun imad(): Optional = imad.getOptional("imad") + fun remittanceInformation(): Optional = + remittanceInformation.getOptional("remittance_information") /** - * Lithic bank name + * Type of wire message * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun lithicBankName(): Optional = - lithicBankName.getOptional("lithic_bank_name") + fun wireMessageType(): Optional = + wireMessageType.getOptional("wire_message_type") /** - * Lithic bank routing number + * Returns the raw JSON value of [wireNetwork]. * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun lithicBankRoutingNumber(): Optional = - lithicBankRoutingNumber.getOptional("lithic_bank_routing_number") - - /** - * Lithic individual name - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun lithicIndividualName(): Optional = - lithicIndividualName.getOptional("lithic_individual_name") - - /** - * OMAD - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun omad(): Optional = omad.getOptional("omad") - - /** - * UUID of previous transfer if this is a retry - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun previousTransfer(): Optional = - previousTransfer.getOptional("previous_transfer") - - /** - * Wire token - * - * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun wireToken(): Optional = wireToken.getOptional("wire_token") - - /** - * Returns the raw JSON value of [wireTransferType]. - * - * Unlike [wireTransferType], this method doesn't throw if the JSON field has an + * Unlike [wireNetwork], this method doesn't throw if the JSON field has an * unexpected type. */ - @JsonProperty("wire_transfer_type") + @JsonProperty("wire_network") @ExcludeMissing - fun _wireTransferType(): JsonField = wireTransferType + fun _wireNetwork(): JsonField = wireNetwork /** - * Returns the raw JSON value of [externalBankName]. + * Returns the raw JSON value of [creditor]. * - * Unlike [externalBankName], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("external_bank_name") - @ExcludeMissing - fun _externalBankName(): JsonField = externalBankName - - /** - * Returns the raw JSON value of [externalBankRoutingNumber]. - * - * Unlike [externalBankRoutingNumber], this method doesn't throw if the JSON field - * has an unexpected type. + * Unlike [creditor], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("external_bank_routing_number") + @JsonProperty("creditor") @ExcludeMissing - fun _externalBankRoutingNumber(): JsonField = externalBankRoutingNumber + fun _creditor(): JsonField = creditor /** - * Returns the raw JSON value of [externalIndividualName]. + * Returns the raw JSON value of [debtor]. * - * Unlike [externalIndividualName], this method doesn't throw if the JSON field has - * an unexpected type. + * Unlike [debtor], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("external_individual_name") + @JsonProperty("debtor") @ExcludeMissing - fun _externalIndividualName(): JsonField = externalIndividualName + fun _debtor(): JsonField = debtor /** - * Returns the raw JSON value of [imad]. + * Returns the raw JSON value of [messageId]. * - * Unlike [imad], this method doesn't throw if the JSON field has an unexpected + * Unlike [messageId], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("imad") @ExcludeMissing fun _imad(): JsonField = imad - - /** - * Returns the raw JSON value of [lithicBankName]. - * - * Unlike [lithicBankName], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("lithic_bank_name") + @JsonProperty("message_id") @ExcludeMissing - fun _lithicBankName(): JsonField = lithicBankName + fun _messageId(): JsonField = messageId /** - * Returns the raw JSON value of [lithicBankRoutingNumber]. + * Returns the raw JSON value of [remittanceInformation]. * - * Unlike [lithicBankRoutingNumber], this method doesn't throw if the JSON field has + * Unlike [remittanceInformation], this method doesn't throw if the JSON field has * an unexpected type. */ - @JsonProperty("lithic_bank_routing_number") - @ExcludeMissing - fun _lithicBankRoutingNumber(): JsonField = lithicBankRoutingNumber - - /** - * Returns the raw JSON value of [lithicIndividualName]. - * - * Unlike [lithicIndividualName], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("lithic_individual_name") + @JsonProperty("remittance_information") @ExcludeMissing - fun _lithicIndividualName(): JsonField = lithicIndividualName + fun _remittanceInformation(): JsonField = remittanceInformation /** - * Returns the raw JSON value of [omad]. + * Returns the raw JSON value of [wireMessageType]. * - * Unlike [omad], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("omad") @ExcludeMissing fun _omad(): JsonField = omad - - /** - * Returns the raw JSON value of [previousTransfer]. - * - * Unlike [previousTransfer], this method doesn't throw if the JSON field has an + * Unlike [wireMessageType], this method doesn't throw if the JSON field has an * unexpected type. */ - @JsonProperty("previous_transfer") + @JsonProperty("wire_message_type") @ExcludeMissing - fun _previousTransfer(): JsonField = previousTransfer - - /** - * Returns the raw JSON value of [wireToken]. - * - * Unlike [wireToken], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("wire_token") - @ExcludeMissing - fun _wireToken(): JsonField = wireToken + fun _wireMessageType(): JsonField = wireMessageType @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -11011,7 +10929,7 @@ private constructor( * * The following fields are required: * ```java - * .wireTransferType() + * .wireNetwork() * ``` */ @JvmStatic fun builder() = Builder() @@ -11020,252 +10938,120 @@ private constructor( /** A builder for [WireMethodAttributes]. */ class Builder internal constructor() { - private var wireTransferType: JsonField? = null - private var externalBankName: JsonField = JsonMissing.of() - private var externalBankRoutingNumber: JsonField = JsonMissing.of() - private var externalIndividualName: JsonField = JsonMissing.of() - private var imad: JsonField = JsonMissing.of() - private var lithicBankName: JsonField = JsonMissing.of() - private var lithicBankRoutingNumber: JsonField = JsonMissing.of() - private var lithicIndividualName: JsonField = JsonMissing.of() - private var omad: JsonField = JsonMissing.of() - private var previousTransfer: JsonField = JsonMissing.of() - private var wireToken: JsonField = JsonMissing.of() + private var wireNetwork: JsonField? = null + private var creditor: JsonField = JsonMissing.of() + private var debtor: JsonField = JsonMissing.of() + private var messageId: JsonField = JsonMissing.of() + private var remittanceInformation: JsonField = JsonMissing.of() + private var wireMessageType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(wireMethodAttributes: WireMethodAttributes) = apply { - wireTransferType = wireMethodAttributes.wireTransferType - externalBankName = wireMethodAttributes.externalBankName - externalBankRoutingNumber = wireMethodAttributes.externalBankRoutingNumber - externalIndividualName = wireMethodAttributes.externalIndividualName - imad = wireMethodAttributes.imad - lithicBankName = wireMethodAttributes.lithicBankName - lithicBankRoutingNumber = wireMethodAttributes.lithicBankRoutingNumber - lithicIndividualName = wireMethodAttributes.lithicIndividualName - omad = wireMethodAttributes.omad - previousTransfer = wireMethodAttributes.previousTransfer - wireToken = wireMethodAttributes.wireToken + wireNetwork = wireMethodAttributes.wireNetwork + creditor = wireMethodAttributes.creditor + debtor = wireMethodAttributes.debtor + messageId = wireMethodAttributes.messageId + remittanceInformation = wireMethodAttributes.remittanceInformation + wireMessageType = wireMethodAttributes.wireMessageType additionalProperties = wireMethodAttributes.additionalProperties.toMutableMap() } /** Type of wire transfer */ - fun wireTransferType(wireTransferType: WireTransferType) = - wireTransferType(JsonField.of(wireTransferType)) + fun wireNetwork(wireNetwork: WireNetwork) = + wireNetwork(JsonField.of(wireNetwork)) /** - * Sets [Builder.wireTransferType] to an arbitrary JSON value. + * Sets [Builder.wireNetwork] to an arbitrary JSON value. * - * You should usually call [Builder.wireTransferType] with a well-typed - * [WireTransferType] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. + * You should usually call [Builder.wireNetwork] with a well-typed [WireNetwork] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. */ - fun wireTransferType(wireTransferType: JsonField) = apply { - this.wireTransferType = wireTransferType + fun wireNetwork(wireNetwork: JsonField) = apply { + this.wireNetwork = wireNetwork } - /** External bank name */ - fun externalBankName(externalBankName: String?) = - externalBankName(JsonField.ofNullable(externalBankName)) + fun creditor(creditor: WirePartyDetails) = creditor(JsonField.of(creditor)) /** - * Alias for calling [Builder.externalBankName] with - * `externalBankName.orElse(null)`. - */ - fun externalBankName(externalBankName: Optional) = - externalBankName(externalBankName.getOrNull()) - - /** - * Sets [Builder.externalBankName] to an arbitrary JSON value. + * Sets [Builder.creditor] to an arbitrary JSON value. * - * You should usually call [Builder.externalBankName] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. + * You should usually call [Builder.creditor] with a well-typed + * [WirePartyDetails] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. */ - fun externalBankName(externalBankName: JsonField) = apply { - this.externalBankName = externalBankName + fun creditor(creditor: JsonField) = apply { + this.creditor = creditor } - /** External bank routing number */ - fun externalBankRoutingNumber(externalBankRoutingNumber: String?) = - externalBankRoutingNumber(JsonField.ofNullable(externalBankRoutingNumber)) + fun debtor(debtor: WirePartyDetails) = debtor(JsonField.of(debtor)) /** - * Alias for calling [Builder.externalBankRoutingNumber] with - * `externalBankRoutingNumber.orElse(null)`. - */ - fun externalBankRoutingNumber(externalBankRoutingNumber: Optional) = - externalBankRoutingNumber(externalBankRoutingNumber.getOrNull()) - - /** - * Sets [Builder.externalBankRoutingNumber] to an arbitrary JSON value. + * Sets [Builder.debtor] to an arbitrary JSON value. * - * You should usually call [Builder.externalBankRoutingNumber] with a well-typed - * [String] value instead. This method is primarily for setting the field to an + * You should usually call [Builder.debtor] with a well-typed [WirePartyDetails] + * value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ - fun externalBankRoutingNumber(externalBankRoutingNumber: JsonField) = - apply { - this.externalBankRoutingNumber = externalBankRoutingNumber - } - - /** External individual name */ - fun externalIndividualName(externalIndividualName: String?) = - externalIndividualName(JsonField.ofNullable(externalIndividualName)) + fun debtor(debtor: JsonField) = apply { this.debtor = debtor } /** - * Alias for calling [Builder.externalIndividualName] with - * `externalIndividualName.orElse(null)`. + * Point to point reference identifier, as assigned by the instructing party, + * used for tracking the message through the Fedwire system */ - fun externalIndividualName(externalIndividualName: Optional) = - externalIndividualName(externalIndividualName.getOrNull()) + fun messageId(messageId: String?) = messageId(JsonField.ofNullable(messageId)) - /** - * Sets [Builder.externalIndividualName] to an arbitrary JSON value. - * - * You should usually call [Builder.externalIndividualName] with a well-typed - * [String] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun externalIndividualName(externalIndividualName: JsonField) = apply { - this.externalIndividualName = externalIndividualName - } - - /** IMAD */ - fun imad(imad: String?) = imad(JsonField.ofNullable(imad)) - - /** Alias for calling [Builder.imad] with `imad.orElse(null)`. */ - fun imad(imad: Optional) = imad(imad.getOrNull()) + /** Alias for calling [Builder.messageId] with `messageId.orElse(null)`. */ + fun messageId(messageId: Optional) = messageId(messageId.getOrNull()) /** - * Sets [Builder.imad] to an arbitrary JSON value. + * Sets [Builder.messageId] to an arbitrary JSON value. * - * You should usually call [Builder.imad] with a well-typed [String] value + * You should usually call [Builder.messageId] with a well-typed [String] value * instead. This method is primarily for setting the field to an undocumented or * not yet supported value. */ - fun imad(imad: JsonField) = apply { this.imad = imad } - - /** Lithic bank name */ - fun lithicBankName(lithicBankName: String?) = - lithicBankName(JsonField.ofNullable(lithicBankName)) - - /** - * Alias for calling [Builder.lithicBankName] with - * `lithicBankName.orElse(null)`. - */ - fun lithicBankName(lithicBankName: Optional) = - lithicBankName(lithicBankName.getOrNull()) - - /** - * Sets [Builder.lithicBankName] to an arbitrary JSON value. - * - * You should usually call [Builder.lithicBankName] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun lithicBankName(lithicBankName: JsonField) = apply { - this.lithicBankName = lithicBankName + fun messageId(messageId: JsonField) = apply { + this.messageId = messageId } - /** Lithic bank routing number */ - fun lithicBankRoutingNumber(lithicBankRoutingNumber: String?) = - lithicBankRoutingNumber(JsonField.ofNullable(lithicBankRoutingNumber)) - - /** - * Alias for calling [Builder.lithicBankRoutingNumber] with - * `lithicBankRoutingNumber.orElse(null)`. - */ - fun lithicBankRoutingNumber(lithicBankRoutingNumber: Optional) = - lithicBankRoutingNumber(lithicBankRoutingNumber.getOrNull()) - - /** - * Sets [Builder.lithicBankRoutingNumber] to an arbitrary JSON value. - * - * You should usually call [Builder.lithicBankRoutingNumber] with a well-typed - * [String] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun lithicBankRoutingNumber(lithicBankRoutingNumber: JsonField) = - apply { - this.lithicBankRoutingNumber = lithicBankRoutingNumber - } - - /** Lithic individual name */ - fun lithicIndividualName(lithicIndividualName: String?) = - lithicIndividualName(JsonField.ofNullable(lithicIndividualName)) + /** Payment details or invoice reference */ + fun remittanceInformation(remittanceInformation: String?) = + remittanceInformation(JsonField.ofNullable(remittanceInformation)) /** - * Alias for calling [Builder.lithicIndividualName] with - * `lithicIndividualName.orElse(null)`. + * Alias for calling [Builder.remittanceInformation] with + * `remittanceInformation.orElse(null)`. */ - fun lithicIndividualName(lithicIndividualName: Optional) = - lithicIndividualName(lithicIndividualName.getOrNull()) + fun remittanceInformation(remittanceInformation: Optional) = + remittanceInformation(remittanceInformation.getOrNull()) /** - * Sets [Builder.lithicIndividualName] to an arbitrary JSON value. + * Sets [Builder.remittanceInformation] to an arbitrary JSON value. * - * You should usually call [Builder.lithicIndividualName] with a well-typed + * You should usually call [Builder.remittanceInformation] with a well-typed * [String] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ - fun lithicIndividualName(lithicIndividualName: JsonField) = apply { - this.lithicIndividualName = lithicIndividualName + fun remittanceInformation(remittanceInformation: JsonField) = apply { + this.remittanceInformation = remittanceInformation } - /** OMAD */ - fun omad(omad: String?) = omad(JsonField.ofNullable(omad)) - - /** Alias for calling [Builder.omad] with `omad.orElse(null)`. */ - fun omad(omad: Optional) = omad(omad.getOrNull()) - - /** - * Sets [Builder.omad] to an arbitrary JSON value. - * - * You should usually call [Builder.omad] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun omad(omad: JsonField) = apply { this.omad = omad } - - /** UUID of previous transfer if this is a retry */ - fun previousTransfer(previousTransfer: String?) = - previousTransfer(JsonField.ofNullable(previousTransfer)) - - /** - * Alias for calling [Builder.previousTransfer] with - * `previousTransfer.orElse(null)`. - */ - fun previousTransfer(previousTransfer: Optional) = - previousTransfer(previousTransfer.getOrNull()) + /** Type of wire message */ + fun wireMessageType(wireMessageType: String) = + wireMessageType(JsonField.of(wireMessageType)) /** - * Sets [Builder.previousTransfer] to an arbitrary JSON value. + * Sets [Builder.wireMessageType] to an arbitrary JSON value. * - * You should usually call [Builder.previousTransfer] with a well-typed [String] + * You should usually call [Builder.wireMessageType] with a well-typed [String] * value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ - fun previousTransfer(previousTransfer: JsonField) = apply { - this.previousTransfer = previousTransfer - } - - /** Wire token */ - fun wireToken(wireToken: String?) = wireToken(JsonField.ofNullable(wireToken)) - - /** Alias for calling [Builder.wireToken] with `wireToken.orElse(null)`. */ - fun wireToken(wireToken: Optional) = wireToken(wireToken.getOrNull()) - - /** - * Sets [Builder.wireToken] to an arbitrary JSON value. - * - * You should usually call [Builder.wireToken] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun wireToken(wireToken: JsonField) = apply { - this.wireToken = wireToken + fun wireMessageType(wireMessageType: JsonField) = apply { + this.wireMessageType = wireMessageType } fun additionalProperties(additionalProperties: Map) = apply { @@ -11297,24 +11083,19 @@ private constructor( * * The following fields are required: * ```java - * .wireTransferType() + * .wireNetwork() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): WireMethodAttributes = WireMethodAttributes( - checkRequired("wireTransferType", wireTransferType), - externalBankName, - externalBankRoutingNumber, - externalIndividualName, - imad, - lithicBankName, - lithicBankRoutingNumber, - lithicIndividualName, - omad, - previousTransfer, - wireToken, + checkRequired("wireNetwork", wireNetwork), + creditor, + debtor, + messageId, + remittanceInformation, + wireMessageType, additionalProperties.toMutableMap(), ) } @@ -11326,17 +11107,12 @@ private constructor( return@apply } - wireTransferType().validate() - externalBankName() - externalBankRoutingNumber() - externalIndividualName() - imad() - lithicBankName() - lithicBankRoutingNumber() - lithicIndividualName() - omad() - previousTransfer() - wireToken() + wireNetwork().validate() + creditor().ifPresent { it.validate() } + debtor().ifPresent { it.validate() } + messageId() + remittanceInformation() + wireMessageType() validated = true } @@ -11356,20 +11132,15 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (wireTransferType.asKnown().getOrNull()?.validity() ?: 0) + - (if (externalBankName.asKnown().isPresent) 1 else 0) + - (if (externalBankRoutingNumber.asKnown().isPresent) 1 else 0) + - (if (externalIndividualName.asKnown().isPresent) 1 else 0) + - (if (imad.asKnown().isPresent) 1 else 0) + - (if (lithicBankName.asKnown().isPresent) 1 else 0) + - (if (lithicBankRoutingNumber.asKnown().isPresent) 1 else 0) + - (if (lithicIndividualName.asKnown().isPresent) 1 else 0) + - (if (omad.asKnown().isPresent) 1 else 0) + - (if (previousTransfer.asKnown().isPresent) 1 else 0) + - (if (wireToken.asKnown().isPresent) 1 else 0) + (wireNetwork.asKnown().getOrNull()?.validity() ?: 0) + + (creditor.asKnown().getOrNull()?.validity() ?: 0) + + (debtor.asKnown().getOrNull()?.validity() ?: 0) + + (if (messageId.asKnown().isPresent) 1 else 0) + + (if (remittanceInformation.asKnown().isPresent) 1 else 0) + + (if (wireMessageType.asKnown().isPresent) 1 else 0) /** Type of wire transfer */ - class WireTransferType + class WireNetwork @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -11390,20 +11161,20 @@ private constructor( @JvmField val SWIFT = of("SWIFT") - @JvmStatic fun of(value: String) = WireTransferType(JsonField.of(value)) + @JvmStatic fun of(value: String) = WireNetwork(JsonField.of(value)) } - /** An enum containing [WireTransferType]'s known values. */ + /** An enum containing [WireNetwork]'s known values. */ enum class Known { FEDWIRE, SWIFT, } /** - * An enum containing [WireTransferType]'s known values, as well as an - * [_UNKNOWN] member. + * An enum containing [WireNetwork]'s known values, as well as an [_UNKNOWN] + * member. * - * An instance of [WireTransferType] can contain an unknown value in a couple of + * An instance of [WireNetwork] can contain an unknown value in a couple of * cases: * - It was deserialized from data that doesn't match any known member. For * example, if the SDK is on an older version than the API, then the API may @@ -11414,8 +11185,8 @@ private constructor( FEDWIRE, SWIFT, /** - * An enum member indicating that [WireTransferType] was instantiated with - * an unknown value. + * An enum member indicating that [WireNetwork] was instantiated with an + * unknown value. */ _UNKNOWN, } @@ -11447,8 +11218,7 @@ private constructor( when (this) { FEDWIRE -> Known.FEDWIRE SWIFT -> Known.SWIFT - else -> - throw LithicInvalidDataException("Unknown WireTransferType: $value") + else -> throw LithicInvalidDataException("Unknown WireNetwork: $value") } /** @@ -11467,7 +11237,7 @@ private constructor( private var validated: Boolean = false - fun validate(): WireTransferType = apply { + fun validate(): WireNetwork = apply { if (validated) { return@apply } @@ -11498,7 +11268,7 @@ private constructor( return true } - return other is WireTransferType && value == other.value + return other is WireNetwork && value == other.value } override fun hashCode() = value.hashCode() @@ -11512,33 +11282,23 @@ private constructor( } return other is WireMethodAttributes && - wireTransferType == other.wireTransferType && - externalBankName == other.externalBankName && - externalBankRoutingNumber == other.externalBankRoutingNumber && - externalIndividualName == other.externalIndividualName && - imad == other.imad && - lithicBankName == other.lithicBankName && - lithicBankRoutingNumber == other.lithicBankRoutingNumber && - lithicIndividualName == other.lithicIndividualName && - omad == other.omad && - previousTransfer == other.previousTransfer && - wireToken == other.wireToken && + wireNetwork == other.wireNetwork && + creditor == other.creditor && + debtor == other.debtor && + messageId == other.messageId && + remittanceInformation == other.remittanceInformation && + wireMessageType == other.wireMessageType && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { Objects.hash( - wireTransferType, - externalBankName, - externalBankRoutingNumber, - externalIndividualName, - imad, - lithicBankName, - lithicBankRoutingNumber, - lithicIndividualName, - omad, - previousTransfer, - wireToken, + wireNetwork, + creditor, + debtor, + messageId, + remittanceInformation, + wireMessageType, additionalProperties, ) } @@ -11546,7 +11306,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WireMethodAttributes{wireTransferType=$wireTransferType, externalBankName=$externalBankName, externalBankRoutingNumber=$externalBankRoutingNumber, externalIndividualName=$externalIndividualName, imad=$imad, lithicBankName=$lithicBankName, lithicBankRoutingNumber=$lithicBankRoutingNumber, lithicIndividualName=$lithicIndividualName, omad=$omad, previousTransfer=$previousTransfer, wireToken=$wireToken, additionalProperties=$additionalProperties}" + "WireMethodAttributes{wireNetwork=$wireNetwork, creditor=$creditor, debtor=$debtor, messageId=$messageId, remittanceInformation=$remittanceInformation, wireMessageType=$wireMessageType, additionalProperties=$additionalProperties}" } } @@ -12203,6 +11963,173 @@ private constructor( override fun toString() = value.toString() } + class TransferType @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ORIGINATION_CREDIT = of("ORIGINATION_CREDIT") + + @JvmField val ORIGINATION_DEBIT = of("ORIGINATION_DEBIT") + + @JvmField val RECEIPT_CREDIT = of("RECEIPT_CREDIT") + + @JvmField val RECEIPT_DEBIT = of("RECEIPT_DEBIT") + + @JvmField val WIRE_INBOUND_PAYMENT = of("WIRE_INBOUND_PAYMENT") + + @JvmField val WIRE_INBOUND_ADMIN = of("WIRE_INBOUND_ADMIN") + + @JvmField val WIRE_OUTBOUND_PAYMENT = of("WIRE_OUTBOUND_PAYMENT") + + @JvmField val WIRE_OUTBOUND_ADMIN = of("WIRE_OUTBOUND_ADMIN") + + @JvmStatic fun of(value: String) = TransferType(JsonField.of(value)) + } + + /** An enum containing [TransferType]'s known values. */ + enum class Known { + ORIGINATION_CREDIT, + ORIGINATION_DEBIT, + RECEIPT_CREDIT, + RECEIPT_DEBIT, + WIRE_INBOUND_PAYMENT, + WIRE_INBOUND_ADMIN, + WIRE_OUTBOUND_PAYMENT, + WIRE_OUTBOUND_ADMIN, + } + + /** + * An enum containing [TransferType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TransferType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ORIGINATION_CREDIT, + ORIGINATION_DEBIT, + RECEIPT_CREDIT, + RECEIPT_DEBIT, + WIRE_INBOUND_PAYMENT, + WIRE_INBOUND_ADMIN, + WIRE_OUTBOUND_PAYMENT, + WIRE_OUTBOUND_ADMIN, + /** + * An enum member indicating that [TransferType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ORIGINATION_CREDIT -> Value.ORIGINATION_CREDIT + ORIGINATION_DEBIT -> Value.ORIGINATION_DEBIT + RECEIPT_CREDIT -> Value.RECEIPT_CREDIT + RECEIPT_DEBIT -> Value.RECEIPT_DEBIT + WIRE_INBOUND_PAYMENT -> Value.WIRE_INBOUND_PAYMENT + WIRE_INBOUND_ADMIN -> Value.WIRE_INBOUND_ADMIN + WIRE_OUTBOUND_PAYMENT -> Value.WIRE_OUTBOUND_PAYMENT + WIRE_OUTBOUND_ADMIN -> Value.WIRE_OUTBOUND_ADMIN + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws LithicInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ORIGINATION_CREDIT -> Known.ORIGINATION_CREDIT + ORIGINATION_DEBIT -> Known.ORIGINATION_DEBIT + RECEIPT_CREDIT -> Known.RECEIPT_CREDIT + RECEIPT_DEBIT -> Known.RECEIPT_DEBIT + WIRE_INBOUND_PAYMENT -> Known.WIRE_INBOUND_PAYMENT + WIRE_INBOUND_ADMIN -> Known.WIRE_INBOUND_ADMIN + WIRE_OUTBOUND_PAYMENT -> Known.WIRE_OUTBOUND_PAYMENT + WIRE_OUTBOUND_ADMIN -> Known.WIRE_OUTBOUND_ADMIN + else -> throw LithicInvalidDataException("Unknown TransferType: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LithicInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): TransferType = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransferType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -12229,6 +12156,7 @@ private constructor( currency == other.currency && expectedReleaseDate == other.expectedReleaseDate && externalBankAccountToken == other.externalBankAccountToken && + type == other.type && userDefinedId == other.userDefinedId && additionalProperties == other.additionalProperties } @@ -12255,6 +12183,7 @@ private constructor( currency, expectedReleaseDate, externalBankAccountToken, + type, userDefinedId, additionalProperties, ) @@ -12263,6 +12192,6 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PaymentTransaction{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" + "PaymentTransaction{token=$token, category=$category, created=$created, descriptor=$descriptor, direction=$direction, events=$events, family=$family, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, relatedAccountTokens=$relatedAccountTokens, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, currency=$currency, expectedReleaseDate=$expectedReleaseDate, externalBankAccountToken=$externalBankAccountToken, type=$type, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" } } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt index 5105a243e..186a47af9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt @@ -2,6 +2,10 @@ package com.lithic.api.models +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.core.JsonGenerator import com.fasterxml.jackson.core.ObjectCodec import com.fasterxml.jackson.databind.JsonNode @@ -11,16 +15,24 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.lithic.api.core.BaseDeserializer import com.lithic.api.core.BaseSerializer +import com.lithic.api.core.Enum +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonMissing import com.lithic.api.core.JsonValue import com.lithic.api.core.Params import com.lithic.api.core.allMaxBy +import com.lithic.api.core.checkKnown import com.lithic.api.core.checkRequired import com.lithic.api.core.getOrThrow import com.lithic.api.core.http.Headers import com.lithic.api.core.http.QueryParams +import com.lithic.api.core.toImmutable import com.lithic.api.errors.LithicInvalidDataException +import java.util.Collections import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * Create an account holder and initiate the appropriate onboarding workflow. Account holders and @@ -80,6 +92,9 @@ private constructor( /** Alias for calling [body] with `Body.ofKyb(kyb)`. */ fun body(kyb: Kyb) = body(Body.ofKyb(kyb)) + /** Alias for calling [body] with `Body.ofKybDelegated(kybDelegated)`. */ + fun body(kybDelegated: Body.KybDelegated) = body(Body.ofKybDelegated(kybDelegated)) + /** Alias for calling [body] with `Body.ofKyc(kyc)`. */ fun body(kyc: Kyc) = body(Body.ofKyc(kyc)) @@ -215,6 +230,7 @@ private constructor( class Body private constructor( private val kyb: Kyb? = null, + private val kybDelegated: KybDelegated? = null, private val kyc: Kyc? = null, private val kycExempt: KycExempt? = null, private val _json: JsonValue? = null, @@ -222,18 +238,24 @@ private constructor( fun kyb(): Optional = Optional.ofNullable(kyb) + fun kybDelegated(): Optional = Optional.ofNullable(kybDelegated) + fun kyc(): Optional = Optional.ofNullable(kyc) fun kycExempt(): Optional = Optional.ofNullable(kycExempt) fun isKyb(): Boolean = kyb != null + fun isKybDelegated(): Boolean = kybDelegated != null + fun isKyc(): Boolean = kyc != null fun isKycExempt(): Boolean = kycExempt != null fun asKyb(): Kyb = kyb.getOrThrow("kyb") + fun asKybDelegated(): KybDelegated = kybDelegated.getOrThrow("kybDelegated") + fun asKyc(): Kyc = kyc.getOrThrow("kyc") fun asKycExempt(): KycExempt = kycExempt.getOrThrow("kycExempt") @@ -243,6 +265,7 @@ private constructor( fun accept(visitor: Visitor): T = when { kyb != null -> visitor.visitKyb(kyb) + kybDelegated != null -> visitor.visitKybDelegated(kybDelegated) kyc != null -> visitor.visitKyc(kyc) kycExempt != null -> visitor.visitKycExempt(kycExempt) else -> visitor.unknown(_json) @@ -261,6 +284,10 @@ private constructor( kyb.validate() } + override fun visitKybDelegated(kybDelegated: KybDelegated) { + kybDelegated.validate() + } + override fun visitKyc(kyc: Kyc) { kyc.validate() } @@ -293,6 +320,9 @@ private constructor( object : Visitor { override fun visitKyb(kyb: Kyb) = kyb.validity() + override fun visitKybDelegated(kybDelegated: KybDelegated) = + kybDelegated.validity() + override fun visitKyc(kyc: Kyc) = kyc.validity() override fun visitKycExempt(kycExempt: KycExempt) = kycExempt.validity() @@ -308,15 +338,17 @@ private constructor( return other is Body && kyb == other.kyb && + kybDelegated == other.kybDelegated && kyc == other.kyc && kycExempt == other.kycExempt } - override fun hashCode(): Int = Objects.hash(kyb, kyc, kycExempt) + override fun hashCode(): Int = Objects.hash(kyb, kybDelegated, kyc, kycExempt) override fun toString(): String = when { kyb != null -> "Body{kyb=$kyb}" + kybDelegated != null -> "Body{kybDelegated=$kybDelegated}" kyc != null -> "Body{kyc=$kyc}" kycExempt != null -> "Body{kycExempt=$kycExempt}" _json != null -> "Body{_unknown=$_json}" @@ -327,6 +359,9 @@ private constructor( @JvmStatic fun ofKyb(kyb: Kyb) = Body(kyb = kyb) + @JvmStatic + fun ofKybDelegated(kybDelegated: KybDelegated) = Body(kybDelegated = kybDelegated) + @JvmStatic fun ofKyc(kyc: Kyc) = Body(kyc = kyc) @JvmStatic fun ofKycExempt(kycExempt: KycExempt) = Body(kycExempt = kycExempt) @@ -337,6 +372,8 @@ private constructor( fun visitKyb(kyb: Kyb): T + fun visitKybDelegated(kybDelegated: KybDelegated): T + fun visitKyc(kyc: Kyc): T fun visitKycExempt(kycExempt: KycExempt): T @@ -365,6 +402,9 @@ private constructor( tryDeserialize(node, jacksonTypeRef())?.let { Body(kyb = it, _json = json) }, + tryDeserialize(node, jacksonTypeRef())?.let { + Body(kybDelegated = it, _json = json) + }, tryDeserialize(node, jacksonTypeRef())?.let { Body(kyc = it, _json = json) }, @@ -397,6 +437,7 @@ private constructor( ) { when { value.kyb != null -> generator.writeObject(value.kyb) + value.kybDelegated != null -> generator.writeObject(value.kybDelegated) value.kyc != null -> generator.writeObject(value.kyc) value.kycExempt != null -> generator.writeObject(value.kycExempt) value._json != null -> generator.writeObject(value._json) @@ -404,6 +445,1598 @@ private constructor( } } } + + class KybDelegated + private constructor( + private val businessEntity: JsonField, + private val beneficialOwnerIndividuals: JsonField>, + private val controlPerson: JsonField, + private val externalId: JsonField, + private val natureOfBusiness: JsonField, + private val tosTimestamp: JsonField, + private val websiteUrl: JsonField, + private val workflow: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("business_entity") + @ExcludeMissing + businessEntity: JsonField = JsonMissing.of(), + @JsonProperty("beneficial_owner_individuals") + @ExcludeMissing + beneficialOwnerIndividuals: JsonField> = JsonMissing.of(), + @JsonProperty("control_person") + @ExcludeMissing + controlPerson: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + externalId: JsonField = JsonMissing.of(), + @JsonProperty("nature_of_business") + @ExcludeMissing + natureOfBusiness: JsonField = JsonMissing.of(), + @JsonProperty("tos_timestamp") + @ExcludeMissing + tosTimestamp: JsonField = JsonMissing.of(), + @JsonProperty("website_url") + @ExcludeMissing + websiteUrl: JsonField = JsonMissing.of(), + @JsonProperty("workflow") + @ExcludeMissing + workflow: JsonField = JsonMissing.of(), + ) : this( + businessEntity, + beneficialOwnerIndividuals, + controlPerson, + externalId, + natureOfBusiness, + tosTimestamp, + websiteUrl, + workflow, + mutableMapOf(), + ) + + /** + * Information for business for which the account is being opened. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun businessEntity(): KybDelegatedBusinessEntity = + businessEntity.getRequired("business_entity") + + /** + * You can submit a list of all direct and indirect individuals with 25% or more + * ownership in the company. A maximum of 4 beneficial owners can be submitted. If no + * individual owns 25% of the company you do not need to send beneficial owner + * information. See + * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + * (Section I) for more background on individuals that should be included. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun beneficialOwnerIndividuals(): Optional> = + beneficialOwnerIndividuals.getOptional("beneficial_owner_individuals") + + /** + * An individual with significant responsibility for managing the legal entity (e.g., a + * Chief Executive Officer, Chief Financial Officer, Chief Operating Officer, Managing + * Member, General Partner, President, Vice President, or Treasurer). This can be an + * executive, or someone who will have program-wide access to the cards that Lithic will + * provide. In some cases, this individual could also be a beneficial owner listed + * above. See + * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + * (Section II) for more background. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun controlPerson(): Optional = + controlPerson.getOptional("control_person") + + /** + * A user provided id that can be used to link an account holder with an external system + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun externalId(): Optional = externalId.getOptional("external_id") + + /** + * Short description of the company's line of business (i.e., what does the company + * do?). + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun natureOfBusiness(): Optional = + natureOfBusiness.getOptional("nature_of_business") + + /** + * An RFC 3339 timestamp indicating when the account holder accepted the applicable + * legal agreements (e.g., cardholder terms) as agreed upon during API customer's + * implementation with Lithic. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tosTimestamp(): Optional = tosTimestamp.getOptional("tos_timestamp") + + /** + * Company website URL. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun websiteUrl(): Optional = websiteUrl.getOptional("website_url") + + /** + * Specifies the type of KYB workflow to run. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun workflow(): Optional = workflow.getOptional("workflow") + + /** + * Returns the raw JSON value of [businessEntity]. + * + * Unlike [businessEntity], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("business_entity") + @ExcludeMissing + fun _businessEntity(): JsonField = businessEntity + + /** + * Returns the raw JSON value of [beneficialOwnerIndividuals]. + * + * Unlike [beneficialOwnerIndividuals], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("beneficial_owner_individuals") + @ExcludeMissing + fun _beneficialOwnerIndividuals(): JsonField> = + beneficialOwnerIndividuals + + /** + * Returns the raw JSON value of [controlPerson]. + * + * Unlike [controlPerson], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("control_person") + @ExcludeMissing + fun _controlPerson(): JsonField = controlPerson + + /** + * Returns the raw JSON value of [externalId]. + * + * Unlike [externalId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_id") + @ExcludeMissing + fun _externalId(): JsonField = externalId + + /** + * Returns the raw JSON value of [natureOfBusiness]. + * + * Unlike [natureOfBusiness], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("nature_of_business") + @ExcludeMissing + fun _natureOfBusiness(): JsonField = natureOfBusiness + + /** + * Returns the raw JSON value of [tosTimestamp]. + * + * Unlike [tosTimestamp], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("tos_timestamp") + @ExcludeMissing + fun _tosTimestamp(): JsonField = tosTimestamp + + /** + * Returns the raw JSON value of [websiteUrl]. + * + * Unlike [websiteUrl], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("website_url") + @ExcludeMissing + fun _websiteUrl(): JsonField = websiteUrl + + /** + * Returns the raw JSON value of [workflow]. + * + * Unlike [workflow], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("workflow") + @ExcludeMissing + fun _workflow(): JsonField = workflow + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [KybDelegated]. + * + * The following fields are required: + * ```java + * .businessEntity() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [KybDelegated]. */ + class Builder internal constructor() { + + private var businessEntity: JsonField? = null + private var beneficialOwnerIndividuals: JsonField>? = + null + private var controlPerson: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() + private var natureOfBusiness: JsonField = JsonMissing.of() + private var tosTimestamp: JsonField = JsonMissing.of() + private var websiteUrl: JsonField = JsonMissing.of() + private var workflow: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(kybDelegated: KybDelegated) = apply { + businessEntity = kybDelegated.businessEntity + beneficialOwnerIndividuals = + kybDelegated.beneficialOwnerIndividuals.map { it.toMutableList() } + controlPerson = kybDelegated.controlPerson + externalId = kybDelegated.externalId + natureOfBusiness = kybDelegated.natureOfBusiness + tosTimestamp = kybDelegated.tosTimestamp + websiteUrl = kybDelegated.websiteUrl + workflow = kybDelegated.workflow + additionalProperties = kybDelegated.additionalProperties.toMutableMap() + } + + /** Information for business for which the account is being opened. */ + fun businessEntity(businessEntity: KybDelegatedBusinessEntity) = + businessEntity(JsonField.of(businessEntity)) + + /** + * Sets [Builder.businessEntity] to an arbitrary JSON value. + * + * You should usually call [Builder.businessEntity] with a well-typed + * [KybDelegatedBusinessEntity] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun businessEntity(businessEntity: JsonField) = apply { + this.businessEntity = businessEntity + } + + /** + * You can submit a list of all direct and indirect individuals with 25% or more + * ownership in the company. A maximum of 4 beneficial owners can be submitted. If + * no individual owns 25% of the company you do not need to send beneficial owner + * information. See + * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + * (Section I) for more background on individuals that should be included. + */ + fun beneficialOwnerIndividuals(beneficialOwnerIndividuals: List) = + beneficialOwnerIndividuals(JsonField.of(beneficialOwnerIndividuals)) + + /** + * Sets [Builder.beneficialOwnerIndividuals] to an arbitrary JSON value. + * + * You should usually call [Builder.beneficialOwnerIndividuals] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun beneficialOwnerIndividuals( + beneficialOwnerIndividuals: JsonField> + ) = apply { + this.beneficialOwnerIndividuals = + beneficialOwnerIndividuals.map { it.toMutableList() } + } + + /** + * Adds a single [KybIndividual] to [beneficialOwnerIndividuals]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addBeneficialOwnerIndividual(beneficialOwnerIndividual: KybIndividual) = apply { + beneficialOwnerIndividuals = + (beneficialOwnerIndividuals ?: JsonField.of(mutableListOf())).also { + checkKnown("beneficialOwnerIndividuals", it) + .add(beneficialOwnerIndividual) + } + } + + /** + * An individual with significant responsibility for managing the legal entity + * (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + * Officer, Managing Member, General Partner, President, Vice President, or + * Treasurer). This can be an executive, or someone who will have program-wide + * access to the cards that Lithic will provide. In some cases, this individual + * could also be a beneficial owner listed above. See + * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + * (Section II) for more background. + */ + fun controlPerson(controlPerson: KybIndividual) = + controlPerson(JsonField.of(controlPerson)) + + /** + * Sets [Builder.controlPerson] to an arbitrary JSON value. + * + * You should usually call [Builder.controlPerson] with a well-typed [KybIndividual] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun controlPerson(controlPerson: JsonField) = apply { + this.controlPerson = controlPerson + } + + /** + * A user provided id that can be used to link an account holder with an external + * system + */ + fun externalId(externalId: String) = externalId(JsonField.of(externalId)) + + /** + * Sets [Builder.externalId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun externalId(externalId: JsonField) = apply { + this.externalId = externalId + } + + /** + * Short description of the company's line of business (i.e., what does the company + * do?). + */ + fun natureOfBusiness(natureOfBusiness: String) = + natureOfBusiness(JsonField.of(natureOfBusiness)) + + /** + * Sets [Builder.natureOfBusiness] to an arbitrary JSON value. + * + * You should usually call [Builder.natureOfBusiness] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun natureOfBusiness(natureOfBusiness: JsonField) = apply { + this.natureOfBusiness = natureOfBusiness + } + + /** + * An RFC 3339 timestamp indicating when the account holder accepted the applicable + * legal agreements (e.g., cardholder terms) as agreed upon during API customer's + * implementation with Lithic. + */ + fun tosTimestamp(tosTimestamp: String) = tosTimestamp(JsonField.of(tosTimestamp)) + + /** + * Sets [Builder.tosTimestamp] to an arbitrary JSON value. + * + * You should usually call [Builder.tosTimestamp] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun tosTimestamp(tosTimestamp: JsonField) = apply { + this.tosTimestamp = tosTimestamp + } + + /** Company website URL. */ + fun websiteUrl(websiteUrl: String) = websiteUrl(JsonField.of(websiteUrl)) + + /** + * Sets [Builder.websiteUrl] to an arbitrary JSON value. + * + * You should usually call [Builder.websiteUrl] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun websiteUrl(websiteUrl: JsonField) = apply { + this.websiteUrl = websiteUrl + } + + /** Specifies the type of KYB workflow to run. */ + fun workflow(workflow: Workflow) = workflow(JsonField.of(workflow)) + + /** + * Sets [Builder.workflow] to an arbitrary JSON value. + * + * You should usually call [Builder.workflow] with a well-typed [Workflow] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun workflow(workflow: JsonField) = apply { this.workflow = workflow } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [KybDelegated]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .businessEntity() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): KybDelegated = + KybDelegated( + checkRequired("businessEntity", businessEntity), + (beneficialOwnerIndividuals ?: JsonMissing.of()).map { it.toImmutable() }, + controlPerson, + externalId, + natureOfBusiness, + tosTimestamp, + websiteUrl, + workflow, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): KybDelegated = apply { + if (validated) { + return@apply + } + + businessEntity().validate() + beneficialOwnerIndividuals().ifPresent { it.forEach { it.validate() } } + controlPerson().ifPresent { it.validate() } + externalId() + natureOfBusiness() + tosTimestamp() + websiteUrl() + workflow().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (businessEntity.asKnown().getOrNull()?.validity() ?: 0) + + (beneficialOwnerIndividuals.asKnown().getOrNull()?.sumOf { + it.validity().toInt() + } ?: 0) + + (controlPerson.asKnown().getOrNull()?.validity() ?: 0) + + (if (externalId.asKnown().isPresent) 1 else 0) + + (if (natureOfBusiness.asKnown().isPresent) 1 else 0) + + (if (tosTimestamp.asKnown().isPresent) 1 else 0) + + (if (websiteUrl.asKnown().isPresent) 1 else 0) + + (workflow.asKnown().getOrNull()?.validity() ?: 0) + + /** Information for business for which the account is being opened. */ + class KybDelegatedBusinessEntity + private constructor( + private val address: JsonField
, + private val legalBusinessName: JsonField, + private val dbaBusinessName: JsonField, + private val governmentId: JsonField, + private val parentCompany: JsonField, + private val phoneNumbers: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("address") + @ExcludeMissing + address: JsonField
= JsonMissing.of(), + @JsonProperty("legal_business_name") + @ExcludeMissing + legalBusinessName: JsonField = JsonMissing.of(), + @JsonProperty("dba_business_name") + @ExcludeMissing + dbaBusinessName: JsonField = JsonMissing.of(), + @JsonProperty("government_id") + @ExcludeMissing + governmentId: JsonField = JsonMissing.of(), + @JsonProperty("parent_company") + @ExcludeMissing + parentCompany: JsonField = JsonMissing.of(), + @JsonProperty("phone_numbers") + @ExcludeMissing + phoneNumbers: JsonField> = JsonMissing.of(), + ) : this( + address, + legalBusinessName, + dbaBusinessName, + governmentId, + parentCompany, + phoneNumbers, + mutableMapOf(), + ) + + /** + * Business's physical address - PO boxes, UPS drops, and FedEx drops are not + * acceptable; APO/FPO are acceptable. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun address(): Address = address.getRequired("address") + + /** + * Legal (formal) business name. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun legalBusinessName(): String = + legalBusinessName.getRequired("legal_business_name") + + /** + * Any name that the business operates under that is not its legal business name (if + * applicable). + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun dbaBusinessName(): Optional = + dbaBusinessName.getOptional("dba_business_name") + + /** + * Government-issued identification number. US Federal Employer Identification + * Numbers (EIN) are currently supported, entered as full nine-digits, with or + * without hyphens. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun governmentId(): Optional = governmentId.getOptional("government_id") + + /** + * Parent company name (if applicable). + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun parentCompany(): Optional = parentCompany.getOptional("parent_company") + + /** + * One or more of the business's phone number(s), entered as a list in E.164 format. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun phoneNumbers(): Optional> = + phoneNumbers.getOptional("phone_numbers") + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("address") + @ExcludeMissing + fun _address(): JsonField
= address + + /** + * Returns the raw JSON value of [legalBusinessName]. + * + * Unlike [legalBusinessName], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("legal_business_name") + @ExcludeMissing + fun _legalBusinessName(): JsonField = legalBusinessName + + /** + * Returns the raw JSON value of [dbaBusinessName]. + * + * Unlike [dbaBusinessName], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("dba_business_name") + @ExcludeMissing + fun _dbaBusinessName(): JsonField = dbaBusinessName + + /** + * Returns the raw JSON value of [governmentId]. + * + * Unlike [governmentId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("government_id") + @ExcludeMissing + fun _governmentId(): JsonField = governmentId + + /** + * Returns the raw JSON value of [parentCompany]. + * + * Unlike [parentCompany], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("parent_company") + @ExcludeMissing + fun _parentCompany(): JsonField = parentCompany + + /** + * Returns the raw JSON value of [phoneNumbers]. + * + * Unlike [phoneNumbers], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("phone_numbers") + @ExcludeMissing + fun _phoneNumbers(): JsonField> = phoneNumbers + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [KybDelegatedBusinessEntity]. + * + * The following fields are required: + * ```java + * .address() + * .legalBusinessName() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [KybDelegatedBusinessEntity]. */ + class Builder internal constructor() { + + private var address: JsonField
? = null + private var legalBusinessName: JsonField? = null + private var dbaBusinessName: JsonField = JsonMissing.of() + private var governmentId: JsonField = JsonMissing.of() + private var parentCompany: JsonField = JsonMissing.of() + private var phoneNumbers: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(kybDelegatedBusinessEntity: KybDelegatedBusinessEntity) = + apply { + address = kybDelegatedBusinessEntity.address + legalBusinessName = kybDelegatedBusinessEntity.legalBusinessName + dbaBusinessName = kybDelegatedBusinessEntity.dbaBusinessName + governmentId = kybDelegatedBusinessEntity.governmentId + parentCompany = kybDelegatedBusinessEntity.parentCompany + phoneNumbers = + kybDelegatedBusinessEntity.phoneNumbers.map { it.toMutableList() } + additionalProperties = + kybDelegatedBusinessEntity.additionalProperties.toMutableMap() + } + + /** + * Business's physical address - PO boxes, UPS drops, and FedEx drops are not + * acceptable; APO/FPO are acceptable. + */ + fun address(address: Address) = address(JsonField.of(address)) + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [Address] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun address(address: JsonField
) = apply { this.address = address } + + /** Legal (formal) business name. */ + fun legalBusinessName(legalBusinessName: String) = + legalBusinessName(JsonField.of(legalBusinessName)) + + /** + * Sets [Builder.legalBusinessName] to an arbitrary JSON value. + * + * You should usually call [Builder.legalBusinessName] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun legalBusinessName(legalBusinessName: JsonField) = apply { + this.legalBusinessName = legalBusinessName + } + + /** + * Any name that the business operates under that is not its legal business name + * (if applicable). + */ + fun dbaBusinessName(dbaBusinessName: String) = + dbaBusinessName(JsonField.of(dbaBusinessName)) + + /** + * Sets [Builder.dbaBusinessName] to an arbitrary JSON value. + * + * You should usually call [Builder.dbaBusinessName] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun dbaBusinessName(dbaBusinessName: JsonField) = apply { + this.dbaBusinessName = dbaBusinessName + } + + /** + * Government-issued identification number. US Federal Employer Identification + * Numbers (EIN) are currently supported, entered as full nine-digits, with or + * without hyphens. + */ + fun governmentId(governmentId: String) = + governmentId(JsonField.of(governmentId)) + + /** + * Sets [Builder.governmentId] to an arbitrary JSON value. + * + * You should usually call [Builder.governmentId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun governmentId(governmentId: JsonField) = apply { + this.governmentId = governmentId + } + + /** Parent company name (if applicable). */ + fun parentCompany(parentCompany: String) = + parentCompany(JsonField.of(parentCompany)) + + /** + * Sets [Builder.parentCompany] to an arbitrary JSON value. + * + * You should usually call [Builder.parentCompany] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun parentCompany(parentCompany: JsonField) = apply { + this.parentCompany = parentCompany + } + + /** + * One or more of the business's phone number(s), entered as a list in E.164 + * format. + */ + fun phoneNumbers(phoneNumbers: List) = + phoneNumbers(JsonField.of(phoneNumbers)) + + /** + * Sets [Builder.phoneNumbers] to an arbitrary JSON value. + * + * You should usually call [Builder.phoneNumbers] with a well-typed + * `List` value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun phoneNumbers(phoneNumbers: JsonField>) = apply { + this.phoneNumbers = phoneNumbers.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [phoneNumbers]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addPhoneNumber(phoneNumber: String) = apply { + phoneNumbers = + (phoneNumbers ?: JsonField.of(mutableListOf())).also { + checkKnown("phoneNumbers", it).add(phoneNumber) + } + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [KybDelegatedBusinessEntity]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .address() + * .legalBusinessName() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): KybDelegatedBusinessEntity = + KybDelegatedBusinessEntity( + checkRequired("address", address), + checkRequired("legalBusinessName", legalBusinessName), + dbaBusinessName, + governmentId, + parentCompany, + (phoneNumbers ?: JsonMissing.of()).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): KybDelegatedBusinessEntity = apply { + if (validated) { + return@apply + } + + address().validate() + legalBusinessName() + dbaBusinessName() + governmentId() + parentCompany() + phoneNumbers() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (address.asKnown().getOrNull()?.validity() ?: 0) + + (if (legalBusinessName.asKnown().isPresent) 1 else 0) + + (if (dbaBusinessName.asKnown().isPresent) 1 else 0) + + (if (governmentId.asKnown().isPresent) 1 else 0) + + (if (parentCompany.asKnown().isPresent) 1 else 0) + + (phoneNumbers.asKnown().getOrNull()?.size ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is KybDelegatedBusinessEntity && + address == other.address && + legalBusinessName == other.legalBusinessName && + dbaBusinessName == other.dbaBusinessName && + governmentId == other.governmentId && + parentCompany == other.parentCompany && + phoneNumbers == other.phoneNumbers && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + address, + legalBusinessName, + dbaBusinessName, + governmentId, + parentCompany, + phoneNumbers, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "KybDelegatedBusinessEntity{address=$address, legalBusinessName=$legalBusinessName, dbaBusinessName=$dbaBusinessName, governmentId=$governmentId, parentCompany=$parentCompany, phoneNumbers=$phoneNumbers, additionalProperties=$additionalProperties}" + } + + /** Individuals associated with a KYB application. Phone number is optional. */ + class KybIndividual + private constructor( + private val address: JsonField
, + private val dob: JsonField, + private val email: JsonField, + private val firstName: JsonField, + private val governmentId: JsonField, + private val lastName: JsonField, + private val phoneNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("address") + @ExcludeMissing + address: JsonField
= JsonMissing.of(), + @JsonProperty("dob") @ExcludeMissing dob: JsonField = JsonMissing.of(), + @JsonProperty("email") + @ExcludeMissing + email: JsonField = JsonMissing.of(), + @JsonProperty("first_name") + @ExcludeMissing + firstName: JsonField = JsonMissing.of(), + @JsonProperty("government_id") + @ExcludeMissing + governmentId: JsonField = JsonMissing.of(), + @JsonProperty("last_name") + @ExcludeMissing + lastName: JsonField = JsonMissing.of(), + @JsonProperty("phone_number") + @ExcludeMissing + phoneNumber: JsonField = JsonMissing.of(), + ) : this( + address, + dob, + email, + firstName, + governmentId, + lastName, + phoneNumber, + mutableMapOf(), + ) + + /** + * Individual's current address - PO boxes, UPS drops, and FedEx drops are not + * acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun address(): Address = address.getRequired("address") + + /** + * Individual's date of birth, as an RFC 3339 date. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun dob(): String = dob.getRequired("dob") + + /** + * Individual's email address. If utilizing Lithic for chargeback processing, this + * customer email address may be used to communicate dispute status and resolution. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun email(): String = email.getRequired("email") + + /** + * Individual's first name, as it appears on government-issued identity documents. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun firstName(): String = firstName.getRequired("first_name") + + /** + * Government-issued identification number (required for identity verification and + * compliance with banking regulations). Social Security Numbers (SSN) and + * Individual Taxpayer Identification Numbers (ITIN) are currently supported, + * entered as full nine-digits, with or without hyphens + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun governmentId(): String = governmentId.getRequired("government_id") + + /** + * Individual's last name, as it appears on government-issued identity documents. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun lastName(): String = lastName.getRequired("last_name") + + /** + * Individual's phone number, entered in E.164 format. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun phoneNumber(): Optional = phoneNumber.getOptional("phone_number") + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("address") + @ExcludeMissing + fun _address(): JsonField
= address + + /** + * Returns the raw JSON value of [dob]. + * + * Unlike [dob], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("dob") @ExcludeMissing fun _dob(): JsonField = dob + + /** + * Returns the raw JSON value of [email]. + * + * Unlike [email], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("email") @ExcludeMissing fun _email(): JsonField = email + + /** + * Returns the raw JSON value of [firstName]. + * + * Unlike [firstName], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("first_name") + @ExcludeMissing + fun _firstName(): JsonField = firstName + + /** + * Returns the raw JSON value of [governmentId]. + * + * Unlike [governmentId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("government_id") + @ExcludeMissing + fun _governmentId(): JsonField = governmentId + + /** + * Returns the raw JSON value of [lastName]. + * + * Unlike [lastName], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("last_name") + @ExcludeMissing + fun _lastName(): JsonField = lastName + + /** + * Returns the raw JSON value of [phoneNumber]. + * + * Unlike [phoneNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("phone_number") + @ExcludeMissing + fun _phoneNumber(): JsonField = phoneNumber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [KybIndividual]. + * + * The following fields are required: + * ```java + * .address() + * .dob() + * .email() + * .firstName() + * .governmentId() + * .lastName() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [KybIndividual]. */ + class Builder internal constructor() { + + private var address: JsonField
? = null + private var dob: JsonField? = null + private var email: JsonField? = null + private var firstName: JsonField? = null + private var governmentId: JsonField? = null + private var lastName: JsonField? = null + private var phoneNumber: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(kybIndividual: KybIndividual) = apply { + address = kybIndividual.address + dob = kybIndividual.dob + email = kybIndividual.email + firstName = kybIndividual.firstName + governmentId = kybIndividual.governmentId + lastName = kybIndividual.lastName + phoneNumber = kybIndividual.phoneNumber + additionalProperties = kybIndividual.additionalProperties.toMutableMap() + } + + /** + * Individual's current address - PO boxes, UPS drops, and FedEx drops are not + * acceptable; APO/FPO are acceptable. Only USA addresses are currently + * supported. + */ + fun address(address: Address) = address(JsonField.of(address)) + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [Address] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun address(address: JsonField
) = apply { this.address = address } + + /** Individual's date of birth, as an RFC 3339 date. */ + fun dob(dob: String) = dob(JsonField.of(dob)) + + /** + * Sets [Builder.dob] to an arbitrary JSON value. + * + * You should usually call [Builder.dob] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun dob(dob: JsonField) = apply { this.dob = dob } + + /** + * Individual's email address. If utilizing Lithic for chargeback processing, + * this customer email address may be used to communicate dispute status and + * resolution. + */ + fun email(email: String) = email(JsonField.of(email)) + + /** + * Sets [Builder.email] to an arbitrary JSON value. + * + * You should usually call [Builder.email] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun email(email: JsonField) = apply { this.email = email } + + /** + * Individual's first name, as it appears on government-issued identity + * documents. + */ + fun firstName(firstName: String) = firstName(JsonField.of(firstName)) + + /** + * Sets [Builder.firstName] to an arbitrary JSON value. + * + * You should usually call [Builder.firstName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun firstName(firstName: JsonField) = apply { + this.firstName = firstName + } + + /** + * Government-issued identification number (required for identity verification + * and compliance with banking regulations). Social Security Numbers (SSN) and + * Individual Taxpayer Identification Numbers (ITIN) are currently supported, + * entered as full nine-digits, with or without hyphens + */ + fun governmentId(governmentId: String) = + governmentId(JsonField.of(governmentId)) + + /** + * Sets [Builder.governmentId] to an arbitrary JSON value. + * + * You should usually call [Builder.governmentId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun governmentId(governmentId: JsonField) = apply { + this.governmentId = governmentId + } + + /** + * Individual's last name, as it appears on government-issued identity + * documents. + */ + fun lastName(lastName: String) = lastName(JsonField.of(lastName)) + + /** + * Sets [Builder.lastName] to an arbitrary JSON value. + * + * You should usually call [Builder.lastName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + + /** Individual's phone number, entered in E.164 format. */ + fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) + + /** + * Sets [Builder.phoneNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.phoneNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun phoneNumber(phoneNumber: JsonField) = apply { + this.phoneNumber = phoneNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [KybIndividual]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .address() + * .dob() + * .email() + * .firstName() + * .governmentId() + * .lastName() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): KybIndividual = + KybIndividual( + checkRequired("address", address), + checkRequired("dob", dob), + checkRequired("email", email), + checkRequired("firstName", firstName), + checkRequired("governmentId", governmentId), + checkRequired("lastName", lastName), + phoneNumber, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): KybIndividual = apply { + if (validated) { + return@apply + } + + address().validate() + dob() + email() + firstName() + governmentId() + lastName() + phoneNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (address.asKnown().getOrNull()?.validity() ?: 0) + + (if (dob.asKnown().isPresent) 1 else 0) + + (if (email.asKnown().isPresent) 1 else 0) + + (if (firstName.asKnown().isPresent) 1 else 0) + + (if (governmentId.asKnown().isPresent) 1 else 0) + + (if (lastName.asKnown().isPresent) 1 else 0) + + (if (phoneNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is KybIndividual && + address == other.address && + dob == other.dob && + email == other.email && + firstName == other.firstName && + governmentId == other.governmentId && + lastName == other.lastName && + phoneNumber == other.phoneNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + address, + dob, + email, + firstName, + governmentId, + lastName, + phoneNumber, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "KybIndividual{address=$address, dob=$dob, email=$email, firstName=$firstName, governmentId=$governmentId, lastName=$lastName, phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" + } + + /** Specifies the type of KYB workflow to run. */ + class Workflow @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val KYB_DELEGATED = of("KYB_DELEGATED") + + @JvmStatic fun of(value: String) = Workflow(JsonField.of(value)) + } + + /** An enum containing [Workflow]'s known values. */ + enum class Known { + KYB_DELEGATED + } + + /** + * An enum containing [Workflow]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Workflow] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + KYB_DELEGATED, + /** + * An enum member indicating that [Workflow] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + KYB_DELEGATED -> Value.KYB_DELEGATED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws LithicInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + KYB_DELEGATED -> Known.KYB_DELEGATED + else -> throw LithicInvalidDataException("Unknown Workflow: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws LithicInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LithicInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Workflow = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Workflow && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is KybDelegated && + businessEntity == other.businessEntity && + beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && + controlPerson == other.controlPerson && + externalId == other.externalId && + natureOfBusiness == other.natureOfBusiness && + tosTimestamp == other.tosTimestamp && + websiteUrl == other.websiteUrl && + workflow == other.workflow && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + businessEntity, + beneficialOwnerIndividuals, + controlPerson, + externalId, + natureOfBusiness, + tosTimestamp, + websiteUrl, + workflow, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "KybDelegated{businessEntity=$businessEntity, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, controlPerson=$controlPerson, externalId=$externalId, natureOfBusiness=$natureOfBusiness, tosTimestamp=$tosTimestamp, websiteUrl=$websiteUrl, workflow=$workflow, additionalProperties=$additionalProperties}" + } } override fun equals(other: Any?): Boolean { diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt index 725bcbf0c..08ff4eab3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleCondition.kt @@ -339,10 +339,18 @@ private constructor( @JvmField val DOES_NOT_MATCH = of("DOES_NOT_MATCH") + @JvmField val IS_EQUAL_TO = of("IS_EQUAL_TO") + + @JvmField val IS_NOT_EQUAL_TO = of("IS_NOT_EQUAL_TO") + @JvmField val IS_GREATER_THAN = of("IS_GREATER_THAN") + @JvmField val IS_GREATER_THAN_OR_EQUAL_TO = of("IS_GREATER_THAN_OR_EQUAL_TO") + @JvmField val IS_LESS_THAN = of("IS_LESS_THAN") + @JvmField val IS_LESS_THAN_OR_EQUAL_TO = of("IS_LESS_THAN_OR_EQUAL_TO") + @JvmStatic fun of(value: String) = Operation(JsonField.of(value)) } @@ -352,8 +360,12 @@ private constructor( IS_NOT_ONE_OF, MATCHES, DOES_NOT_MATCH, + IS_EQUAL_TO, + IS_NOT_EQUAL_TO, IS_GREATER_THAN, + IS_GREATER_THAN_OR_EQUAL_TO, IS_LESS_THAN, + IS_LESS_THAN_OR_EQUAL_TO, } /** @@ -370,8 +382,12 @@ private constructor( IS_NOT_ONE_OF, MATCHES, DOES_NOT_MATCH, + IS_EQUAL_TO, + IS_NOT_EQUAL_TO, IS_GREATER_THAN, + IS_GREATER_THAN_OR_EQUAL_TO, IS_LESS_THAN, + IS_LESS_THAN_OR_EQUAL_TO, /** * An enum member indicating that [Operation] was instantiated with an unknown value. */ @@ -391,8 +407,12 @@ private constructor( IS_NOT_ONE_OF -> Value.IS_NOT_ONE_OF MATCHES -> Value.MATCHES DOES_NOT_MATCH -> Value.DOES_NOT_MATCH + IS_EQUAL_TO -> Value.IS_EQUAL_TO + IS_NOT_EQUAL_TO -> Value.IS_NOT_EQUAL_TO IS_GREATER_THAN -> Value.IS_GREATER_THAN + IS_GREATER_THAN_OR_EQUAL_TO -> Value.IS_GREATER_THAN_OR_EQUAL_TO IS_LESS_THAN -> Value.IS_LESS_THAN + IS_LESS_THAN_OR_EQUAL_TO -> Value.IS_LESS_THAN_OR_EQUAL_TO else -> Value._UNKNOWN } @@ -411,8 +431,12 @@ private constructor( IS_NOT_ONE_OF -> Known.IS_NOT_ONE_OF MATCHES -> Known.MATCHES DOES_NOT_MATCH -> Known.DOES_NOT_MATCH + IS_EQUAL_TO -> Known.IS_EQUAL_TO + IS_NOT_EQUAL_TO -> Known.IS_NOT_EQUAL_TO IS_GREATER_THAN -> Known.IS_GREATER_THAN + IS_GREATER_THAN_OR_EQUAL_TO -> Known.IS_GREATER_THAN_OR_EQUAL_TO IS_LESS_THAN -> Known.IS_LESS_THAN + IS_LESS_THAN_OR_EQUAL_TO -> Known.IS_LESS_THAN_OR_EQUAL_TO else -> throw LithicInvalidDataException("Unknown Operation: $value") } @@ -482,7 +506,10 @@ private constructor( /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ fun regex(): Optional = Optional.ofNullable(regex) - /** A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` */ + /** + * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`, + * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO` + */ fun number(): Optional = Optional.ofNullable(number) /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */ @@ -497,7 +524,10 @@ private constructor( /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ fun asRegex(): String = regex.getOrThrow("regex") - /** A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` */ + /** + * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`, + * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO` + */ fun asNumber(): Long = number.getOrThrow("number") /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */ @@ -588,7 +618,10 @@ private constructor( /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ @JvmStatic fun ofRegex(regex: String) = Value(regex = regex) - /** A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` */ + /** + * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`, + * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO` + */ @JvmStatic fun ofNumber(number: Long) = Value(number = number) /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */ @@ -603,7 +636,10 @@ private constructor( /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ fun visitRegex(regex: String): T - /** A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` */ + /** + * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`, + * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO` + */ fun visitNumber(number: Long): T /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */ diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt index 51e76f287..8e4a50d1b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt @@ -5195,22 +5195,72 @@ private constructor( */ class App private constructor( + private val device: JsonField, private val deviceInfo: JsonField, private val ip: JsonField, + private val latitude: JsonField, + private val locale: JsonField, + private val longitude: JsonField, + private val os: JsonField, + private val platform: JsonField, + private val screenHeight: JsonField, + private val screenWidth: JsonField, + private val timeZone: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( + @JsonProperty("device") @ExcludeMissing device: JsonField = JsonMissing.of(), @JsonProperty("device_info") @ExcludeMissing deviceInfo: JsonField = JsonMissing.of(), @JsonProperty("ip") @ExcludeMissing ip: JsonField = JsonMissing.of(), - ) : this(deviceInfo, ip, mutableMapOf()) + @JsonProperty("latitude") + @ExcludeMissing + latitude: JsonField = JsonMissing.of(), + @JsonProperty("locale") @ExcludeMissing locale: JsonField = JsonMissing.of(), + @JsonProperty("longitude") + @ExcludeMissing + longitude: JsonField = JsonMissing.of(), + @JsonProperty("os") @ExcludeMissing os: JsonField = JsonMissing.of(), + @JsonProperty("platform") + @ExcludeMissing + platform: JsonField = JsonMissing.of(), + @JsonProperty("screen_height") + @ExcludeMissing + screenHeight: JsonField = JsonMissing.of(), + @JsonProperty("screen_width") + @ExcludeMissing + screenWidth: JsonField = JsonMissing.of(), + @JsonProperty("time_zone") + @ExcludeMissing + timeZone: JsonField = JsonMissing.of(), + ) : this( + device, + deviceInfo, + ip, + latitude, + locale, + longitude, + os, + platform, + screenHeight, + screenWidth, + timeZone, + mutableMapOf(), + ) /** - * Device information gathered from the cardholder's device - JSON name/value pairs that is - * Base64url encoded. Maps to EMV 3DS field `deviceInfo`. + * Device model: e.g. "Apple iPhone 16". + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun device(): Optional = device.getOptional("device") + + /** + * Raw device information - base64-encoded JSON object. Maps to EMV 3DS field `deviceInfo`. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -5218,14 +5268,84 @@ private constructor( fun deviceInfo(): Optional = deviceInfo.getOptional("device_info") /** - * External IP address used by the app generating the 3DS authentication request. Maps to - * EMV 3DS field `appIp`. + * IP address of the device. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun ip(): Optional = ip.getOptional("ip") + /** + * Latitude coordinate of current device location. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun latitude(): Optional = latitude.getOptional("latitude") + + /** + * Device locale: e.g. "en-US". + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun locale(): Optional = locale.getOptional("locale") + + /** + * Longitude coordinate of current device location. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun longitude(): Optional = longitude.getOptional("longitude") + + /** + * Operating System: e.g. "Android 12", "iOS 17.1". + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun os(): Optional = os.getOptional("os") + + /** + * Device platform: Android, iOS, Windows, etc. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun platform(): Optional = platform.getOptional("platform") + + /** + * Screen height in pixels. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun screenHeight(): Optional = screenHeight.getOptional("screen_height") + + /** + * Screen width in pixels. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun screenWidth(): Optional = screenWidth.getOptional("screen_width") + + /** + * Time zone offset in minutes between UTC and device local time. + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun timeZone(): Optional = timeZone.getOptional("time_zone") + + /** + * Returns the raw JSON value of [device]. + * + * Unlike [device], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("device") @ExcludeMissing fun _device(): JsonField = device + /** * Returns the raw JSON value of [deviceInfo]. * @@ -5242,6 +5362,67 @@ private constructor( */ @JsonProperty("ip") @ExcludeMissing fun _ip(): JsonField = ip + /** + * Returns the raw JSON value of [latitude]. + * + * Unlike [latitude], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("latitude") @ExcludeMissing fun _latitude(): JsonField = latitude + + /** + * Returns the raw JSON value of [locale]. + * + * Unlike [locale], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("locale") @ExcludeMissing fun _locale(): JsonField = locale + + /** + * Returns the raw JSON value of [longitude]. + * + * Unlike [longitude], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("longitude") @ExcludeMissing fun _longitude(): JsonField = longitude + + /** + * Returns the raw JSON value of [os]. + * + * Unlike [os], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("os") @ExcludeMissing fun _os(): JsonField = os + + /** + * Returns the raw JSON value of [platform]. + * + * Unlike [platform], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("platform") @ExcludeMissing fun _platform(): JsonField = platform + + /** + * Returns the raw JSON value of [screenHeight]. + * + * Unlike [screenHeight], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("screen_height") + @ExcludeMissing + fun _screenHeight(): JsonField = screenHeight + + /** + * Returns the raw JSON value of [screenWidth]. + * + * Unlike [screenWidth], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("screen_width") + @ExcludeMissing + fun _screenWidth(): JsonField = screenWidth + + /** + * Returns the raw JSON value of [timeZone]. + * + * Unlike [timeZone], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("time_zone") @ExcludeMissing fun _timeZone(): JsonField = timeZone + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -5263,20 +5444,53 @@ private constructor( /** A builder for [App]. */ class Builder internal constructor() { + private var device: JsonField = JsonMissing.of() private var deviceInfo: JsonField = JsonMissing.of() private var ip: JsonField = JsonMissing.of() + private var latitude: JsonField = JsonMissing.of() + private var locale: JsonField = JsonMissing.of() + private var longitude: JsonField = JsonMissing.of() + private var os: JsonField = JsonMissing.of() + private var platform: JsonField = JsonMissing.of() + private var screenHeight: JsonField = JsonMissing.of() + private var screenWidth: JsonField = JsonMissing.of() + private var timeZone: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(app: App) = apply { + device = app.device deviceInfo = app.deviceInfo ip = app.ip + latitude = app.latitude + locale = app.locale + longitude = app.longitude + os = app.os + platform = app.platform + screenHeight = app.screenHeight + screenWidth = app.screenWidth + timeZone = app.timeZone additionalProperties = app.additionalProperties.toMutableMap() } + /** Device model: e.g. "Apple iPhone 16". */ + fun device(device: String?) = device(JsonField.ofNullable(device)) + + /** Alias for calling [Builder.device] with `device.orElse(null)`. */ + fun device(device: Optional) = device(device.getOrNull()) + /** - * Device information gathered from the cardholder's device - JSON name/value pairs that - * is Base64url encoded. Maps to EMV 3DS field `deviceInfo`. + * Sets [Builder.device] to an arbitrary JSON value. + * + * You should usually call [Builder.device] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun device(device: JsonField) = apply { this.device = device } + + /** + * Raw device information - base64-encoded JSON object. Maps to EMV 3DS field + * `deviceInfo`. */ fun deviceInfo(deviceInfo: String?) = deviceInfo(JsonField.ofNullable(deviceInfo)) @@ -5292,10 +5506,7 @@ private constructor( */ fun deviceInfo(deviceInfo: JsonField) = apply { this.deviceInfo = deviceInfo } - /** - * External IP address used by the app generating the 3DS authentication request. Maps - * to EMV 3DS field `appIp`. - */ + /** IP address of the device. */ fun ip(ip: String) = ip(JsonField.of(ip)) /** @@ -5307,6 +5518,156 @@ private constructor( */ fun ip(ip: JsonField) = apply { this.ip = ip } + /** Latitude coordinate of current device location. */ + fun latitude(latitude: Double?) = latitude(JsonField.ofNullable(latitude)) + + /** + * Alias for [Builder.latitude]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun latitude(latitude: Double) = latitude(latitude as Double?) + + /** Alias for calling [Builder.latitude] with `latitude.orElse(null)`. */ + fun latitude(latitude: Optional) = latitude(latitude.getOrNull()) + + /** + * Sets [Builder.latitude] to an arbitrary JSON value. + * + * You should usually call [Builder.latitude] with a well-typed [Double] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun latitude(latitude: JsonField) = apply { this.latitude = latitude } + + /** Device locale: e.g. "en-US". */ + fun locale(locale: String?) = locale(JsonField.ofNullable(locale)) + + /** Alias for calling [Builder.locale] with `locale.orElse(null)`. */ + fun locale(locale: Optional) = locale(locale.getOrNull()) + + /** + * Sets [Builder.locale] to an arbitrary JSON value. + * + * You should usually call [Builder.locale] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun locale(locale: JsonField) = apply { this.locale = locale } + + /** Longitude coordinate of current device location. */ + fun longitude(longitude: Double?) = longitude(JsonField.ofNullable(longitude)) + + /** + * Alias for [Builder.longitude]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun longitude(longitude: Double) = longitude(longitude as Double?) + + /** Alias for calling [Builder.longitude] with `longitude.orElse(null)`. */ + fun longitude(longitude: Optional) = longitude(longitude.getOrNull()) + + /** + * Sets [Builder.longitude] to an arbitrary JSON value. + * + * You should usually call [Builder.longitude] with a well-typed [Double] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun longitude(longitude: JsonField) = apply { this.longitude = longitude } + + /** Operating System: e.g. "Android 12", "iOS 17.1". */ + fun os(os: String?) = os(JsonField.ofNullable(os)) + + /** Alias for calling [Builder.os] with `os.orElse(null)`. */ + fun os(os: Optional) = os(os.getOrNull()) + + /** + * Sets [Builder.os] to an arbitrary JSON value. + * + * You should usually call [Builder.os] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun os(os: JsonField) = apply { this.os = os } + + /** Device platform: Android, iOS, Windows, etc. */ + fun platform(platform: String?) = platform(JsonField.ofNullable(platform)) + + /** Alias for calling [Builder.platform] with `platform.orElse(null)`. */ + fun platform(platform: Optional) = platform(platform.getOrNull()) + + /** + * Sets [Builder.platform] to an arbitrary JSON value. + * + * You should usually call [Builder.platform] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun platform(platform: JsonField) = apply { this.platform = platform } + + /** Screen height in pixels. */ + fun screenHeight(screenHeight: Long?) = screenHeight(JsonField.ofNullable(screenHeight)) + + /** + * Alias for [Builder.screenHeight]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun screenHeight(screenHeight: Long) = screenHeight(screenHeight as Long?) + + /** Alias for calling [Builder.screenHeight] with `screenHeight.orElse(null)`. */ + fun screenHeight(screenHeight: Optional) = screenHeight(screenHeight.getOrNull()) + + /** + * Sets [Builder.screenHeight] to an arbitrary JSON value. + * + * You should usually call [Builder.screenHeight] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun screenHeight(screenHeight: JsonField) = apply { + this.screenHeight = screenHeight + } + + /** Screen width in pixels. */ + fun screenWidth(screenWidth: Long?) = screenWidth(JsonField.ofNullable(screenWidth)) + + /** + * Alias for [Builder.screenWidth]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun screenWidth(screenWidth: Long) = screenWidth(screenWidth as Long?) + + /** Alias for calling [Builder.screenWidth] with `screenWidth.orElse(null)`. */ + fun screenWidth(screenWidth: Optional) = screenWidth(screenWidth.getOrNull()) + + /** + * Sets [Builder.screenWidth] to an arbitrary JSON value. + * + * You should usually call [Builder.screenWidth] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun screenWidth(screenWidth: JsonField) = apply { this.screenWidth = screenWidth } + + /** Time zone offset in minutes between UTC and device local time. */ + fun timeZone(timeZone: String?) = timeZone(JsonField.ofNullable(timeZone)) + + /** Alias for calling [Builder.timeZone] with `timeZone.orElse(null)`. */ + fun timeZone(timeZone: Optional) = timeZone(timeZone.getOrNull()) + + /** + * Sets [Builder.timeZone] to an arbitrary JSON value. + * + * You should usually call [Builder.timeZone] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun timeZone(timeZone: JsonField) = apply { this.timeZone = timeZone } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -5331,7 +5692,21 @@ private constructor( * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): App = App(deviceInfo, ip, additionalProperties.toMutableMap()) + fun build(): App = + App( + device, + deviceInfo, + ip, + latitude, + locale, + longitude, + os, + platform, + screenHeight, + screenWidth, + timeZone, + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false @@ -5341,8 +5716,17 @@ private constructor( return@apply } + device() deviceInfo() ip() + latitude() + locale() + longitude() + os() + platform() + screenHeight() + screenWidth() + timeZone() validated = true } @@ -5362,7 +5746,17 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (deviceInfo.asKnown().isPresent) 1 else 0) + (if (ip.asKnown().isPresent) 1 else 0) + (if (device.asKnown().isPresent) 1 else 0) + + (if (deviceInfo.asKnown().isPresent) 1 else 0) + + (if (ip.asKnown().isPresent) 1 else 0) + + (if (latitude.asKnown().isPresent) 1 else 0) + + (if (locale.asKnown().isPresent) 1 else 0) + + (if (longitude.asKnown().isPresent) 1 else 0) + + (if (os.asKnown().isPresent) 1 else 0) + + (if (platform.asKnown().isPresent) 1 else 0) + + (if (screenHeight.asKnown().isPresent) 1 else 0) + + (if (screenWidth.asKnown().isPresent) 1 else 0) + + (if (timeZone.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -5370,17 +5764,41 @@ private constructor( } return other is App && + device == other.device && deviceInfo == other.deviceInfo && ip == other.ip && + latitude == other.latitude && + locale == other.locale && + longitude == other.longitude && + os == other.os && + platform == other.platform && + screenHeight == other.screenHeight && + screenWidth == other.screenWidth && + timeZone == other.timeZone && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(deviceInfo, ip, additionalProperties) } + private val hashCode: Int by lazy { + Objects.hash( + device, + deviceInfo, + ip, + latitude, + locale, + longitude, + os, + platform, + screenHeight, + screenWidth, + timeZone, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode override fun toString() = - "App{deviceInfo=$deviceInfo, ip=$ip, additionalProperties=$additionalProperties}" + "App{device=$device, deviceInfo=$deviceInfo, ip=$ip, latitude=$latitude, locale=$locale, longitude=$longitude, os=$os, platform=$platform, screenHeight=$screenHeight, screenWidth=$screenWidth, timeZone=$timeZone, additionalProperties=$additionalProperties}" } /** @@ -5665,9 +6083,8 @@ private constructor( fun language(): Optional = language.getOptional("language") /** - * Time zone of the cardholder's browser offset in minutes between UTC and the cardholder - * browser's local time. The offset is positive if the local time is behind UTC and negative - * if it is ahead. Maps to EMV 3DS field `browserTz`. + * Time zone offset in minutes between UTC and browser local time. Maps to EMV 3DS field + * `browserTz`. * * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -5899,9 +6316,8 @@ private constructor( fun language(language: JsonField) = apply { this.language = language } /** - * Time zone of the cardholder's browser offset in minutes between UTC and the - * cardholder browser's local time. The offset is positive if the local time is behind - * UTC and negative if it is ahead. Maps to EMV 3DS field `browserTz`. + * Time zone offset in minutes between UTC and browser local time. Maps to EMV 3DS field + * `browserTz`. */ fun timeZone(timeZone: String?) = timeZone(JsonField.ofNullable(timeZone)) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt index b90b11b61..b3347b500 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferCreateParams.kt @@ -1340,6 +1340,8 @@ private constructor( @JvmField val TRANSFER = of("TRANSFER") + @JvmField val COLLECTION = of("COLLECTION") + @JvmStatic fun of(value: String) = BookTransferType(JsonField.of(value)) } @@ -1378,6 +1380,7 @@ private constructor( DISPUTE_WON, SERVICE, TRANSFER, + COLLECTION, } /** @@ -1423,6 +1426,7 @@ private constructor( DISPUTE_WON, SERVICE, TRANSFER, + COLLECTION, /** * An enum member indicating that [BookTransferType] was instantiated with an unknown * value. @@ -1472,6 +1476,7 @@ private constructor( DISPUTE_WON -> Value.DISPUTE_WON SERVICE -> Value.SERVICE TRANSFER -> Value.TRANSFER + COLLECTION -> Value.COLLECTION else -> Value._UNKNOWN } @@ -1519,6 +1524,7 @@ private constructor( DISPUTE_WON -> Known.DISPUTE_WON SERVICE -> Known.SERVICE TRANSFER -> Known.TRANSFER + COLLECTION -> Known.COLLECTION else -> throw LithicInvalidDataException("Unknown BookTransferType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt index e6ff91d79..136d124ff 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt @@ -1737,6 +1737,8 @@ private constructor( @JvmField val TRANSFER = of("TRANSFER") + @JvmField val COLLECTION = of("COLLECTION") + @JvmStatic fun of(value: String) = BookTransferType(JsonField.of(value)) } @@ -1775,6 +1777,7 @@ private constructor( DISPUTE_WON, SERVICE, TRANSFER, + COLLECTION, } /** @@ -1821,6 +1824,7 @@ private constructor( DISPUTE_WON, SERVICE, TRANSFER, + COLLECTION, /** * An enum member indicating that [BookTransferType] was instantiated with an * unknown value. @@ -1870,6 +1874,7 @@ private constructor( DISPUTE_WON -> Value.DISPUTE_WON SERVICE -> Value.SERVICE TRANSFER -> Value.TRANSFER + COLLECTION -> Value.COLLECTION else -> Value._UNKNOWN } @@ -1917,6 +1922,7 @@ private constructor( DISPUTE_WON -> Known.DISPUTE_WON SERVICE -> Known.SERVICE TRANSFER -> Known.TRANSFER + COLLECTION -> Known.COLLECTION else -> throw LithicInvalidDataException("Unknown BookTransferType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt index 0186d8283..7c36cd7be 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Conditional3dsActionParameters.kt @@ -808,10 +808,18 @@ private constructor( @JvmField val DOES_NOT_MATCH = of("DOES_NOT_MATCH") + @JvmField val IS_EQUAL_TO = of("IS_EQUAL_TO") + + @JvmField val IS_NOT_EQUAL_TO = of("IS_NOT_EQUAL_TO") + @JvmField val IS_GREATER_THAN = of("IS_GREATER_THAN") + @JvmField val IS_GREATER_THAN_OR_EQUAL_TO = of("IS_GREATER_THAN_OR_EQUAL_TO") + @JvmField val IS_LESS_THAN = of("IS_LESS_THAN") + @JvmField val IS_LESS_THAN_OR_EQUAL_TO = of("IS_LESS_THAN_OR_EQUAL_TO") + @JvmStatic fun of(value: String) = Operation(JsonField.of(value)) } @@ -821,8 +829,12 @@ private constructor( IS_NOT_ONE_OF, MATCHES, DOES_NOT_MATCH, + IS_EQUAL_TO, + IS_NOT_EQUAL_TO, IS_GREATER_THAN, + IS_GREATER_THAN_OR_EQUAL_TO, IS_LESS_THAN, + IS_LESS_THAN_OR_EQUAL_TO, } /** @@ -839,8 +851,12 @@ private constructor( IS_NOT_ONE_OF, MATCHES, DOES_NOT_MATCH, + IS_EQUAL_TO, + IS_NOT_EQUAL_TO, IS_GREATER_THAN, + IS_GREATER_THAN_OR_EQUAL_TO, IS_LESS_THAN, + IS_LESS_THAN_OR_EQUAL_TO, /** * An enum member indicating that [Operation] was instantiated with an unknown * value. @@ -861,8 +877,12 @@ private constructor( IS_NOT_ONE_OF -> Value.IS_NOT_ONE_OF MATCHES -> Value.MATCHES DOES_NOT_MATCH -> Value.DOES_NOT_MATCH + IS_EQUAL_TO -> Value.IS_EQUAL_TO + IS_NOT_EQUAL_TO -> Value.IS_NOT_EQUAL_TO IS_GREATER_THAN -> Value.IS_GREATER_THAN + IS_GREATER_THAN_OR_EQUAL_TO -> Value.IS_GREATER_THAN_OR_EQUAL_TO IS_LESS_THAN -> Value.IS_LESS_THAN + IS_LESS_THAN_OR_EQUAL_TO -> Value.IS_LESS_THAN_OR_EQUAL_TO else -> Value._UNKNOWN } @@ -881,8 +901,12 @@ private constructor( IS_NOT_ONE_OF -> Known.IS_NOT_ONE_OF MATCHES -> Known.MATCHES DOES_NOT_MATCH -> Known.DOES_NOT_MATCH + IS_EQUAL_TO -> Known.IS_EQUAL_TO + IS_NOT_EQUAL_TO -> Known.IS_NOT_EQUAL_TO IS_GREATER_THAN -> Known.IS_GREATER_THAN + IS_GREATER_THAN_OR_EQUAL_TO -> Known.IS_GREATER_THAN_OR_EQUAL_TO IS_LESS_THAN -> Known.IS_LESS_THAN + IS_LESS_THAN_OR_EQUAL_TO -> Known.IS_LESS_THAN_OR_EQUAL_TO else -> throw LithicInvalidDataException("Unknown Operation: $value") } @@ -954,7 +978,10 @@ private constructor( /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ fun regex(): Optional = Optional.ofNullable(regex) - /** A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` */ + /** + * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`, + * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO` + */ fun number(): Optional = Optional.ofNullable(number) /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */ @@ -969,7 +996,10 @@ private constructor( /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ fun asRegex(): String = regex.getOrThrow("regex") - /** A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` */ + /** + * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`, + * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO` + */ fun asNumber(): Long = number.getOrThrow("number") /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */ @@ -1060,7 +1090,10 @@ private constructor( /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ @JvmStatic fun ofRegex(regex: String) = Value(regex = regex) - /** A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` */ + /** + * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`, + * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO` + */ @JvmStatic fun ofNumber(number: Long) = Value(number = number) /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */ @@ -1077,7 +1110,10 @@ private constructor( /** A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ fun visitRegex(regex: String): T - /** A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` */ + /** + * A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`, + * `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO` + */ fun visitNumber(number: Long): T /** An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` */ diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt index ed95344a2..c9cdaf65a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt @@ -1555,7 +1555,7 @@ private constructor( @JvmField val COLLECTION = of("COLLECTION") - @JvmField val BANK_ACCOUNTS_PAYABLE = of("BANK_ACCOUNTS_PAYABLE") + @JvmField val PROGRAM_BANK_ACCOUNTS_PAYABLE = of("PROGRAM_BANK_ACCOUNTS_PAYABLE") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1571,7 +1571,7 @@ private constructor( SECURITY, PROGRAM_RECEIVABLES, COLLECTION, - BANK_ACCOUNTS_PAYABLE, + PROGRAM_BANK_ACCOUNTS_PAYABLE, } /** @@ -1593,7 +1593,7 @@ private constructor( SECURITY, PROGRAM_RECEIVABLES, COLLECTION, - BANK_ACCOUNTS_PAYABLE, + PROGRAM_BANK_ACCOUNTS_PAYABLE, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1616,7 +1616,7 @@ private constructor( SECURITY -> Value.SECURITY PROGRAM_RECEIVABLES -> Value.PROGRAM_RECEIVABLES COLLECTION -> Value.COLLECTION - BANK_ACCOUNTS_PAYABLE -> Value.BANK_ACCOUNTS_PAYABLE + PROGRAM_BANK_ACCOUNTS_PAYABLE -> Value.PROGRAM_BANK_ACCOUNTS_PAYABLE else -> Value._UNKNOWN } @@ -1640,7 +1640,7 @@ private constructor( SECURITY -> Known.SECURITY PROGRAM_RECEIVABLES -> Known.PROGRAM_RECEIVABLES COLLECTION -> Known.COLLECTION - BANK_ACCOUNTS_PAYABLE -> Known.BANK_ACCOUNTS_PAYABLE + PROGRAM_BANK_ACCOUNTS_PAYABLE -> Known.PROGRAM_BANK_ACCOUNTS_PAYABLE else -> throw LithicInvalidDataException("Unknown Type: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt index 3b13057a6..09dcc0113 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstanceFinancialAccountType.kt @@ -41,7 +41,7 @@ private constructor(private val value: JsonField) : Enum { @JvmField val COLLECTION = of("COLLECTION") - @JvmField val BANK_ACCOUNTS_PAYABLE = of("BANK_ACCOUNTS_PAYABLE") + @JvmField val PROGRAM_BANK_ACCOUNTS_PAYABLE = of("PROGRAM_BANK_ACCOUNTS_PAYABLE") @JvmStatic fun of(value: String) = InstanceFinancialAccountType(JsonField.of(value)) } @@ -57,7 +57,7 @@ private constructor(private val value: JsonField) : Enum { SECURITY, PROGRAM_RECEIVABLES, COLLECTION, - BANK_ACCOUNTS_PAYABLE, + PROGRAM_BANK_ACCOUNTS_PAYABLE, } /** @@ -81,7 +81,7 @@ private constructor(private val value: JsonField) : Enum { SECURITY, PROGRAM_RECEIVABLES, COLLECTION, - BANK_ACCOUNTS_PAYABLE, + PROGRAM_BANK_ACCOUNTS_PAYABLE, /** * An enum member indicating that [InstanceFinancialAccountType] was instantiated with an * unknown value. @@ -107,7 +107,7 @@ private constructor(private val value: JsonField) : Enum { SECURITY -> Value.SECURITY PROGRAM_RECEIVABLES -> Value.PROGRAM_RECEIVABLES COLLECTION -> Value.COLLECTION - BANK_ACCOUNTS_PAYABLE -> Value.BANK_ACCOUNTS_PAYABLE + PROGRAM_BANK_ACCOUNTS_PAYABLE -> Value.PROGRAM_BANK_ACCOUNTS_PAYABLE else -> Value._UNKNOWN } @@ -130,7 +130,7 @@ private constructor(private val value: JsonField) : Enum { SECURITY -> Known.SECURITY PROGRAM_RECEIVABLES -> Known.PROGRAM_RECEIVABLES COLLECTION -> Known.COLLECTION - BANK_ACCOUNTS_PAYABLE -> Known.BANK_ACCOUNTS_PAYABLE + PROGRAM_BANK_ACCOUNTS_PAYABLE -> Known.PROGRAM_BANK_ACCOUNTS_PAYABLE else -> throw LithicInvalidDataException("Unknown InstanceFinancialAccountType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt index f4ac4ff72..fa874e6e4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt @@ -3520,17 +3520,13 @@ private constructor( @JvmField val RECEIPT_DEBIT = of("RECEIPT_DEBIT") - @JvmField val CUSTOMER_TRANSFER = of("CUSTOMER_TRANSFER") + @JvmField val WIRE_INBOUND_PAYMENT = of("WIRE_INBOUND_PAYMENT") - @JvmField val DRAWDOWN_PAYMENT = of("DRAWDOWN_PAYMENT") + @JvmField val WIRE_INBOUND_ADMIN = of("WIRE_INBOUND_ADMIN") - @JvmField val REVERSAL_PAYMENT = of("REVERSAL_PAYMENT") + @JvmField val WIRE_OUTBOUND_PAYMENT = of("WIRE_OUTBOUND_PAYMENT") - @JvmField val DRAWDOWN_REQUEST = of("DRAWDOWN_REQUEST") - - @JvmField val REVERSAL_REQUEST = of("REVERSAL_REQUEST") - - @JvmField val DRAWDOWN_REFUSAL = of("DRAWDOWN_REFUSAL") + @JvmField val WIRE_OUTBOUND_ADMIN = of("WIRE_OUTBOUND_ADMIN") @JvmStatic fun of(value: String) = TransferType(JsonField.of(value)) } @@ -3541,12 +3537,10 @@ private constructor( ORIGINATION_DEBIT, RECEIPT_CREDIT, RECEIPT_DEBIT, - CUSTOMER_TRANSFER, - DRAWDOWN_PAYMENT, - REVERSAL_PAYMENT, - DRAWDOWN_REQUEST, - REVERSAL_REQUEST, - DRAWDOWN_REFUSAL, + WIRE_INBOUND_PAYMENT, + WIRE_INBOUND_ADMIN, + WIRE_OUTBOUND_PAYMENT, + WIRE_OUTBOUND_ADMIN, } /** @@ -3563,12 +3557,10 @@ private constructor( ORIGINATION_DEBIT, RECEIPT_CREDIT, RECEIPT_DEBIT, - CUSTOMER_TRANSFER, - DRAWDOWN_PAYMENT, - REVERSAL_PAYMENT, - DRAWDOWN_REQUEST, - REVERSAL_REQUEST, - DRAWDOWN_REFUSAL, + WIRE_INBOUND_PAYMENT, + WIRE_INBOUND_ADMIN, + WIRE_OUTBOUND_PAYMENT, + WIRE_OUTBOUND_ADMIN, /** * An enum member indicating that [TransferType] was instantiated with an unknown value. */ @@ -3588,12 +3580,10 @@ private constructor( ORIGINATION_DEBIT -> Value.ORIGINATION_DEBIT RECEIPT_CREDIT -> Value.RECEIPT_CREDIT RECEIPT_DEBIT -> Value.RECEIPT_DEBIT - CUSTOMER_TRANSFER -> Value.CUSTOMER_TRANSFER - DRAWDOWN_PAYMENT -> Value.DRAWDOWN_PAYMENT - REVERSAL_PAYMENT -> Value.REVERSAL_PAYMENT - DRAWDOWN_REQUEST -> Value.DRAWDOWN_REQUEST - REVERSAL_REQUEST -> Value.REVERSAL_REQUEST - DRAWDOWN_REFUSAL -> Value.DRAWDOWN_REFUSAL + WIRE_INBOUND_PAYMENT -> Value.WIRE_INBOUND_PAYMENT + WIRE_INBOUND_ADMIN -> Value.WIRE_INBOUND_ADMIN + WIRE_OUTBOUND_PAYMENT -> Value.WIRE_OUTBOUND_PAYMENT + WIRE_OUTBOUND_ADMIN -> Value.WIRE_OUTBOUND_ADMIN else -> Value._UNKNOWN } @@ -3612,12 +3602,10 @@ private constructor( ORIGINATION_DEBIT -> Known.ORIGINATION_DEBIT RECEIPT_CREDIT -> Known.RECEIPT_CREDIT RECEIPT_DEBIT -> Known.RECEIPT_DEBIT - CUSTOMER_TRANSFER -> Known.CUSTOMER_TRANSFER - DRAWDOWN_PAYMENT -> Known.DRAWDOWN_PAYMENT - REVERSAL_PAYMENT -> Known.REVERSAL_PAYMENT - DRAWDOWN_REQUEST -> Known.DRAWDOWN_REQUEST - REVERSAL_REQUEST -> Known.REVERSAL_REQUEST - DRAWDOWN_REFUSAL -> Known.DRAWDOWN_REFUSAL + WIRE_INBOUND_PAYMENT -> Known.WIRE_INBOUND_PAYMENT + WIRE_INBOUND_ADMIN -> Known.WIRE_INBOUND_ADMIN + WIRE_OUTBOUND_PAYMENT -> Known.WIRE_OUTBOUND_PAYMENT + WIRE_OUTBOUND_ADMIN -> Known.WIRE_OUTBOUND_ADMIN else -> throw LithicInvalidDataException("Unknown TransferType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementListDetailsParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementListDetailsParams.kt index f9432e137..52728d12e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementListDetailsParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ReportSettlementListDetailsParams.kt @@ -29,7 +29,7 @@ private constructor( */ fun endingBefore(): Optional = Optional.ofNullable(endingBefore) - /** Page size (for pagination). */ + /** Number of records per page. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** @@ -93,7 +93,7 @@ private constructor( /** Alias for calling [Builder.endingBefore] with `endingBefore.orElse(null)`. */ fun endingBefore(endingBefore: Optional) = endingBefore(endingBefore.getOrNull()) - /** Page size (for pagination). */ + /** Number of records per page. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/WirePartyDetails.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/WirePartyDetails.kt new file mode 100644 index 000000000..f00365dcb --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/WirePartyDetails.kt @@ -0,0 +1,287 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonMissing +import com.lithic.api.core.JsonValue +import com.lithic.api.errors.LithicInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class WirePartyDetails +private constructor( + private val accountNumber: JsonField, + private val agentId: JsonField, + private val agentName: JsonField, + private val name: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("account_number") + @ExcludeMissing + accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("agent_id") @ExcludeMissing agentId: JsonField = JsonMissing.of(), + @JsonProperty("agent_name") @ExcludeMissing agentName: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(accountNumber, agentId, agentName, name, mutableMapOf()) + + /** + * Account number + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accountNumber(): Optional = accountNumber.getOptional("account_number") + + /** + * Routing number or BIC of the financial institution + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun agentId(): Optional = agentId.getOptional("agent_id") + + /** + * Name of the financial institution + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun agentName(): Optional = agentName.getOptional("agent_name") + + /** + * Name of the person or company + * + * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") + + /** + * Returns the raw JSON value of [accountNumber]. + * + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_number") + @ExcludeMissing + fun _accountNumber(): JsonField = accountNumber + + /** + * Returns the raw JSON value of [agentId]. + * + * Unlike [agentId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("agent_id") @ExcludeMissing fun _agentId(): JsonField = agentId + + /** + * Returns the raw JSON value of [agentName]. + * + * Unlike [agentName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("agent_name") @ExcludeMissing fun _agentName(): JsonField = agentName + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [WirePartyDetails]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [WirePartyDetails]. */ + class Builder internal constructor() { + + private var accountNumber: JsonField = JsonMissing.of() + private var agentId: JsonField = JsonMissing.of() + private var agentName: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(wirePartyDetails: WirePartyDetails) = apply { + accountNumber = wirePartyDetails.accountNumber + agentId = wirePartyDetails.agentId + agentName = wirePartyDetails.agentName + name = wirePartyDetails.name + additionalProperties = wirePartyDetails.additionalProperties.toMutableMap() + } + + /** Account number */ + fun accountNumber(accountNumber: String?) = + accountNumber(JsonField.ofNullable(accountNumber)) + + /** Alias for calling [Builder.accountNumber] with `accountNumber.orElse(null)`. */ + fun accountNumber(accountNumber: Optional) = + accountNumber(accountNumber.getOrNull()) + + /** + * Sets [Builder.accountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber + } + + /** Routing number or BIC of the financial institution */ + fun agentId(agentId: String?) = agentId(JsonField.ofNullable(agentId)) + + /** Alias for calling [Builder.agentId] with `agentId.orElse(null)`. */ + fun agentId(agentId: Optional) = agentId(agentId.getOrNull()) + + /** + * Sets [Builder.agentId] to an arbitrary JSON value. + * + * You should usually call [Builder.agentId] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun agentId(agentId: JsonField) = apply { this.agentId = agentId } + + /** Name of the financial institution */ + fun agentName(agentName: String?) = agentName(JsonField.ofNullable(agentName)) + + /** Alias for calling [Builder.agentName] with `agentName.orElse(null)`. */ + fun agentName(agentName: Optional) = agentName(agentName.getOrNull()) + + /** + * Sets [Builder.agentName] to an arbitrary JSON value. + * + * You should usually call [Builder.agentName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun agentName(agentName: JsonField) = apply { this.agentName = agentName } + + /** Name of the person or company */ + fun name(name: String?) = name(JsonField.ofNullable(name)) + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [WirePartyDetails]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): WirePartyDetails = + WirePartyDetails( + accountNumber, + agentId, + agentName, + name, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): WirePartyDetails = apply { + if (validated) { + return@apply + } + + accountNumber() + agentId() + agentName() + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LithicInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (accountNumber.asKnown().isPresent) 1 else 0) + + (if (agentId.asKnown().isPresent) 1 else 0) + + (if (agentName.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is WirePartyDetails && + accountNumber == other.accountNumber && + agentId == other.agentId && + agentName == other.agentName && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(accountNumber, agentId, agentName, name, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "WirePartyDetails{accountNumber=$accountNumber, agentId=$agentId, agentName=$agentName, name=$name, additionalProperties=$additionalProperties}" +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListResponseTest.kt index f093621cb..dcb332064 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListResponseTest.kt @@ -848,6 +848,9 @@ internal class AccountActivityListResponseTest { .currency("USD") .expectedReleaseDate(LocalDate.parse("2019-12-27")) .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .type( + AccountActivityListResponse.PaymentTransaction.TransferType.ORIGINATION_CREDIT + ) .userDefinedId("user_defined_id") .build() @@ -938,6 +941,10 @@ internal class AccountActivityListResponseTest { .currency("USD") .expectedReleaseDate(LocalDate.parse("2019-12-27")) .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .type( + AccountActivityListResponse.PaymentTransaction.TransferType + .ORIGINATION_CREDIT + ) .userDefinedId("user_defined_id") .build() ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponseTest.kt index e8a4c3bea..8a937d019 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponseTest.kt @@ -945,6 +945,10 @@ internal class AccountActivityRetrieveTransactionResponseTest { .currency("USD") .expectedReleaseDate(LocalDate.parse("2019-12-27")) .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .type( + AccountActivityRetrieveTransactionResponse.PaymentTransaction.TransferType + .ORIGINATION_CREDIT + ) .userDefinedId("user_defined_id") .build() @@ -1062,6 +1066,10 @@ internal class AccountActivityRetrieveTransactionResponseTest { .currency("USD") .expectedReleaseDate(LocalDate.parse("2019-12-27")) .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .type( + AccountActivityRetrieveTransactionResponse.PaymentTransaction.TransferType + .ORIGINATION_CREDIT + ) .userDefinedId("user_defined_id") .build() ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthenticationRetrieveResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthenticationRetrieveResponseTest.kt index e9f116c8f..cdddd75ba 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthenticationRetrieveResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthenticationRetrieveResponseTest.kt @@ -106,8 +106,17 @@ internal class AuthenticationRetrieveResponseTest { ) .app( AuthenticationRetrieveResponse.App.builder() + .device("device") .deviceInfo("device_info") .ip("ip") + .latitude(-90.0) + .locale("locale") + .longitude(-180.0) + .os("os") + .platform("platform") + .screenHeight(0L) + .screenWidth(0L) + .timeZone("time_zone") .build() ) .authenticationRequestType( @@ -251,8 +260,17 @@ internal class AuthenticationRetrieveResponseTest { assertThat(authenticationRetrieveResponse.app()) .contains( AuthenticationRetrieveResponse.App.builder() + .device("device") .deviceInfo("device_info") .ip("ip") + .latitude(-90.0) + .locale("locale") + .longitude(-180.0) + .os("os") + .platform("platform") + .screenHeight(0L) + .screenWidth(0L) + .timeZone("time_zone") .build() ) assertThat(authenticationRetrieveResponse.authenticationRequestType()) @@ -393,8 +411,17 @@ internal class AuthenticationRetrieveResponseTest { ) .app( AuthenticationRetrieveResponse.App.builder() + .device("device") .deviceInfo("device_info") .ip("ip") + .latitude(-90.0) + .locale("locale") + .longitude(-180.0) + .os("os") + .platform("platform") + .screenHeight(0L) + .screenWidth(0L) + .timeZone("time_zone") .build() ) .authenticationRequestType( diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/WirePartyDetailsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/WirePartyDetailsTest.kt new file mode 100644 index 000000000..f8cd58f3a --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/WirePartyDetailsTest.kt @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.lithic.api.core.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class WirePartyDetailsTest { + + @Test + fun create() { + val wirePartyDetails = + WirePartyDetails.builder() + .accountNumber("account_number") + .agentId("agent_id") + .agentName("agent_name") + .name("name") + .build() + + assertThat(wirePartyDetails.accountNumber()).contains("account_number") + assertThat(wirePartyDetails.agentId()).contains("agent_id") + assertThat(wirePartyDetails.agentName()).contains("agent_name") + assertThat(wirePartyDetails.name()).contains("name") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val wirePartyDetails = + WirePartyDetails.builder() + .accountNumber("account_number") + .agentId("agent_id") + .agentName("agent_name") + .name("name") + .build() + + val roundtrippedWirePartyDetails = + jsonMapper.readValue( + jsonMapper.writeValueAsString(wirePartyDetails), + jacksonTypeRef(), + ) + + assertThat(roundtrippedWirePartyDetails).isEqualTo(wirePartyDetails) + } +}