// File generated from our OpenAPI spec by Stainless.

package com.increase.api.models.realtimedecisions

import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
import com.increase.api.core.jsonMapper
import java.time.OffsetDateTime
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class RealTimeDecisionTest {

    @Test
    fun create() {
        val realTimeDecision =
            RealTimeDecision.builder()
                .id("real_time_decision_j76n2e810ezcg3zh5qtn")
                .cardAuthentication(
                    RealTimeDecision.CardAuthentication.builder()
                        .accessControlServerTransactionIdentifier(
                            "access_control_server_transaction_identifier"
                        )
                        .accountId("account_id")
                        .billingAddressCity("billing_address_city")
                        .billingAddressCountry("billing_address_country")
                        .billingAddressLine1("billing_address_line1")
                        .billingAddressLine2("billing_address_line2")
                        .billingAddressLine3("billing_address_line3")
                        .billingAddressPostalCode("billing_address_postal_code")
                        .billingAddressState("billing_address_state")
                        .cardId("card_id")
                        .cardholderEmail("cardholder_email")
                        .cardholderName("cardholder_name")
                        .decision(RealTimeDecision.CardAuthentication.Decision.APPROVE)
                        .deviceChannel(
                            RealTimeDecision.CardAuthentication.DeviceChannel.builder()
                                .browser(
                                    RealTimeDecision.CardAuthentication.DeviceChannel.Browser
                                        .builder()
                                        .acceptHeader("accept_header")
                                        .ipAddress("ip_address")
                                        .javascriptEnabled(
                                            RealTimeDecision.CardAuthentication.DeviceChannel
                                                .Browser
                                                .JavascriptEnabled
                                                .ENABLED
                                        )
                                        .language("language")
                                        .userAgent("user_agent")
                                        .build()
                                )
                                .category(
                                    RealTimeDecision.CardAuthentication.DeviceChannel.Category.APP
                                )
                                .merchantInitiated(
                                    RealTimeDecision.CardAuthentication.DeviceChannel
                                        .MerchantInitiated
                                        .builder()
                                        .indicator(
                                            RealTimeDecision.CardAuthentication.DeviceChannel
                                                .MerchantInitiated
                                                .Indicator
                                                .RECURRING_TRANSACTION
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .directoryServerTransactionIdentifier(
                            "directory_server_transaction_identifier"
                        )
                        .merchantAcceptorId("merchant_acceptor_id")
                        .merchantCategoryCode("merchant_category_code")
                        .merchantCountry("merchant_country")
                        .merchantName("merchant_name")
                        .messageCategory(
                            RealTimeDecision.CardAuthentication.MessageCategory.builder()
                                .category(
                                    RealTimeDecision.CardAuthentication.MessageCategory.Category
                                        .PAYMENT_AUTHENTICATION
                                )
                                .nonPayment(
                                    RealTimeDecision.CardAuthentication.MessageCategory.NonPayment
                                        .builder()
                                        .build()
                                )
                                .payment(
                                    RealTimeDecision.CardAuthentication.MessageCategory.Payment
                                        .builder()
                                        .purchaseAmount(0L)
                                        .purchaseAmountCardholderEstimated(0L)
                                        .purchaseCurrency("purchase_currency")
                                        .transactionType(
                                            RealTimeDecision.CardAuthentication.MessageCategory
                                                .Payment
                                                .TransactionType
                                                .GOODS_SERVICE_PURCHASE
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .priorAuthenticatedCardPaymentId("prior_authenticated_card_payment_id")
                        .requestorAuthenticationIndicator(
                            RealTimeDecision.CardAuthentication.RequestorAuthenticationIndicator
                                .PAYMENT_TRANSACTION
                        )
                        .requestorChallengeIndicator(
                            RealTimeDecision.CardAuthentication.RequestorChallengeIndicator
                                .NO_PREFERENCE
                        )
                        .requestorName("requestor_name")
                        .requestorUrl("requestor_url")
                        .shippingAddressCity("shipping_address_city")
                        .shippingAddressCountry("shipping_address_country")
                        .shippingAddressLine1("shipping_address_line1")
                        .shippingAddressLine2("shipping_address_line2")
                        .shippingAddressLine3("shipping_address_line3")
                        .shippingAddressPostalCode("shipping_address_postal_code")
                        .shippingAddressState("shipping_address_state")
                        .threeDSecureServerTransactionIdentifier(
                            "three_d_secure_server_transaction_identifier"
                        )
                        .upcomingCardPaymentId("upcoming_card_payment_id")
                        .build()
                )
                .cardAuthenticationChallenge(
                    RealTimeDecision.CardAuthenticationChallenge.builder()
                        .accountId("account_id")
                        .cardId("card_id")
                        .cardPaymentId("card_payment_id")
                        .oneTimeCode("one_time_code")
                        .result(RealTimeDecision.CardAuthenticationChallenge.Result.SUCCESS)
                        .build()
                )
                .cardAuthorization(
                    RealTimeDecision.CardAuthorization.builder()
                        .accountId("account_in71c4amph0vgo2qllky")
                        .additionalAmounts(
                            RealTimeDecision.CardAuthorization.AdditionalAmounts.builder()
                                .clinic(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Clinic
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .dental(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Dental
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .original(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Original
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .prescription(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts
                                        .Prescription
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .surcharge(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Surcharge
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .totalCumulative(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts
                                        .TotalCumulative
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .totalHealthcare(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts
                                        .TotalHealthcare
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .transit(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Transit
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .unknown(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Unknown
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .vision(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Vision
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .build()
                        )
                        .approval(
                            RealTimeDecision.CardAuthorization.Approval.builder()
                                .partialAmount(0L)
                                .build()
                        )
                        .cardId("card_oubs0hwk5rn6knuecxg2")
                        .decision(RealTimeDecision.CardAuthorization.Decision.APPROVE)
                        .decline(
                            RealTimeDecision.CardAuthorization.Decline.builder()
                                .reason(
                                    RealTimeDecision.CardAuthorization.Decline.Reason
                                        .INSUFFICIENT_FUNDS
                                )
                                .build()
                        )
                        .digitalWalletTokenId(null)
                        .direction(RealTimeDecision.CardAuthorization.Direction.SETTLEMENT)
                        .healthcare(
                            RealTimeDecision.CardAuthorization.Healthcare.builder()
                                .merchantNinetyPercentEligibility(
                                    RealTimeDecision.CardAuthorization.Healthcare
                                        .MerchantNinetyPercentEligibility
                                        .ELIGIBLE
                                )
                                .build()
                        )
                        .merchantAcceptorId("5665270011000168")
                        .merchantCategoryCode("5734")
                        .merchantCity("New York")
                        .merchantCountry("US")
                        .merchantDescriptor("AMAZON.COM")
                        .merchantPostalCode("10045")
                        .merchantState("NY")
                        .networkDetails(
                            RealTimeDecision.CardAuthorization.NetworkDetails.builder()
                                .category(
                                    RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA
                                )
                                .pulse(
                                    RealTimeDecision.CardAuthorization.NetworkDetails.Pulse
                                        .builder()
                                        .build()
                                )
                                .visa(
                                    RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder()
                                        .electronicCommerceIndicator(
                                            RealTimeDecision.CardAuthorization.NetworkDetails.Visa
                                                .ElectronicCommerceIndicator
                                                .SECURE_ELECTRONIC_COMMERCE
                                        )
                                        .pointOfServiceEntryMode(
                                            RealTimeDecision.CardAuthorization.NetworkDetails.Visa
                                                .PointOfServiceEntryMode
                                                .MANUAL
                                        )
                                        .standInProcessingReason(null)
                                        .terminalEntryCapability(
                                            RealTimeDecision.CardAuthorization.NetworkDetails.Visa
                                                .TerminalEntryCapability
                                                .MAGNETIC_STRIPE
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .networkIdentifiers(
                            RealTimeDecision.CardAuthorization.NetworkIdentifiers.builder()
                                .authorizationIdentificationResponse(null)
                                .retrievalReferenceNumber("785867080153")
                                .traceNumber("487941")
                                .transactionId("627199945183184")
                                .build()
                        )
                        .networkRiskScore(10L)
                        .partialApprovalCapability(
                            RealTimeDecision.CardAuthorization.PartialApprovalCapability
                                .NOT_SUPPORTED
                        )
                        .physicalCardId(null)
                        .presentmentAmount(100L)
                        .presentmentCurrency("USD")
                        .processingCategory(
                            RealTimeDecision.CardAuthorization.ProcessingCategory.PURCHASE
                        )
                        .requestDetails(
                            RealTimeDecision.CardAuthorization.RequestDetails.builder()
                                .category(
                                    RealTimeDecision.CardAuthorization.RequestDetails.Category
                                        .INITIAL_AUTHORIZATION
                                )
                                .incrementalAuthorization(
                                    RealTimeDecision.CardAuthorization.RequestDetails
                                        .IncrementalAuthorization
                                        .builder()
                                        .cardPaymentId("card_payment_id")
                                        .originalCardAuthorizationId(
                                            "original_card_authorization_id"
                                        )
                                        .build()
                                )
                                .initialAuthorization(
                                    RealTimeDecision.CardAuthorization.RequestDetails
                                        .InitialAuthorization
                                        .builder()
                                        .build()
                                )
                                .build()
                        )
                        .settlementAmount(100L)
                        .settlementCurrency("USD")
                        .terminalId("RCN5VNXS")
                        .upcomingCardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                        .verification(
                            RealTimeDecision.CardAuthorization.Verification.builder()
                                .cardVerificationCode(
                                    RealTimeDecision.CardAuthorization.Verification
                                        .CardVerificationCode
                                        .builder()
                                        .result(
                                            RealTimeDecision.CardAuthorization.Verification
                                                .CardVerificationCode
                                                .Result
                                                .MATCH
                                        )
                                        .build()
                                )
                                .cardholderAddress(
                                    RealTimeDecision.CardAuthorization.Verification
                                        .CardholderAddress
                                        .builder()
                                        .actualLine1("33 Liberty Street")
                                        .actualPostalCode("94131")
                                        .providedLine1("33 Liberty Street")
                                        .providedPostalCode("94132")
                                        .result(
                                            RealTimeDecision.CardAuthorization.Verification
                                                .CardholderAddress
                                                .Result
                                                .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH
                                        )
                                        .build()
                                )
                                .cardholderName(
                                    RealTimeDecision.CardAuthorization.Verification.CardholderName
                                        .builder()
                                        .providedFirstName("provided_first_name")
                                        .providedLastName("provided_last_name")
                                        .providedMiddleName("provided_middle_name")
                                        .build()
                                )
                                .build()
                        )
                        .build()
                )
                .cardBalanceInquiry(
                    RealTimeDecision.CardBalanceInquiry.builder()
                        .accountId("account_id")
                        .additionalAmounts(
                            RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.builder()
                                .clinic(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Clinic
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .dental(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Dental
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .original(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Original
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .prescription(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts
                                        .Prescription
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .surcharge(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Surcharge
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .totalCumulative(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts
                                        .TotalCumulative
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .totalHealthcare(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts
                                        .TotalHealthcare
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .transit(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Transit
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .unknown(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Unknown
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .vision(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Vision
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .build()
                        )
                        .approval(
                            RealTimeDecision.CardBalanceInquiry.Approval.builder()
                                .balance(0L)
                                .build()
                        )
                        .cardId("card_id")
                        .decision(RealTimeDecision.CardBalanceInquiry.Decision.APPROVE)
                        .digitalWalletTokenId("digital_wallet_token_id")
                        .merchantAcceptorId("merchant_acceptor_id")
                        .merchantCategoryCode("merchant_category_code")
                        .merchantCity("merchant_city")
                        .merchantCountry("merchant_country")
                        .merchantDescriptor("merchant_descriptor")
                        .merchantPostalCode("merchant_postal_code")
                        .merchantState("merchant_state")
                        .networkDetails(
                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.builder()
                                .category(
                                    RealTimeDecision.CardBalanceInquiry.NetworkDetails.Category.VISA
                                )
                                .pulse(
                                    RealTimeDecision.CardBalanceInquiry.NetworkDetails.Pulse
                                        .builder()
                                        .build()
                                )
                                .visa(
                                    RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                        .builder()
                                        .electronicCommerceIndicator(
                                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                                .ElectronicCommerceIndicator
                                                .MAIL_PHONE_ORDER
                                        )
                                        .pointOfServiceEntryMode(
                                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                                .PointOfServiceEntryMode
                                                .UNKNOWN
                                        )
                                        .standInProcessingReason(
                                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                                .StandInProcessingReason
                                                .ISSUER_ERROR
                                        )
                                        .terminalEntryCapability(
                                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                                .TerminalEntryCapability
                                                .UNKNOWN
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .networkIdentifiers(
                            RealTimeDecision.CardBalanceInquiry.NetworkIdentifiers.builder()
                                .authorizationIdentificationResponse(null)
                                .retrievalReferenceNumber("785867080153")
                                .traceNumber("487941")
                                .transactionId("627199945183184")
                                .build()
                        )
                        .networkRiskScore(0L)
                        .physicalCardId("physical_card_id")
                        .terminalId("terminal_id")
                        .upcomingCardPaymentId("upcoming_card_payment_id")
                        .verification(
                            RealTimeDecision.CardBalanceInquiry.Verification.builder()
                                .cardVerificationCode(
                                    RealTimeDecision.CardBalanceInquiry.Verification
                                        .CardVerificationCode
                                        .builder()
                                        .result(
                                            RealTimeDecision.CardBalanceInquiry.Verification
                                                .CardVerificationCode
                                                .Result
                                                .NOT_CHECKED
                                        )
                                        .build()
                                )
                                .cardholderAddress(
                                    RealTimeDecision.CardBalanceInquiry.Verification
                                        .CardholderAddress
                                        .builder()
                                        .actualLine1("actual_line1")
                                        .actualPostalCode("actual_postal_code")
                                        .providedLine1("provided_line1")
                                        .providedPostalCode("provided_postal_code")
                                        .result(
                                            RealTimeDecision.CardBalanceInquiry.Verification
                                                .CardholderAddress
                                                .Result
                                                .NOT_CHECKED
                                        )
                                        .build()
                                )
                                .cardholderName(
                                    RealTimeDecision.CardBalanceInquiry.Verification.CardholderName
                                        .builder()
                                        .providedFirstName("provided_first_name")
                                        .providedLastName("provided_last_name")
                                        .providedMiddleName("provided_middle_name")
                                        .build()
                                )
                                .build()
                        )
                        .build()
                )
                .category(RealTimeDecision.Category.CARD_AUTHORIZATION_REQUESTED)
                .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                .digitalWalletAuthentication(
                    RealTimeDecision.DigitalWalletAuthentication.builder()
                        .cardId("card_id")
                        .channel(RealTimeDecision.DigitalWalletAuthentication.Channel.SMS)
                        .digitalWallet(
                            RealTimeDecision.DigitalWalletAuthentication.DigitalWallet.APPLE_PAY
                        )
                        .email("email")
                        .oneTimePasscode("one_time_passcode")
                        .phone("phone")
                        .result(RealTimeDecision.DigitalWalletAuthentication.Result.SUCCESS)
                        .build()
                )
                .digitalWalletToken(
                    RealTimeDecision.DigitalWalletToken.builder()
                        .cardId("card_id")
                        .decision(RealTimeDecision.DigitalWalletToken.Decision.APPROVE)
                        .device(
                            RealTimeDecision.DigitalWalletToken.Device.builder()
                                .identifier("identifier")
                                .build()
                        )
                        .digitalWallet(RealTimeDecision.DigitalWalletToken.DigitalWallet.APPLE_PAY)
                        .build()
                )
                .status(RealTimeDecision.Status.PENDING)
                .timeoutAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                .type(RealTimeDecision.Type.REAL_TIME_DECISION)
                .build()

        assertThat(realTimeDecision.id()).isEqualTo("real_time_decision_j76n2e810ezcg3zh5qtn")
        assertThat(realTimeDecision.cardAuthentication())
            .contains(
                RealTimeDecision.CardAuthentication.builder()
                    .accessControlServerTransactionIdentifier(
                        "access_control_server_transaction_identifier"
                    )
                    .accountId("account_id")
                    .billingAddressCity("billing_address_city")
                    .billingAddressCountry("billing_address_country")
                    .billingAddressLine1("billing_address_line1")
                    .billingAddressLine2("billing_address_line2")
                    .billingAddressLine3("billing_address_line3")
                    .billingAddressPostalCode("billing_address_postal_code")
                    .billingAddressState("billing_address_state")
                    .cardId("card_id")
                    .cardholderEmail("cardholder_email")
                    .cardholderName("cardholder_name")
                    .decision(RealTimeDecision.CardAuthentication.Decision.APPROVE)
                    .deviceChannel(
                        RealTimeDecision.CardAuthentication.DeviceChannel.builder()
                            .browser(
                                RealTimeDecision.CardAuthentication.DeviceChannel.Browser.builder()
                                    .acceptHeader("accept_header")
                                    .ipAddress("ip_address")
                                    .javascriptEnabled(
                                        RealTimeDecision.CardAuthentication.DeviceChannel.Browser
                                            .JavascriptEnabled
                                            .ENABLED
                                    )
                                    .language("language")
                                    .userAgent("user_agent")
                                    .build()
                            )
                            .category(
                                RealTimeDecision.CardAuthentication.DeviceChannel.Category.APP
                            )
                            .merchantInitiated(
                                RealTimeDecision.CardAuthentication.DeviceChannel.MerchantInitiated
                                    .builder()
                                    .indicator(
                                        RealTimeDecision.CardAuthentication.DeviceChannel
                                            .MerchantInitiated
                                            .Indicator
                                            .RECURRING_TRANSACTION
                                    )
                                    .build()
                            )
                            .build()
                    )
                    .directoryServerTransactionIdentifier("directory_server_transaction_identifier")
                    .merchantAcceptorId("merchant_acceptor_id")
                    .merchantCategoryCode("merchant_category_code")
                    .merchantCountry("merchant_country")
                    .merchantName("merchant_name")
                    .messageCategory(
                        RealTimeDecision.CardAuthentication.MessageCategory.builder()
                            .category(
                                RealTimeDecision.CardAuthentication.MessageCategory.Category
                                    .PAYMENT_AUTHENTICATION
                            )
                            .nonPayment(
                                RealTimeDecision.CardAuthentication.MessageCategory.NonPayment
                                    .builder()
                                    .build()
                            )
                            .payment(
                                RealTimeDecision.CardAuthentication.MessageCategory.Payment
                                    .builder()
                                    .purchaseAmount(0L)
                                    .purchaseAmountCardholderEstimated(0L)
                                    .purchaseCurrency("purchase_currency")
                                    .transactionType(
                                        RealTimeDecision.CardAuthentication.MessageCategory.Payment
                                            .TransactionType
                                            .GOODS_SERVICE_PURCHASE
                                    )
                                    .build()
                            )
                            .build()
                    )
                    .priorAuthenticatedCardPaymentId("prior_authenticated_card_payment_id")
                    .requestorAuthenticationIndicator(
                        RealTimeDecision.CardAuthentication.RequestorAuthenticationIndicator
                            .PAYMENT_TRANSACTION
                    )
                    .requestorChallengeIndicator(
                        RealTimeDecision.CardAuthentication.RequestorChallengeIndicator
                            .NO_PREFERENCE
                    )
                    .requestorName("requestor_name")
                    .requestorUrl("requestor_url")
                    .shippingAddressCity("shipping_address_city")
                    .shippingAddressCountry("shipping_address_country")
                    .shippingAddressLine1("shipping_address_line1")
                    .shippingAddressLine2("shipping_address_line2")
                    .shippingAddressLine3("shipping_address_line3")
                    .shippingAddressPostalCode("shipping_address_postal_code")
                    .shippingAddressState("shipping_address_state")
                    .threeDSecureServerTransactionIdentifier(
                        "three_d_secure_server_transaction_identifier"
                    )
                    .upcomingCardPaymentId("upcoming_card_payment_id")
                    .build()
            )
        assertThat(realTimeDecision.cardAuthenticationChallenge())
            .contains(
                RealTimeDecision.CardAuthenticationChallenge.builder()
                    .accountId("account_id")
                    .cardId("card_id")
                    .cardPaymentId("card_payment_id")
                    .oneTimeCode("one_time_code")
                    .result(RealTimeDecision.CardAuthenticationChallenge.Result.SUCCESS)
                    .build()
            )
        assertThat(realTimeDecision.cardAuthorization())
            .contains(
                RealTimeDecision.CardAuthorization.builder()
                    .accountId("account_in71c4amph0vgo2qllky")
                    .additionalAmounts(
                        RealTimeDecision.CardAuthorization.AdditionalAmounts.builder()
                            .clinic(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.Clinic
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .dental(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.Dental
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .original(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.Original
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .prescription(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.Prescription
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .surcharge(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.Surcharge
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .totalCumulative(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.TotalCumulative
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .totalHealthcare(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.TotalHealthcare
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .transit(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.Transit
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .unknown(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.Unknown
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .vision(
                                RealTimeDecision.CardAuthorization.AdditionalAmounts.Vision
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .build()
                    )
                    .approval(
                        RealTimeDecision.CardAuthorization.Approval.builder()
                            .partialAmount(0L)
                            .build()
                    )
                    .cardId("card_oubs0hwk5rn6knuecxg2")
                    .decision(RealTimeDecision.CardAuthorization.Decision.APPROVE)
                    .decline(
                        RealTimeDecision.CardAuthorization.Decline.builder()
                            .reason(
                                RealTimeDecision.CardAuthorization.Decline.Reason.INSUFFICIENT_FUNDS
                            )
                            .build()
                    )
                    .digitalWalletTokenId(null)
                    .direction(RealTimeDecision.CardAuthorization.Direction.SETTLEMENT)
                    .healthcare(
                        RealTimeDecision.CardAuthorization.Healthcare.builder()
                            .merchantNinetyPercentEligibility(
                                RealTimeDecision.CardAuthorization.Healthcare
                                    .MerchantNinetyPercentEligibility
                                    .ELIGIBLE
                            )
                            .build()
                    )
                    .merchantAcceptorId("5665270011000168")
                    .merchantCategoryCode("5734")
                    .merchantCity("New York")
                    .merchantCountry("US")
                    .merchantDescriptor("AMAZON.COM")
                    .merchantPostalCode("10045")
                    .merchantState("NY")
                    .networkDetails(
                        RealTimeDecision.CardAuthorization.NetworkDetails.builder()
                            .category(
                                RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA
                            )
                            .pulse(
                                RealTimeDecision.CardAuthorization.NetworkDetails.Pulse.builder()
                                    .build()
                            )
                            .visa(
                                RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder()
                                    .electronicCommerceIndicator(
                                        RealTimeDecision.CardAuthorization.NetworkDetails.Visa
                                            .ElectronicCommerceIndicator
                                            .SECURE_ELECTRONIC_COMMERCE
                                    )
                                    .pointOfServiceEntryMode(
                                        RealTimeDecision.CardAuthorization.NetworkDetails.Visa
                                            .PointOfServiceEntryMode
                                            .MANUAL
                                    )
                                    .standInProcessingReason(null)
                                    .terminalEntryCapability(
                                        RealTimeDecision.CardAuthorization.NetworkDetails.Visa
                                            .TerminalEntryCapability
                                            .MAGNETIC_STRIPE
                                    )
                                    .build()
                            )
                            .build()
                    )
                    .networkIdentifiers(
                        RealTimeDecision.CardAuthorization.NetworkIdentifiers.builder()
                            .authorizationIdentificationResponse(null)
                            .retrievalReferenceNumber("785867080153")
                            .traceNumber("487941")
                            .transactionId("627199945183184")
                            .build()
                    )
                    .networkRiskScore(10L)
                    .partialApprovalCapability(
                        RealTimeDecision.CardAuthorization.PartialApprovalCapability.NOT_SUPPORTED
                    )
                    .physicalCardId(null)
                    .presentmentAmount(100L)
                    .presentmentCurrency("USD")
                    .processingCategory(
                        RealTimeDecision.CardAuthorization.ProcessingCategory.PURCHASE
                    )
                    .requestDetails(
                        RealTimeDecision.CardAuthorization.RequestDetails.builder()
                            .category(
                                RealTimeDecision.CardAuthorization.RequestDetails.Category
                                    .INITIAL_AUTHORIZATION
                            )
                            .incrementalAuthorization(
                                RealTimeDecision.CardAuthorization.RequestDetails
                                    .IncrementalAuthorization
                                    .builder()
                                    .cardPaymentId("card_payment_id")
                                    .originalCardAuthorizationId("original_card_authorization_id")
                                    .build()
                            )
                            .initialAuthorization(
                                RealTimeDecision.CardAuthorization.RequestDetails
                                    .InitialAuthorization
                                    .builder()
                                    .build()
                            )
                            .build()
                    )
                    .settlementAmount(100L)
                    .settlementCurrency("USD")
                    .terminalId("RCN5VNXS")
                    .upcomingCardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                    .verification(
                        RealTimeDecision.CardAuthorization.Verification.builder()
                            .cardVerificationCode(
                                RealTimeDecision.CardAuthorization.Verification.CardVerificationCode
                                    .builder()
                                    .result(
                                        RealTimeDecision.CardAuthorization.Verification
                                            .CardVerificationCode
                                            .Result
                                            .MATCH
                                    )
                                    .build()
                            )
                            .cardholderAddress(
                                RealTimeDecision.CardAuthorization.Verification.CardholderAddress
                                    .builder()
                                    .actualLine1("33 Liberty Street")
                                    .actualPostalCode("94131")
                                    .providedLine1("33 Liberty Street")
                                    .providedPostalCode("94132")
                                    .result(
                                        RealTimeDecision.CardAuthorization.Verification
                                            .CardholderAddress
                                            .Result
                                            .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH
                                    )
                                    .build()
                            )
                            .cardholderName(
                                RealTimeDecision.CardAuthorization.Verification.CardholderName
                                    .builder()
                                    .providedFirstName("provided_first_name")
                                    .providedLastName("provided_last_name")
                                    .providedMiddleName("provided_middle_name")
                                    .build()
                            )
                            .build()
                    )
                    .build()
            )
        assertThat(realTimeDecision.cardBalanceInquiry())
            .contains(
                RealTimeDecision.CardBalanceInquiry.builder()
                    .accountId("account_id")
                    .additionalAmounts(
                        RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.builder()
                            .clinic(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Clinic
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .dental(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Dental
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .original(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Original
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .prescription(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Prescription
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .surcharge(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Surcharge
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .totalCumulative(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts
                                    .TotalCumulative
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .totalHealthcare(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts
                                    .TotalHealthcare
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .transit(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Transit
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .unknown(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Unknown
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .vision(
                                RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Vision
                                    .builder()
                                    .amount(0L)
                                    .currency("currency")
                                    .build()
                            )
                            .build()
                    )
                    .approval(
                        RealTimeDecision.CardBalanceInquiry.Approval.builder().balance(0L).build()
                    )
                    .cardId("card_id")
                    .decision(RealTimeDecision.CardBalanceInquiry.Decision.APPROVE)
                    .digitalWalletTokenId("digital_wallet_token_id")
                    .merchantAcceptorId("merchant_acceptor_id")
                    .merchantCategoryCode("merchant_category_code")
                    .merchantCity("merchant_city")
                    .merchantCountry("merchant_country")
                    .merchantDescriptor("merchant_descriptor")
                    .merchantPostalCode("merchant_postal_code")
                    .merchantState("merchant_state")
                    .networkDetails(
                        RealTimeDecision.CardBalanceInquiry.NetworkDetails.builder()
                            .category(
                                RealTimeDecision.CardBalanceInquiry.NetworkDetails.Category.VISA
                            )
                            .pulse(
                                RealTimeDecision.CardBalanceInquiry.NetworkDetails.Pulse.builder()
                                    .build()
                            )
                            .visa(
                                RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa.builder()
                                    .electronicCommerceIndicator(
                                        RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                            .ElectronicCommerceIndicator
                                            .MAIL_PHONE_ORDER
                                    )
                                    .pointOfServiceEntryMode(
                                        RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                            .PointOfServiceEntryMode
                                            .UNKNOWN
                                    )
                                    .standInProcessingReason(
                                        RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                            .StandInProcessingReason
                                            .ISSUER_ERROR
                                    )
                                    .terminalEntryCapability(
                                        RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                            .TerminalEntryCapability
                                            .UNKNOWN
                                    )
                                    .build()
                            )
                            .build()
                    )
                    .networkIdentifiers(
                        RealTimeDecision.CardBalanceInquiry.NetworkIdentifiers.builder()
                            .authorizationIdentificationResponse(null)
                            .retrievalReferenceNumber("785867080153")
                            .traceNumber("487941")
                            .transactionId("627199945183184")
                            .build()
                    )
                    .networkRiskScore(0L)
                    .physicalCardId("physical_card_id")
                    .terminalId("terminal_id")
                    .upcomingCardPaymentId("upcoming_card_payment_id")
                    .verification(
                        RealTimeDecision.CardBalanceInquiry.Verification.builder()
                            .cardVerificationCode(
                                RealTimeDecision.CardBalanceInquiry.Verification
                                    .CardVerificationCode
                                    .builder()
                                    .result(
                                        RealTimeDecision.CardBalanceInquiry.Verification
                                            .CardVerificationCode
                                            .Result
                                            .NOT_CHECKED
                                    )
                                    .build()
                            )
                            .cardholderAddress(
                                RealTimeDecision.CardBalanceInquiry.Verification.CardholderAddress
                                    .builder()
                                    .actualLine1("actual_line1")
                                    .actualPostalCode("actual_postal_code")
                                    .providedLine1("provided_line1")
                                    .providedPostalCode("provided_postal_code")
                                    .result(
                                        RealTimeDecision.CardBalanceInquiry.Verification
                                            .CardholderAddress
                                            .Result
                                            .NOT_CHECKED
                                    )
                                    .build()
                            )
                            .cardholderName(
                                RealTimeDecision.CardBalanceInquiry.Verification.CardholderName
                                    .builder()
                                    .providedFirstName("provided_first_name")
                                    .providedLastName("provided_last_name")
                                    .providedMiddleName("provided_middle_name")
                                    .build()
                            )
                            .build()
                    )
                    .build()
            )
        assertThat(realTimeDecision.category())
            .isEqualTo(RealTimeDecision.Category.CARD_AUTHORIZATION_REQUESTED)
        assertThat(realTimeDecision.createdAt())
            .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
        assertThat(realTimeDecision.digitalWalletAuthentication())
            .contains(
                RealTimeDecision.DigitalWalletAuthentication.builder()
                    .cardId("card_id")
                    .channel(RealTimeDecision.DigitalWalletAuthentication.Channel.SMS)
                    .digitalWallet(
                        RealTimeDecision.DigitalWalletAuthentication.DigitalWallet.APPLE_PAY
                    )
                    .email("email")
                    .oneTimePasscode("one_time_passcode")
                    .phone("phone")
                    .result(RealTimeDecision.DigitalWalletAuthentication.Result.SUCCESS)
                    .build()
            )
        assertThat(realTimeDecision.digitalWalletToken())
            .contains(
                RealTimeDecision.DigitalWalletToken.builder()
                    .cardId("card_id")
                    .decision(RealTimeDecision.DigitalWalletToken.Decision.APPROVE)
                    .device(
                        RealTimeDecision.DigitalWalletToken.Device.builder()
                            .identifier("identifier")
                            .build()
                    )
                    .digitalWallet(RealTimeDecision.DigitalWalletToken.DigitalWallet.APPLE_PAY)
                    .build()
            )
        assertThat(realTimeDecision.status()).isEqualTo(RealTimeDecision.Status.PENDING)
        assertThat(realTimeDecision.timeoutAt())
            .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
        assertThat(realTimeDecision.type()).isEqualTo(RealTimeDecision.Type.REAL_TIME_DECISION)
    }

    @Test
    fun roundtrip() {
        val jsonMapper = jsonMapper()
        val realTimeDecision =
            RealTimeDecision.builder()
                .id("real_time_decision_j76n2e810ezcg3zh5qtn")
                .cardAuthentication(
                    RealTimeDecision.CardAuthentication.builder()
                        .accessControlServerTransactionIdentifier(
                            "access_control_server_transaction_identifier"
                        )
                        .accountId("account_id")
                        .billingAddressCity("billing_address_city")
                        .billingAddressCountry("billing_address_country")
                        .billingAddressLine1("billing_address_line1")
                        .billingAddressLine2("billing_address_line2")
                        .billingAddressLine3("billing_address_line3")
                        .billingAddressPostalCode("billing_address_postal_code")
                        .billingAddressState("billing_address_state")
                        .cardId("card_id")
                        .cardholderEmail("cardholder_email")
                        .cardholderName("cardholder_name")
                        .decision(RealTimeDecision.CardAuthentication.Decision.APPROVE)
                        .deviceChannel(
                            RealTimeDecision.CardAuthentication.DeviceChannel.builder()
                                .browser(
                                    RealTimeDecision.CardAuthentication.DeviceChannel.Browser
                                        .builder()
                                        .acceptHeader("accept_header")
                                        .ipAddress("ip_address")
                                        .javascriptEnabled(
                                            RealTimeDecision.CardAuthentication.DeviceChannel
                                                .Browser
                                                .JavascriptEnabled
                                                .ENABLED
                                        )
                                        .language("language")
                                        .userAgent("user_agent")
                                        .build()
                                )
                                .category(
                                    RealTimeDecision.CardAuthentication.DeviceChannel.Category.APP
                                )
                                .merchantInitiated(
                                    RealTimeDecision.CardAuthentication.DeviceChannel
                                        .MerchantInitiated
                                        .builder()
                                        .indicator(
                                            RealTimeDecision.CardAuthentication.DeviceChannel
                                                .MerchantInitiated
                                                .Indicator
                                                .RECURRING_TRANSACTION
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .directoryServerTransactionIdentifier(
                            "directory_server_transaction_identifier"
                        )
                        .merchantAcceptorId("merchant_acceptor_id")
                        .merchantCategoryCode("merchant_category_code")
                        .merchantCountry("merchant_country")
                        .merchantName("merchant_name")
                        .messageCategory(
                            RealTimeDecision.CardAuthentication.MessageCategory.builder()
                                .category(
                                    RealTimeDecision.CardAuthentication.MessageCategory.Category
                                        .PAYMENT_AUTHENTICATION
                                )
                                .nonPayment(
                                    RealTimeDecision.CardAuthentication.MessageCategory.NonPayment
                                        .builder()
                                        .build()
                                )
                                .payment(
                                    RealTimeDecision.CardAuthentication.MessageCategory.Payment
                                        .builder()
                                        .purchaseAmount(0L)
                                        .purchaseAmountCardholderEstimated(0L)
                                        .purchaseCurrency("purchase_currency")
                                        .transactionType(
                                            RealTimeDecision.CardAuthentication.MessageCategory
                                                .Payment
                                                .TransactionType
                                                .GOODS_SERVICE_PURCHASE
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .priorAuthenticatedCardPaymentId("prior_authenticated_card_payment_id")
                        .requestorAuthenticationIndicator(
                            RealTimeDecision.CardAuthentication.RequestorAuthenticationIndicator
                                .PAYMENT_TRANSACTION
                        )
                        .requestorChallengeIndicator(
                            RealTimeDecision.CardAuthentication.RequestorChallengeIndicator
                                .NO_PREFERENCE
                        )
                        .requestorName("requestor_name")
                        .requestorUrl("requestor_url")
                        .shippingAddressCity("shipping_address_city")
                        .shippingAddressCountry("shipping_address_country")
                        .shippingAddressLine1("shipping_address_line1")
                        .shippingAddressLine2("shipping_address_line2")
                        .shippingAddressLine3("shipping_address_line3")
                        .shippingAddressPostalCode("shipping_address_postal_code")
                        .shippingAddressState("shipping_address_state")
                        .threeDSecureServerTransactionIdentifier(
                            "three_d_secure_server_transaction_identifier"
                        )
                        .upcomingCardPaymentId("upcoming_card_payment_id")
                        .build()
                )
                .cardAuthenticationChallenge(
                    RealTimeDecision.CardAuthenticationChallenge.builder()
                        .accountId("account_id")
                        .cardId("card_id")
                        .cardPaymentId("card_payment_id")
                        .oneTimeCode("one_time_code")
                        .result(RealTimeDecision.CardAuthenticationChallenge.Result.SUCCESS)
                        .build()
                )
                .cardAuthorization(
                    RealTimeDecision.CardAuthorization.builder()
                        .accountId("account_in71c4amph0vgo2qllky")
                        .additionalAmounts(
                            RealTimeDecision.CardAuthorization.AdditionalAmounts.builder()
                                .clinic(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Clinic
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .dental(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Dental
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .original(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Original
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .prescription(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts
                                        .Prescription
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .surcharge(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Surcharge
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .totalCumulative(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts
                                        .TotalCumulative
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .totalHealthcare(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts
                                        .TotalHealthcare
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .transit(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Transit
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .unknown(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Unknown
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .vision(
                                    RealTimeDecision.CardAuthorization.AdditionalAmounts.Vision
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .build()
                        )
                        .approval(
                            RealTimeDecision.CardAuthorization.Approval.builder()
                                .partialAmount(0L)
                                .build()
                        )
                        .cardId("card_oubs0hwk5rn6knuecxg2")
                        .decision(RealTimeDecision.CardAuthorization.Decision.APPROVE)
                        .decline(
                            RealTimeDecision.CardAuthorization.Decline.builder()
                                .reason(
                                    RealTimeDecision.CardAuthorization.Decline.Reason
                                        .INSUFFICIENT_FUNDS
                                )
                                .build()
                        )
                        .digitalWalletTokenId(null)
                        .direction(RealTimeDecision.CardAuthorization.Direction.SETTLEMENT)
                        .healthcare(
                            RealTimeDecision.CardAuthorization.Healthcare.builder()
                                .merchantNinetyPercentEligibility(
                                    RealTimeDecision.CardAuthorization.Healthcare
                                        .MerchantNinetyPercentEligibility
                                        .ELIGIBLE
                                )
                                .build()
                        )
                        .merchantAcceptorId("5665270011000168")
                        .merchantCategoryCode("5734")
                        .merchantCity("New York")
                        .merchantCountry("US")
                        .merchantDescriptor("AMAZON.COM")
                        .merchantPostalCode("10045")
                        .merchantState("NY")
                        .networkDetails(
                            RealTimeDecision.CardAuthorization.NetworkDetails.builder()
                                .category(
                                    RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA
                                )
                                .pulse(
                                    RealTimeDecision.CardAuthorization.NetworkDetails.Pulse
                                        .builder()
                                        .build()
                                )
                                .visa(
                                    RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder()
                                        .electronicCommerceIndicator(
                                            RealTimeDecision.CardAuthorization.NetworkDetails.Visa
                                                .ElectronicCommerceIndicator
                                                .SECURE_ELECTRONIC_COMMERCE
                                        )
                                        .pointOfServiceEntryMode(
                                            RealTimeDecision.CardAuthorization.NetworkDetails.Visa
                                                .PointOfServiceEntryMode
                                                .MANUAL
                                        )
                                        .standInProcessingReason(null)
                                        .terminalEntryCapability(
                                            RealTimeDecision.CardAuthorization.NetworkDetails.Visa
                                                .TerminalEntryCapability
                                                .MAGNETIC_STRIPE
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .networkIdentifiers(
                            RealTimeDecision.CardAuthorization.NetworkIdentifiers.builder()
                                .authorizationIdentificationResponse(null)
                                .retrievalReferenceNumber("785867080153")
                                .traceNumber("487941")
                                .transactionId("627199945183184")
                                .build()
                        )
                        .networkRiskScore(10L)
                        .partialApprovalCapability(
                            RealTimeDecision.CardAuthorization.PartialApprovalCapability
                                .NOT_SUPPORTED
                        )
                        .physicalCardId(null)
                        .presentmentAmount(100L)
                        .presentmentCurrency("USD")
                        .processingCategory(
                            RealTimeDecision.CardAuthorization.ProcessingCategory.PURCHASE
                        )
                        .requestDetails(
                            RealTimeDecision.CardAuthorization.RequestDetails.builder()
                                .category(
                                    RealTimeDecision.CardAuthorization.RequestDetails.Category
                                        .INITIAL_AUTHORIZATION
                                )
                                .incrementalAuthorization(
                                    RealTimeDecision.CardAuthorization.RequestDetails
                                        .IncrementalAuthorization
                                        .builder()
                                        .cardPaymentId("card_payment_id")
                                        .originalCardAuthorizationId(
                                            "original_card_authorization_id"
                                        )
                                        .build()
                                )
                                .initialAuthorization(
                                    RealTimeDecision.CardAuthorization.RequestDetails
                                        .InitialAuthorization
                                        .builder()
                                        .build()
                                )
                                .build()
                        )
                        .settlementAmount(100L)
                        .settlementCurrency("USD")
                        .terminalId("RCN5VNXS")
                        .upcomingCardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                        .verification(
                            RealTimeDecision.CardAuthorization.Verification.builder()
                                .cardVerificationCode(
                                    RealTimeDecision.CardAuthorization.Verification
                                        .CardVerificationCode
                                        .builder()
                                        .result(
                                            RealTimeDecision.CardAuthorization.Verification
                                                .CardVerificationCode
                                                .Result
                                                .MATCH
                                        )
                                        .build()
                                )
                                .cardholderAddress(
                                    RealTimeDecision.CardAuthorization.Verification
                                        .CardholderAddress
                                        .builder()
                                        .actualLine1("33 Liberty Street")
                                        .actualPostalCode("94131")
                                        .providedLine1("33 Liberty Street")
                                        .providedPostalCode("94132")
                                        .result(
                                            RealTimeDecision.CardAuthorization.Verification
                                                .CardholderAddress
                                                .Result
                                                .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH
                                        )
                                        .build()
                                )
                                .cardholderName(
                                    RealTimeDecision.CardAuthorization.Verification.CardholderName
                                        .builder()
                                        .providedFirstName("provided_first_name")
                                        .providedLastName("provided_last_name")
                                        .providedMiddleName("provided_middle_name")
                                        .build()
                                )
                                .build()
                        )
                        .build()
                )
                .cardBalanceInquiry(
                    RealTimeDecision.CardBalanceInquiry.builder()
                        .accountId("account_id")
                        .additionalAmounts(
                            RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.builder()
                                .clinic(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Clinic
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .dental(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Dental
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .original(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Original
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .prescription(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts
                                        .Prescription
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .surcharge(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Surcharge
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .totalCumulative(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts
                                        .TotalCumulative
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .totalHealthcare(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts
                                        .TotalHealthcare
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .transit(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Transit
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .unknown(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Unknown
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .vision(
                                    RealTimeDecision.CardBalanceInquiry.AdditionalAmounts.Vision
                                        .builder()
                                        .amount(0L)
                                        .currency("currency")
                                        .build()
                                )
                                .build()
                        )
                        .approval(
                            RealTimeDecision.CardBalanceInquiry.Approval.builder()
                                .balance(0L)
                                .build()
                        )
                        .cardId("card_id")
                        .decision(RealTimeDecision.CardBalanceInquiry.Decision.APPROVE)
                        .digitalWalletTokenId("digital_wallet_token_id")
                        .merchantAcceptorId("merchant_acceptor_id")
                        .merchantCategoryCode("merchant_category_code")
                        .merchantCity("merchant_city")
                        .merchantCountry("merchant_country")
                        .merchantDescriptor("merchant_descriptor")
                        .merchantPostalCode("merchant_postal_code")
                        .merchantState("merchant_state")
                        .networkDetails(
                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.builder()
                                .category(
                                    RealTimeDecision.CardBalanceInquiry.NetworkDetails.Category.VISA
                                )
                                .pulse(
                                    RealTimeDecision.CardBalanceInquiry.NetworkDetails.Pulse
                                        .builder()
                                        .build()
                                )
                                .visa(
                                    RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                        .builder()
                                        .electronicCommerceIndicator(
                                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                                .ElectronicCommerceIndicator
                                                .MAIL_PHONE_ORDER
                                        )
                                        .pointOfServiceEntryMode(
                                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                                .PointOfServiceEntryMode
                                                .UNKNOWN
                                        )
                                        .standInProcessingReason(
                                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                                .StandInProcessingReason
                                                .ISSUER_ERROR
                                        )
                                        .terminalEntryCapability(
                                            RealTimeDecision.CardBalanceInquiry.NetworkDetails.Visa
                                                .TerminalEntryCapability
                                                .UNKNOWN
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .networkIdentifiers(
                            RealTimeDecision.CardBalanceInquiry.NetworkIdentifiers.builder()
                                .authorizationIdentificationResponse(null)
                                .retrievalReferenceNumber("785867080153")
                                .traceNumber("487941")
                                .transactionId("627199945183184")
                                .build()
                        )
                        .networkRiskScore(0L)
                        .physicalCardId("physical_card_id")
                        .terminalId("terminal_id")
                        .upcomingCardPaymentId("upcoming_card_payment_id")
                        .verification(
                            RealTimeDecision.CardBalanceInquiry.Verification.builder()
                                .cardVerificationCode(
                                    RealTimeDecision.CardBalanceInquiry.Verification
                                        .CardVerificationCode
                                        .builder()
                                        .result(
                                            RealTimeDecision.CardBalanceInquiry.Verification
                                                .CardVerificationCode
                                                .Result
                                                .NOT_CHECKED
                                        )
                                        .build()
                                )
                                .cardholderAddress(
                                    RealTimeDecision.CardBalanceInquiry.Verification
                                        .CardholderAddress
                                        .builder()
                                        .actualLine1("actual_line1")
                                        .actualPostalCode("actual_postal_code")
                                        .providedLine1("provided_line1")
                                        .providedPostalCode("provided_postal_code")
                                        .result(
                                            RealTimeDecision.CardBalanceInquiry.Verification
                                                .CardholderAddress
                                                .Result
                                                .NOT_CHECKED
                                        )
                                        .build()
                                )
                                .cardholderName(
                                    RealTimeDecision.CardBalanceInquiry.Verification.CardholderName
                                        .builder()
                                        .providedFirstName("provided_first_name")
                                        .providedLastName("provided_last_name")
                                        .providedMiddleName("provided_middle_name")
                                        .build()
                                )
                                .build()
                        )
                        .build()
                )
                .category(RealTimeDecision.Category.CARD_AUTHORIZATION_REQUESTED)
                .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                .digitalWalletAuthentication(
                    RealTimeDecision.DigitalWalletAuthentication.builder()
                        .cardId("card_id")
                        .channel(RealTimeDecision.DigitalWalletAuthentication.Channel.SMS)
                        .digitalWallet(
                            RealTimeDecision.DigitalWalletAuthentication.DigitalWallet.APPLE_PAY
                        )
                        .email("email")
                        .oneTimePasscode("one_time_passcode")
                        .phone("phone")
                        .result(RealTimeDecision.DigitalWalletAuthentication.Result.SUCCESS)
                        .build()
                )
                .digitalWalletToken(
                    RealTimeDecision.DigitalWalletToken.builder()
                        .cardId("card_id")
                        .decision(RealTimeDecision.DigitalWalletToken.Decision.APPROVE)
                        .device(
                            RealTimeDecision.DigitalWalletToken.Device.builder()
                                .identifier("identifier")
                                .build()
                        )
                        .digitalWallet(RealTimeDecision.DigitalWalletToken.DigitalWallet.APPLE_PAY)
                        .build()
                )
                .status(RealTimeDecision.Status.PENDING)
                .timeoutAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                .type(RealTimeDecision.Type.REAL_TIME_DECISION)
                .build()

        val roundtrippedRealTimeDecision =
            jsonMapper.readValue(
                jsonMapper.writeValueAsString(realTimeDecision),
                jacksonTypeRef<RealTimeDecision>(),
            )

        assertThat(roundtrippedRealTimeDecision).isEqualTo(realTimeDecision)
    }
}
