All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lithic.api.models.LoanTape.kt Maven / Gradle / Ivy

Go to download

The Lithic Developer API is designed to provide a predictable programmatic interface for accessing your Lithic account through an API and transaction webhooks. Note that your API key is a secret and should be treated as such. Don't share it with anyone, including us. We will never ask you for it.

There is a newer version: 0.71.0
Show newest version
// 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.fasterxml.jackson.databind.annotation.JsonDeserialize
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.NoAutoDetect
import com.lithic.api.core.toUnmodifiable
import com.lithic.api.errors.LithicInvalidDataException
import java.time.LocalDate
import java.time.OffsetDateTime
import java.util.Objects
import java.util.Optional

@JsonDeserialize(builder = LoanTape.Builder::class)
@NoAutoDetect
class LoanTape
private constructor(
    private val token: JsonField,
    private val financialAccountToken: JsonField,
    private val date: JsonField,
    private val created: JsonField,
    private val updated: JsonField,
    private val version: JsonField,
    private val ytdTotals: JsonField,
    private val periodTotals: JsonField,
    private val dayTotals: JsonField,
    private val balancePastDue: JsonField,
    private val balanceDue: JsonField,
    private val balanceNextDue: JsonField,
    private val creditLimit: JsonField,
    private val excessCredits: JsonField,
    private val accountStanding: JsonField,
    private val creditProductToken: JsonField,
    private val tier: JsonField,
    private val paymentAllocation: JsonField,
    private val minimumPaymentBalance: JsonField,
    private val previousStatementBalance: JsonField,
    private val additionalProperties: Map,
) {

    private var validated: Boolean = false

    /** Globally unique identifier for a loan tape */
    fun token(): String = token.getRequired("token")

    /** Globally unique identifier for a financial account */
    fun financialAccountToken(): String =
        financialAccountToken.getRequired("financial_account_token")

    /** Date of transactions that this loan tape covers */
    fun date(): LocalDate = date.getRequired("date")

    /** Timestamp of when the loan tape was created */
    fun created(): OffsetDateTime = created.getRequired("created")

    /** Timestamp of when the loan tape was updated */
    fun updated(): OffsetDateTime = updated.getRequired("updated")

    /** Version number of the loan tape. This starts at 1 */
    fun version(): Long = version.getRequired("version")

    fun ytdTotals(): StatementTotals = ytdTotals.getRequired("ytd_totals")

    fun periodTotals(): StatementTotals = periodTotals.getRequired("period_totals")

    fun dayTotals(): StatementTotals = dayTotals.getRequired("day_totals")

    /** Amount not paid off on previous due dates */
    fun balancePastDue(): CategoryBalances = balancePastDue.getRequired("balance_past_due")

    /**
     * Amount due for the prior billing cycle. Any amounts not fully paid off on this due date will
     * be considered past due the next day
     */
    fun balanceDue(): CategoryBalances = balanceDue.getRequired("balance_due")

    /**
     * Amount due for the current billing cycle. Any amounts not paid off by early payments or
     * credits will be considered due at the end of the current billing period
     */
    fun balanceNextDue(): CategoryBalances = balanceNextDue.getRequired("balance_next_due")

    /**
     * For prepay accounts, this is the minimum prepay balance that must be maintained. For charge
     * card accounts, this is the maximum credit balance extended by a lender
     */
    fun creditLimit(): Long = creditLimit.getRequired("credit_limit")

    /**
     * Excess credits in the form of provisional credits, payments, or purchase refunds. If
     * positive, the account is in net credit state with no outstanding balances. An overpayment
     * could land an account in this state
     */
    fun excessCredits(): Long = excessCredits.getRequired("excess_credits")

    fun accountStanding(): AccountStanding = accountStanding.getRequired("account_standing")

    /** Globally unique identifier for a credit product */
    fun creditProductToken(): String = creditProductToken.getRequired("credit_product_token")

    /** Interest tier to which this account belongs to */
    fun tier(): Optional = Optional.ofNullable(tier.getNullable("tier"))

    fun paymentAllocation(): CategoryBalances = paymentAllocation.getRequired("payment_allocation")

    fun minimumPaymentBalance(): BalanceDetails =
        minimumPaymentBalance.getRequired("minimum_payment_balance")

    fun previousStatementBalance(): BalanceDetails =
        previousStatementBalance.getRequired("previous_statement_balance")

    /** Globally unique identifier for a loan tape */
    @JsonProperty("token") @ExcludeMissing fun _token() = token

    /** Globally unique identifier for a financial account */
    @JsonProperty("financial_account_token")
    @ExcludeMissing
    fun _financialAccountToken() = financialAccountToken

    /** Date of transactions that this loan tape covers */
    @JsonProperty("date") @ExcludeMissing fun _date() = date

    /** Timestamp of when the loan tape was created */
    @JsonProperty("created") @ExcludeMissing fun _created() = created

    /** Timestamp of when the loan tape was updated */
    @JsonProperty("updated") @ExcludeMissing fun _updated() = updated

    /** Version number of the loan tape. This starts at 1 */
    @JsonProperty("version") @ExcludeMissing fun _version() = version

    @JsonProperty("ytd_totals") @ExcludeMissing fun _ytdTotals() = ytdTotals

    @JsonProperty("period_totals") @ExcludeMissing fun _periodTotals() = periodTotals

    @JsonProperty("day_totals") @ExcludeMissing fun _dayTotals() = dayTotals

    /** Amount not paid off on previous due dates */
    @JsonProperty("balance_past_due") @ExcludeMissing fun _balancePastDue() = balancePastDue

    /**
     * Amount due for the prior billing cycle. Any amounts not fully paid off on this due date will
     * be considered past due the next day
     */
    @JsonProperty("balance_due") @ExcludeMissing fun _balanceDue() = balanceDue

    /**
     * Amount due for the current billing cycle. Any amounts not paid off by early payments or
     * credits will be considered due at the end of the current billing period
     */
    @JsonProperty("balance_next_due") @ExcludeMissing fun _balanceNextDue() = balanceNextDue

    /**
     * For prepay accounts, this is the minimum prepay balance that must be maintained. For charge
     * card accounts, this is the maximum credit balance extended by a lender
     */
    @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit

    /**
     * Excess credits in the form of provisional credits, payments, or purchase refunds. If
     * positive, the account is in net credit state with no outstanding balances. An overpayment
     * could land an account in this state
     */
    @JsonProperty("excess_credits") @ExcludeMissing fun _excessCredits() = excessCredits

    @JsonProperty("account_standing") @ExcludeMissing fun _accountStanding() = accountStanding

    /** Globally unique identifier for a credit product */
    @JsonProperty("credit_product_token")
    @ExcludeMissing
    fun _creditProductToken() = creditProductToken

    /** Interest tier to which this account belongs to */
    @JsonProperty("tier") @ExcludeMissing fun _tier() = tier

    @JsonProperty("payment_allocation") @ExcludeMissing fun _paymentAllocation() = paymentAllocation

    @JsonProperty("minimum_payment_balance")
    @ExcludeMissing
    fun _minimumPaymentBalance() = minimumPaymentBalance

    @JsonProperty("previous_statement_balance")
    @ExcludeMissing
    fun _previousStatementBalance() = previousStatementBalance

    @JsonAnyGetter
    @ExcludeMissing
    fun _additionalProperties(): Map = additionalProperties

    fun validate(): LoanTape = apply {
        if (!validated) {
            token()
            financialAccountToken()
            date()
            created()
            updated()
            version()
            ytdTotals().validate()
            periodTotals().validate()
            dayTotals().validate()
            balancePastDue().validate()
            balanceDue().validate()
            balanceNextDue().validate()
            creditLimit()
            excessCredits()
            accountStanding().validate()
            creditProductToken()
            tier()
            paymentAllocation().validate()
            minimumPaymentBalance().validate()
            previousStatementBalance().validate()
            validated = true
        }
    }

    fun toBuilder() = Builder().from(this)

    companion object {

        @JvmStatic fun builder() = Builder()
    }

    class Builder {

        private var token: JsonField = JsonMissing.of()
        private var financialAccountToken: JsonField = JsonMissing.of()
        private var date: JsonField = JsonMissing.of()
        private var created: JsonField = JsonMissing.of()
        private var updated: JsonField = JsonMissing.of()
        private var version: JsonField = JsonMissing.of()
        private var ytdTotals: JsonField = JsonMissing.of()
        private var periodTotals: JsonField = JsonMissing.of()
        private var dayTotals: JsonField = JsonMissing.of()
        private var balancePastDue: JsonField = JsonMissing.of()
        private var balanceDue: JsonField = JsonMissing.of()
        private var balanceNextDue: JsonField = JsonMissing.of()
        private var creditLimit: JsonField = JsonMissing.of()
        private var excessCredits: JsonField = JsonMissing.of()
        private var accountStanding: JsonField = JsonMissing.of()
        private var creditProductToken: JsonField = JsonMissing.of()
        private var tier: JsonField = JsonMissing.of()
        private var paymentAllocation: JsonField = JsonMissing.of()
        private var minimumPaymentBalance: JsonField = JsonMissing.of()
        private var previousStatementBalance: JsonField = JsonMissing.of()
        private var additionalProperties: MutableMap = mutableMapOf()

        @JvmSynthetic
        internal fun from(loanTape: LoanTape) = apply {
            this.token = loanTape.token
            this.financialAccountToken = loanTape.financialAccountToken
            this.date = loanTape.date
            this.created = loanTape.created
            this.updated = loanTape.updated
            this.version = loanTape.version
            this.ytdTotals = loanTape.ytdTotals
            this.periodTotals = loanTape.periodTotals
            this.dayTotals = loanTape.dayTotals
            this.balancePastDue = loanTape.balancePastDue
            this.balanceDue = loanTape.balanceDue
            this.balanceNextDue = loanTape.balanceNextDue
            this.creditLimit = loanTape.creditLimit
            this.excessCredits = loanTape.excessCredits
            this.accountStanding = loanTape.accountStanding
            this.creditProductToken = loanTape.creditProductToken
            this.tier = loanTape.tier
            this.paymentAllocation = loanTape.paymentAllocation
            this.minimumPaymentBalance = loanTape.minimumPaymentBalance
            this.previousStatementBalance = loanTape.previousStatementBalance
            additionalProperties(loanTape.additionalProperties)
        }

        /** Globally unique identifier for a loan tape */
        fun token(token: String) = token(JsonField.of(token))

        /** Globally unique identifier for a loan tape */
        @JsonProperty("token")
        @ExcludeMissing
        fun token(token: JsonField) = apply { this.token = token }

        /** Globally unique identifier for a financial account */
        fun financialAccountToken(financialAccountToken: String) =
            financialAccountToken(JsonField.of(financialAccountToken))

        /** Globally unique identifier for a financial account */
        @JsonProperty("financial_account_token")
        @ExcludeMissing
        fun financialAccountToken(financialAccountToken: JsonField) = apply {
            this.financialAccountToken = financialAccountToken
        }

        /** Date of transactions that this loan tape covers */
        fun date(date: LocalDate) = date(JsonField.of(date))

        /** Date of transactions that this loan tape covers */
        @JsonProperty("date")
        @ExcludeMissing
        fun date(date: JsonField) = apply { this.date = date }

        /** Timestamp of when the loan tape was created */
        fun created(created: OffsetDateTime) = created(JsonField.of(created))

        /** Timestamp of when the loan tape was created */
        @JsonProperty("created")
        @ExcludeMissing
        fun created(created: JsonField) = apply { this.created = created }

        /** Timestamp of when the loan tape was updated */
        fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated))

        /** Timestamp of when the loan tape was updated */
        @JsonProperty("updated")
        @ExcludeMissing
        fun updated(updated: JsonField) = apply { this.updated = updated }

        /** Version number of the loan tape. This starts at 1 */
        fun version(version: Long) = version(JsonField.of(version))

        /** Version number of the loan tape. This starts at 1 */
        @JsonProperty("version")
        @ExcludeMissing
        fun version(version: JsonField) = apply { this.version = version }

        fun ytdTotals(ytdTotals: StatementTotals) = ytdTotals(JsonField.of(ytdTotals))

        @JsonProperty("ytd_totals")
        @ExcludeMissing
        fun ytdTotals(ytdTotals: JsonField) = apply { this.ytdTotals = ytdTotals }

        fun periodTotals(periodTotals: StatementTotals) = periodTotals(JsonField.of(periodTotals))

        @JsonProperty("period_totals")
        @ExcludeMissing
        fun periodTotals(periodTotals: JsonField) = apply {
            this.periodTotals = periodTotals
        }

        fun dayTotals(dayTotals: StatementTotals) = dayTotals(JsonField.of(dayTotals))

        @JsonProperty("day_totals")
        @ExcludeMissing
        fun dayTotals(dayTotals: JsonField) = apply { this.dayTotals = dayTotals }

        /** Amount not paid off on previous due dates */
        fun balancePastDue(balancePastDue: CategoryBalances) =
            balancePastDue(JsonField.of(balancePastDue))

        /** Amount not paid off on previous due dates */
        @JsonProperty("balance_past_due")
        @ExcludeMissing
        fun balancePastDue(balancePastDue: JsonField) = apply {
            this.balancePastDue = balancePastDue
        }

        /**
         * Amount due for the prior billing cycle. Any amounts not fully paid off on this due date
         * will be considered past due the next day
         */
        fun balanceDue(balanceDue: CategoryBalances) = balanceDue(JsonField.of(balanceDue))

        /**
         * Amount due for the prior billing cycle. Any amounts not fully paid off on this due date
         * will be considered past due the next day
         */
        @JsonProperty("balance_due")
        @ExcludeMissing
        fun balanceDue(balanceDue: JsonField) = apply {
            this.balanceDue = balanceDue
        }

        /**
         * Amount due for the current billing cycle. Any amounts not paid off by early payments or
         * credits will be considered due at the end of the current billing period
         */
        fun balanceNextDue(balanceNextDue: CategoryBalances) =
            balanceNextDue(JsonField.of(balanceNextDue))

        /**
         * Amount due for the current billing cycle. Any amounts not paid off by early payments or
         * credits will be considered due at the end of the current billing period
         */
        @JsonProperty("balance_next_due")
        @ExcludeMissing
        fun balanceNextDue(balanceNextDue: JsonField) = apply {
            this.balanceNextDue = balanceNextDue
        }

        /**
         * For prepay accounts, this is the minimum prepay balance that must be maintained. For
         * charge card accounts, this is the maximum credit balance extended by a lender
         */
        fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit))

        /**
         * For prepay accounts, this is the minimum prepay balance that must be maintained. For
         * charge card accounts, this is the maximum credit balance extended by a lender
         */
        @JsonProperty("credit_limit")
        @ExcludeMissing
        fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit }

        /**
         * Excess credits in the form of provisional credits, payments, or purchase refunds. If
         * positive, the account is in net credit state with no outstanding balances. An overpayment
         * could land an account in this state
         */
        fun excessCredits(excessCredits: Long) = excessCredits(JsonField.of(excessCredits))

        /**
         * Excess credits in the form of provisional credits, payments, or purchase refunds. If
         * positive, the account is in net credit state with no outstanding balances. An overpayment
         * could land an account in this state
         */
        @JsonProperty("excess_credits")
        @ExcludeMissing
        fun excessCredits(excessCredits: JsonField) = apply {
            this.excessCredits = excessCredits
        }

        fun accountStanding(accountStanding: AccountStanding) =
            accountStanding(JsonField.of(accountStanding))

        @JsonProperty("account_standing")
        @ExcludeMissing
        fun accountStanding(accountStanding: JsonField) = apply {
            this.accountStanding = accountStanding
        }

        /** Globally unique identifier for a credit product */
        fun creditProductToken(creditProductToken: String) =
            creditProductToken(JsonField.of(creditProductToken))

        /** Globally unique identifier for a credit product */
        @JsonProperty("credit_product_token")
        @ExcludeMissing
        fun creditProductToken(creditProductToken: JsonField) = apply {
            this.creditProductToken = creditProductToken
        }

        /** Interest tier to which this account belongs to */
        fun tier(tier: String) = tier(JsonField.of(tier))

        /** Interest tier to which this account belongs to */
        @JsonProperty("tier")
        @ExcludeMissing
        fun tier(tier: JsonField) = apply { this.tier = tier }

        fun paymentAllocation(paymentAllocation: CategoryBalances) =
            paymentAllocation(JsonField.of(paymentAllocation))

        @JsonProperty("payment_allocation")
        @ExcludeMissing
        fun paymentAllocation(paymentAllocation: JsonField) = apply {
            this.paymentAllocation = paymentAllocation
        }

        fun minimumPaymentBalance(minimumPaymentBalance: BalanceDetails) =
            minimumPaymentBalance(JsonField.of(minimumPaymentBalance))

        @JsonProperty("minimum_payment_balance")
        @ExcludeMissing
        fun minimumPaymentBalance(minimumPaymentBalance: JsonField) = apply {
            this.minimumPaymentBalance = minimumPaymentBalance
        }

        fun previousStatementBalance(previousStatementBalance: BalanceDetails) =
            previousStatementBalance(JsonField.of(previousStatementBalance))

        @JsonProperty("previous_statement_balance")
        @ExcludeMissing
        fun previousStatementBalance(previousStatementBalance: JsonField) = apply {
            this.previousStatementBalance = previousStatementBalance
        }

        fun additionalProperties(additionalProperties: Map) = apply {
            this.additionalProperties.clear()
            this.additionalProperties.putAll(additionalProperties)
        }

        @JsonAnySetter
        fun putAdditionalProperty(key: String, value: JsonValue) = apply {
            this.additionalProperties.put(key, value)
        }

        fun putAllAdditionalProperties(additionalProperties: Map) = apply {
            this.additionalProperties.putAll(additionalProperties)
        }

        fun build(): LoanTape =
            LoanTape(
                token,
                financialAccountToken,
                date,
                created,
                updated,
                version,
                ytdTotals,
                periodTotals,
                dayTotals,
                balancePastDue,
                balanceDue,
                balanceNextDue,
                creditLimit,
                excessCredits,
                accountStanding,
                creditProductToken,
                tier,
                paymentAllocation,
                minimumPaymentBalance,
                previousStatementBalance,
                additionalProperties.toUnmodifiable(),
            )
    }

    @JsonDeserialize(builder = AccountStanding.Builder::class)
    @NoAutoDetect
    class AccountStanding
    private constructor(
        private val periodState: JsonField,
        private val periodNumber: JsonField,
        private val consecutiveMinimumPaymentsMade: JsonField,
        private val consecutiveMinimumPaymentsMissed: JsonField,
        private val consecutiveFullPaymentsMade: JsonField,
        private val daysPastDue: JsonField,
        private val hasGrace: JsonField,
        private val additionalProperties: Map,
    ) {

        private var validated: Boolean = false

        fun periodState(): PeriodState = periodState.getRequired("period_state")

        /** Current overall period number */
        fun periodNumber(): Long = periodNumber.getRequired("period_number")

        /** Number of consecutive minimum payments made */
        fun consecutiveMinimumPaymentsMade(): Long =
            consecutiveMinimumPaymentsMade.getRequired("consecutive_minimum_payments_made")

        /** Number of consecutive minimum payments missed */
        fun consecutiveMinimumPaymentsMissed(): Long =
            consecutiveMinimumPaymentsMissed.getRequired("consecutive_minimum_payments_missed")

        /** Number of consecutive full payments made */
        fun consecutiveFullPaymentsMade(): Long =
            consecutiveFullPaymentsMade.getRequired("consecutive_full_payments_made")

        /** Number of days past due */
        fun daysPastDue(): Long = daysPastDue.getRequired("days_past_due")

        /** Whether the account currently has grace or not */
        fun hasGrace(): Boolean = hasGrace.getRequired("has_grace")

        @JsonProperty("period_state") @ExcludeMissing fun _periodState() = periodState

        /** Current overall period number */
        @JsonProperty("period_number") @ExcludeMissing fun _periodNumber() = periodNumber

        /** Number of consecutive minimum payments made */
        @JsonProperty("consecutive_minimum_payments_made")
        @ExcludeMissing
        fun _consecutiveMinimumPaymentsMade() = consecutiveMinimumPaymentsMade

        /** Number of consecutive minimum payments missed */
        @JsonProperty("consecutive_minimum_payments_missed")
        @ExcludeMissing
        fun _consecutiveMinimumPaymentsMissed() = consecutiveMinimumPaymentsMissed

        /** Number of consecutive full payments made */
        @JsonProperty("consecutive_full_payments_made")
        @ExcludeMissing
        fun _consecutiveFullPaymentsMade() = consecutiveFullPaymentsMade

        /** Number of days past due */
        @JsonProperty("days_past_due") @ExcludeMissing fun _daysPastDue() = daysPastDue

        /** Whether the account currently has grace or not */
        @JsonProperty("has_grace") @ExcludeMissing fun _hasGrace() = hasGrace

        @JsonAnyGetter
        @ExcludeMissing
        fun _additionalProperties(): Map = additionalProperties

        fun validate(): AccountStanding = apply {
            if (!validated) {
                periodState()
                periodNumber()
                consecutiveMinimumPaymentsMade()
                consecutiveMinimumPaymentsMissed()
                consecutiveFullPaymentsMade()
                daysPastDue()
                hasGrace()
                validated = true
            }
        }

        fun toBuilder() = Builder().from(this)

        companion object {

            @JvmStatic fun builder() = Builder()
        }

        class Builder {

            private var periodState: JsonField = JsonMissing.of()
            private var periodNumber: JsonField = JsonMissing.of()
            private var consecutiveMinimumPaymentsMade: JsonField = JsonMissing.of()
            private var consecutiveMinimumPaymentsMissed: JsonField = JsonMissing.of()
            private var consecutiveFullPaymentsMade: JsonField = JsonMissing.of()
            private var daysPastDue: JsonField = JsonMissing.of()
            private var hasGrace: JsonField = JsonMissing.of()
            private var additionalProperties: MutableMap = mutableMapOf()

            @JvmSynthetic
            internal fun from(accountStanding: AccountStanding) = apply {
                this.periodState = accountStanding.periodState
                this.periodNumber = accountStanding.periodNumber
                this.consecutiveMinimumPaymentsMade = accountStanding.consecutiveMinimumPaymentsMade
                this.consecutiveMinimumPaymentsMissed =
                    accountStanding.consecutiveMinimumPaymentsMissed
                this.consecutiveFullPaymentsMade = accountStanding.consecutiveFullPaymentsMade
                this.daysPastDue = accountStanding.daysPastDue
                this.hasGrace = accountStanding.hasGrace
                additionalProperties(accountStanding.additionalProperties)
            }

            fun periodState(periodState: PeriodState) = periodState(JsonField.of(periodState))

            @JsonProperty("period_state")
            @ExcludeMissing
            fun periodState(periodState: JsonField) = apply {
                this.periodState = periodState
            }

            /** Current overall period number */
            fun periodNumber(periodNumber: Long) = periodNumber(JsonField.of(periodNumber))

            /** Current overall period number */
            @JsonProperty("period_number")
            @ExcludeMissing
            fun periodNumber(periodNumber: JsonField) = apply {
                this.periodNumber = periodNumber
            }

            /** Number of consecutive minimum payments made */
            fun consecutiveMinimumPaymentsMade(consecutiveMinimumPaymentsMade: Long) =
                consecutiveMinimumPaymentsMade(JsonField.of(consecutiveMinimumPaymentsMade))

            /** Number of consecutive minimum payments made */
            @JsonProperty("consecutive_minimum_payments_made")
            @ExcludeMissing
            fun consecutiveMinimumPaymentsMade(consecutiveMinimumPaymentsMade: JsonField) =
                apply {
                    this.consecutiveMinimumPaymentsMade = consecutiveMinimumPaymentsMade
                }

            /** Number of consecutive minimum payments missed */
            fun consecutiveMinimumPaymentsMissed(consecutiveMinimumPaymentsMissed: Long) =
                consecutiveMinimumPaymentsMissed(JsonField.of(consecutiveMinimumPaymentsMissed))

            /** Number of consecutive minimum payments missed */
            @JsonProperty("consecutive_minimum_payments_missed")
            @ExcludeMissing
            fun consecutiveMinimumPaymentsMissed(
                consecutiveMinimumPaymentsMissed: JsonField
            ) = apply { this.consecutiveMinimumPaymentsMissed = consecutiveMinimumPaymentsMissed }

            /** Number of consecutive full payments made */
            fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: Long) =
                consecutiveFullPaymentsMade(JsonField.of(consecutiveFullPaymentsMade))

            /** Number of consecutive full payments made */
            @JsonProperty("consecutive_full_payments_made")
            @ExcludeMissing
            fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: JsonField) = apply {
                this.consecutiveFullPaymentsMade = consecutiveFullPaymentsMade
            }

            /** Number of days past due */
            fun daysPastDue(daysPastDue: Long) = daysPastDue(JsonField.of(daysPastDue))

            /** Number of days past due */
            @JsonProperty("days_past_due")
            @ExcludeMissing
            fun daysPastDue(daysPastDue: JsonField) = apply { this.daysPastDue = daysPastDue }

            /** Whether the account currently has grace or not */
            fun hasGrace(hasGrace: Boolean) = hasGrace(JsonField.of(hasGrace))

            /** Whether the account currently has grace or not */
            @JsonProperty("has_grace")
            @ExcludeMissing
            fun hasGrace(hasGrace: JsonField) = apply { this.hasGrace = hasGrace }

            fun additionalProperties(additionalProperties: Map) = apply {
                this.additionalProperties.clear()
                this.additionalProperties.putAll(additionalProperties)
            }

            @JsonAnySetter
            fun putAdditionalProperty(key: String, value: JsonValue) = apply {
                this.additionalProperties.put(key, value)
            }

            fun putAllAdditionalProperties(additionalProperties: Map) = apply {
                this.additionalProperties.putAll(additionalProperties)
            }

            fun build(): AccountStanding =
                AccountStanding(
                    periodState,
                    periodNumber,
                    consecutiveMinimumPaymentsMade,
                    consecutiveMinimumPaymentsMissed,
                    consecutiveFullPaymentsMade,
                    daysPastDue,
                    hasGrace,
                    additionalProperties.toUnmodifiable(),
                )
        }

        class PeriodState
        @JsonCreator
        private constructor(
            private val value: JsonField,
        ) : Enum {

            @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value

            override fun equals(other: Any?): Boolean {
                if (this === other) {
                    return true
                }

                return other is PeriodState && this.value == other.value
            }

            override fun hashCode() = value.hashCode()

            override fun toString() = value.toString()

            companion object {

                @JvmField val STANDARD = PeriodState(JsonField.of("STANDARD"))

                @JvmField val PROMO = PeriodState(JsonField.of("PROMO"))

                @JvmField val PENALTY = PeriodState(JsonField.of("PENALTY"))

                @JvmStatic fun of(value: String) = PeriodState(JsonField.of(value))
            }

            enum class Known {
                STANDARD,
                PROMO,
                PENALTY,
            }

            enum class Value {
                STANDARD,
                PROMO,
                PENALTY,
                _UNKNOWN,
            }

            fun value(): Value =
                when (this) {
                    STANDARD -> Value.STANDARD
                    PROMO -> Value.PROMO
                    PENALTY -> Value.PENALTY
                    else -> Value._UNKNOWN
                }

            fun known(): Known =
                when (this) {
                    STANDARD -> Known.STANDARD
                    PROMO -> Known.PROMO
                    PENALTY -> Known.PENALTY
                    else -> throw LithicInvalidDataException("Unknown PeriodState: $value")
                }

            fun asString(): String = _value().asStringOrThrow()
        }

        override fun equals(other: Any?): Boolean {
            if (this === other) {
                return true
            }

            return other is AccountStanding &&
                this.periodState == other.periodState &&
                this.periodNumber == other.periodNumber &&
                this.consecutiveMinimumPaymentsMade == other.consecutiveMinimumPaymentsMade &&
                this.consecutiveMinimumPaymentsMissed == other.consecutiveMinimumPaymentsMissed &&
                this.consecutiveFullPaymentsMade == other.consecutiveFullPaymentsMade &&
                this.daysPastDue == other.daysPastDue &&
                this.hasGrace == other.hasGrace &&
                this.additionalProperties == other.additionalProperties
        }

        private var hashCode: Int = 0

        override fun hashCode(): Int {
            if (hashCode == 0) {
                hashCode =
                    Objects.hash(
                        periodState,
                        periodNumber,
                        consecutiveMinimumPaymentsMade,
                        consecutiveMinimumPaymentsMissed,
                        consecutiveFullPaymentsMade,
                        daysPastDue,
                        hasGrace,
                        additionalProperties,
                    )
            }
            return hashCode
        }

        override fun toString() =
            "AccountStanding{periodState=$periodState, periodNumber=$periodNumber, consecutiveMinimumPaymentsMade=$consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed=$consecutiveMinimumPaymentsMissed, consecutiveFullPaymentsMade=$consecutiveFullPaymentsMade, daysPastDue=$daysPastDue, hasGrace=$hasGrace, additionalProperties=$additionalProperties}"
    }

    /**
     * Amount due for the prior billing cycle. Any amounts not fully paid off on this due date will
     * be considered past due the next day
     */
    @JsonDeserialize(builder = CategoryBalances.Builder::class)
    @NoAutoDetect
    class CategoryBalances
    private constructor(
        private val interest: JsonField,
        private val principal: JsonField,
        private val fees: JsonField,
        private val additionalProperties: Map,
    ) {

        private var validated: Boolean = false

        fun interest(): Long = interest.getRequired("interest")

        fun principal(): Long = principal.getRequired("principal")

        fun fees(): Long = fees.getRequired("fees")

        @JsonProperty("interest") @ExcludeMissing fun _interest() = interest

        @JsonProperty("principal") @ExcludeMissing fun _principal() = principal

        @JsonProperty("fees") @ExcludeMissing fun _fees() = fees

        @JsonAnyGetter
        @ExcludeMissing
        fun _additionalProperties(): Map = additionalProperties

        fun validate(): CategoryBalances = apply {
            if (!validated) {
                interest()
                principal()
                fees()
                validated = true
            }
        }

        fun toBuilder() = Builder().from(this)

        companion object {

            @JvmStatic fun builder() = Builder()
        }

        class Builder {

            private var interest: JsonField = JsonMissing.of()
            private var principal: JsonField = JsonMissing.of()
            private var fees: JsonField = JsonMissing.of()
            private var additionalProperties: MutableMap = mutableMapOf()

            @JvmSynthetic
            internal fun from(categoryBalances: CategoryBalances) = apply {
                this.interest = categoryBalances.interest
                this.principal = categoryBalances.principal
                this.fees = categoryBalances.fees
                additionalProperties(categoryBalances.additionalProperties)
            }

            fun interest(interest: Long) = interest(JsonField.of(interest))

            @JsonProperty("interest")
            @ExcludeMissing
            fun interest(interest: JsonField) = apply { this.interest = interest }

            fun principal(principal: Long) = principal(JsonField.of(principal))

            @JsonProperty("principal")
            @ExcludeMissing
            fun principal(principal: JsonField) = apply { this.principal = principal }

            fun fees(fees: Long) = fees(JsonField.of(fees))

            @JsonProperty("fees")
            @ExcludeMissing
            fun fees(fees: JsonField) = apply { this.fees = fees }

            fun additionalProperties(additionalProperties: Map) = apply {
                this.additionalProperties.clear()
                this.additionalProperties.putAll(additionalProperties)
            }

            @JsonAnySetter
            fun putAdditionalProperty(key: String, value: JsonValue) = apply {
                this.additionalProperties.put(key, value)
            }

            fun putAllAdditionalProperties(additionalProperties: Map) = apply {
                this.additionalProperties.putAll(additionalProperties)
            }

            fun build(): CategoryBalances =
                CategoryBalances(
                    interest,
                    principal,
                    fees,
                    additionalProperties.toUnmodifiable(),
                )
        }

        override fun equals(other: Any?): Boolean {
            if (this === other) {
                return true
            }

            return other is CategoryBalances &&
                this.interest == other.interest &&
                this.principal == other.principal &&
                this.fees == other.fees &&
                this.additionalProperties == other.additionalProperties
        }

        private var hashCode: Int = 0

        override fun hashCode(): Int {
            if (hashCode == 0) {
                hashCode =
                    Objects.hash(
                        interest,
                        principal,
                        fees,
                        additionalProperties,
                    )
            }
            return hashCode
        }

        override fun toString() =
            "CategoryBalances{interest=$interest, principal=$principal, fees=$fees, additionalProperties=$additionalProperties}"
    }

    @JsonDeserialize(builder = StatementTotals.Builder::class)
    @NoAutoDetect
    class StatementTotals
    private constructor(
        private val payments: JsonField,
        private val purchases: JsonField,
        private val fees: JsonField,
        private val credits: JsonField,
        private val interest: JsonField,
        private val cashAdvances: JsonField,
        private val balanceTransfers: JsonField,
        private val additionalProperties: Map,
    ) {

        private var validated: Boolean = false

        /** Any funds transfers which affective the balance in cents */
        fun payments(): Long = payments.getRequired("payments")

        /** Net card transaction volume less any cash advances in cents */
        fun purchases(): Long = purchases.getRequired("purchases")

        /** Volume of debit management operation transactions less any interest in cents */
        fun fees(): Long = fees.getRequired("fees")

        /**
         * Volume of credit management operation transactions less any balance transfers in cents
         */
        fun credits(): Long = credits.getRequired("credits")

        /** Interest accrued in cents */
        fun interest(): Long = interest.getRequired("interest")

        /** ATM and cashback transactions in cents */
        fun cashAdvances(): Long = cashAdvances.getRequired("cash_advances")

        /** Opening balance transferred from previous account in cents */
        fun balanceTransfers(): Long = balanceTransfers.getRequired("balance_transfers")

        /** Any funds transfers which affective the balance in cents */
        @JsonProperty("payments") @ExcludeMissing fun _payments() = payments

        /** Net card transaction volume less any cash advances in cents */
        @JsonProperty("purchases") @ExcludeMissing fun _purchases() = purchases

        /** Volume of debit management operation transactions less any interest in cents */
        @JsonProperty("fees") @ExcludeMissing fun _fees() = fees

        /**
         * Volume of credit management operation transactions less any balance transfers in cents
         */
        @JsonProperty("credits") @ExcludeMissing fun _credits() = credits

        /** Interest accrued in cents */
        @JsonProperty("interest") @ExcludeMissing fun _interest() = interest

        /** ATM and cashback transactions in cents */
        @JsonProperty("cash_advances") @ExcludeMissing fun _cashAdvances() = cashAdvances

        /** Opening balance transferred from previous account in cents */
        @JsonProperty("balance_transfers")
        @ExcludeMissing
        fun _balanceTransfers() = balanceTransfers

        @JsonAnyGetter
        @ExcludeMissing
        fun _additionalProperties(): Map = additionalProperties

        fun validate(): StatementTotals = apply {
            if (!validated) {
                payments()
                purchases()
                fees()
                credits()
                interest()
                cashAdvances()
                balanceTransfers()
                validated = true
            }
        }

        fun toBuilder() = Builder().from(this)

        companion object {

            @JvmStatic fun builder() = Builder()
        }

        class Builder {

            private var payments: JsonField = JsonMissing.of()
            private var purchases: JsonField = JsonMissing.of()
            private var fees: JsonField = JsonMissing.of()
            private var credits: JsonField = JsonMissing.of()
            private var interest: JsonField = JsonMissing.of()
            private var cashAdvances: JsonField = JsonMissing.of()
            private var balanceTransfers: JsonField = JsonMissing.of()
            private var additionalProperties: MutableMap = mutableMapOf()

            @JvmSynthetic
            internal fun from(statementTotals: StatementTotals) = apply {
                this.payments = statementTotals.payments
                this.purchases = statementTotals.purchases
                this.fees = statementTotals.fees
                this.credits = statementTotals.credits
                this.interest = statementTotals.interest
                this.cashAdvances = statementTotals.cashAdvances
                this.balanceTransfers = statementTotals.balanceTransfers
                additionalProperties(statementTotals.additionalProperties)
            }

            /** Any funds transfers which affective the balance in cents */
            fun payments(payments: Long) = payments(JsonField.of(payments))

            /** Any funds transfers which affective the balance in cents */
            @JsonProperty("payments")
            @ExcludeMissing
            fun payments(payments: JsonField) = apply { this.payments = payments }

            /** Net card transaction volume less any cash advances in cents */
            fun purchases(purchases: Long) = purchases(JsonField.of(purchases))

            /** Net card transaction volume less any cash advances in cents */
            @JsonProperty("purchases")
            @ExcludeMissing
            fun purchases(purchases: JsonField) = apply { this.purchases = purchases }

            /** Volume of debit management operation transactions less any interest in cents */
            fun fees(fees: Long) = fees(JsonField.of(fees))

            /** Volume of debit management operation transactions less any interest in cents */
            @JsonProperty("fees")
            @ExcludeMissing
            fun fees(fees: JsonField) = apply { this.fees = fees }

            /**
             * Volume of credit management operation transactions less any balance transfers in
             * cents
             */
            fun credits(credits: Long) = credits(JsonField.of(credits))

            /**
             * Volume of credit management operation transactions less any balance transfers in
             * cents
             */
            @JsonProperty("credits")
            @ExcludeMissing
            fun credits(credits: JsonField) = apply { this.credits = credits }

            /** Interest accrued in cents */
            fun interest(interest: Long) = interest(JsonField.of(interest))

            /** Interest accrued in cents */
            @JsonProperty("interest")
            @ExcludeMissing
            fun interest(interest: JsonField) = apply { this.interest = interest }

            /** ATM and cashback transactions in cents */
            fun cashAdvances(cashAdvances: Long) = cashAdvances(JsonField.of(cashAdvances))

            /** ATM and cashback transactions in cents */
            @JsonProperty("cash_advances")
            @ExcludeMissing
            fun cashAdvances(cashAdvances: JsonField) = apply {
                this.cashAdvances = cashAdvances
            }

            /** Opening balance transferred from previous account in cents */
            fun balanceTransfers(balanceTransfers: Long) =
                balanceTransfers(JsonField.of(balanceTransfers))

            /** Opening balance transferred from previous account in cents */
            @JsonProperty("balance_transfers")
            @ExcludeMissing
            fun balanceTransfers(balanceTransfers: JsonField) = apply {
                this.balanceTransfers = balanceTransfers
            }

            fun additionalProperties(additionalProperties: Map) = apply {
                this.additionalProperties.clear()
                this.additionalProperties.putAll(additionalProperties)
            }

            @JsonAnySetter
            fun putAdditionalProperty(key: String, value: JsonValue) = apply {
                this.additionalProperties.put(key, value)
            }

            fun putAllAdditionalProperties(additionalProperties: Map) = apply {
                this.additionalProperties.putAll(additionalProperties)
            }

            fun build(): StatementTotals =
                StatementTotals(
                    payments,
                    purchases,
                    fees,
                    credits,
                    interest,
                    cashAdvances,
                    balanceTransfers,
                    additionalProperties.toUnmodifiable(),
                )
        }

        override fun equals(other: Any?): Boolean {
            if (this === other) {
                return true
            }

            return other is StatementTotals &&
                this.payments == other.payments &&
                this.purchases == other.purchases &&
                this.fees == other.fees &&
                this.credits == other.credits &&
                this.interest == other.interest &&
                this.cashAdvances == other.cashAdvances &&
                this.balanceTransfers == other.balanceTransfers &&
                this.additionalProperties == other.additionalProperties
        }

        private var hashCode: Int = 0

        override fun hashCode(): Int {
            if (hashCode == 0) {
                hashCode =
                    Objects.hash(
                        payments,
                        purchases,
                        fees,
                        credits,
                        interest,
                        cashAdvances,
                        balanceTransfers,
                        additionalProperties,
                    )
            }
            return hashCode
        }

        override fun toString() =
            "StatementTotals{payments=$payments, purchases=$purchases, fees=$fees, credits=$credits, interest=$interest, cashAdvances=$cashAdvances, balanceTransfers=$balanceTransfers, additionalProperties=$additionalProperties}"
    }

    @JsonDeserialize(builder = BalanceDetails.Builder::class)
    @NoAutoDetect
    class BalanceDetails
    private constructor(
        private val amount: JsonField,
        private val remaining: JsonField,
        private val additionalProperties: Map,
    ) {

        private var validated: Boolean = false

        fun amount(): Long = amount.getRequired("amount")

        fun remaining(): Long = remaining.getRequired("remaining")

        @JsonProperty("amount") @ExcludeMissing fun _amount() = amount

        @JsonProperty("remaining") @ExcludeMissing fun _remaining() = remaining

        @JsonAnyGetter
        @ExcludeMissing
        fun _additionalProperties(): Map = additionalProperties

        fun validate(): BalanceDetails = apply {
            if (!validated) {
                amount()
                remaining()
                validated = true
            }
        }

        fun toBuilder() = Builder().from(this)

        companion object {

            @JvmStatic fun builder() = Builder()
        }

        class Builder {

            private var amount: JsonField = JsonMissing.of()
            private var remaining: JsonField = JsonMissing.of()
            private var additionalProperties: MutableMap = mutableMapOf()

            @JvmSynthetic
            internal fun from(balanceDetails: BalanceDetails) = apply {
                this.amount = balanceDetails.amount
                this.remaining = balanceDetails.remaining
                additionalProperties(balanceDetails.additionalProperties)
            }

            fun amount(amount: Long) = amount(JsonField.of(amount))

            @JsonProperty("amount")
            @ExcludeMissing
            fun amount(amount: JsonField) = apply { this.amount = amount }

            fun remaining(remaining: Long) = remaining(JsonField.of(remaining))

            @JsonProperty("remaining")
            @ExcludeMissing
            fun remaining(remaining: JsonField) = apply { this.remaining = remaining }

            fun additionalProperties(additionalProperties: Map) = apply {
                this.additionalProperties.clear()
                this.additionalProperties.putAll(additionalProperties)
            }

            @JsonAnySetter
            fun putAdditionalProperty(key: String, value: JsonValue) = apply {
                this.additionalProperties.put(key, value)
            }

            fun putAllAdditionalProperties(additionalProperties: Map) = apply {
                this.additionalProperties.putAll(additionalProperties)
            }

            fun build(): BalanceDetails =
                BalanceDetails(
                    amount,
                    remaining,
                    additionalProperties.toUnmodifiable(),
                )
        }

        override fun equals(other: Any?): Boolean {
            if (this === other) {
                return true
            }

            return other is BalanceDetails &&
                this.amount == other.amount &&
                this.remaining == other.remaining &&
                this.additionalProperties == other.additionalProperties
        }

        private var hashCode: Int = 0

        override fun hashCode(): Int {
            if (hashCode == 0) {
                hashCode =
                    Objects.hash(
                        amount,
                        remaining,
                        additionalProperties,
                    )
            }
            return hashCode
        }

        override fun toString() =
            "BalanceDetails{amount=$amount, remaining=$remaining, additionalProperties=$additionalProperties}"
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) {
            return true
        }

        return other is LoanTape &&
            this.token == other.token &&
            this.financialAccountToken == other.financialAccountToken &&
            this.date == other.date &&
            this.created == other.created &&
            this.updated == other.updated &&
            this.version == other.version &&
            this.ytdTotals == other.ytdTotals &&
            this.periodTotals == other.periodTotals &&
            this.dayTotals == other.dayTotals &&
            this.balancePastDue == other.balancePastDue &&
            this.balanceDue == other.balanceDue &&
            this.balanceNextDue == other.balanceNextDue &&
            this.creditLimit == other.creditLimit &&
            this.excessCredits == other.excessCredits &&
            this.accountStanding == other.accountStanding &&
            this.creditProductToken == other.creditProductToken &&
            this.tier == other.tier &&
            this.paymentAllocation == other.paymentAllocation &&
            this.minimumPaymentBalance == other.minimumPaymentBalance &&
            this.previousStatementBalance == other.previousStatementBalance &&
            this.additionalProperties == other.additionalProperties
    }

    private var hashCode: Int = 0

    override fun hashCode(): Int {
        if (hashCode == 0) {
            hashCode =
                Objects.hash(
                    token,
                    financialAccountToken,
                    date,
                    created,
                    updated,
                    version,
                    ytdTotals,
                    periodTotals,
                    dayTotals,
                    balancePastDue,
                    balanceDue,
                    balanceNextDue,
                    creditLimit,
                    excessCredits,
                    accountStanding,
                    creditProductToken,
                    tier,
                    paymentAllocation,
                    minimumPaymentBalance,
                    previousStatementBalance,
                    additionalProperties,
                )
        }
        return hashCode
    }

    override fun toString() =
        "LoanTape{token=$token, financialAccountToken=$financialAccountToken, date=$date, created=$created, updated=$updated, version=$version, ytdTotals=$ytdTotals, periodTotals=$periodTotals, dayTotals=$dayTotals, balancePastDue=$balancePastDue, balanceDue=$balanceDue, balanceNextDue=$balanceNextDue, creditLimit=$creditLimit, excessCredits=$excessCredits, accountStanding=$accountStanding, creditProductToken=$creditProductToken, tier=$tier, paymentAllocation=$paymentAllocation, minimumPaymentBalance=$minimumPaymentBalance, previousStatementBalance=$previousStatementBalance, additionalProperties=$additionalProperties}"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy