// File generated from our OpenAPI spec by Stainless.

package com.increase.api.services.async

import com.increase.api.TestServerExtension
import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync
import com.increase.api.models.carddisputes.CardDisputeCreateParams
import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams
import com.increase.api.models.carddisputes.CardDisputeWithdrawParams
import java.time.LocalDate
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

@ExtendWith(TestServerExtension::class)
internal class CardDisputeServiceAsyncTest {

    @Test
    fun create() {
        val client =
            IncreaseOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cardDisputeServiceAsync = client.cardDisputes()

        val cardDisputeFuture =
            cardDisputeServiceAsync.create(
                CardDisputeCreateParams.builder()
                    .disputedTransactionId("transaction_uyrp7fld2ium70oa7oi")
                    .network(CardDisputeCreateParams.Network.VISA)
                    .amount(100L)
                    .addAttachmentFile(
                        CardDisputeCreateParams.AttachmentFile.builder().fileId("file_id").build()
                    )
                    .explanation("x")
                    .visa(
                        CardDisputeCreateParams.Visa.builder()
                            .category(CardDisputeCreateParams.Visa.Category.FRAUD)
                            .authorization(
                                CardDisputeCreateParams.Visa.Authorization.builder()
                                    .accountStatus(
                                        CardDisputeCreateParams.Visa.Authorization.AccountStatus
                                            .ACCOUNT_CLOSED
                                    )
                                    .build()
                            )
                            .consumerCanceledMerchandise(
                                CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise.builder()
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .purchaseExplanation("x")
                                    .receivedOrExpectedAt(LocalDate.parse("2019-12-27"))
                                    .returnOutcome(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise
                                            .ReturnOutcome
                                            .NOT_RETURNED
                                    )
                                    .cardholderCancellation(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise
                                            .CardholderCancellation
                                            .builder()
                                            .canceledAt(LocalDate.parse("2019-12-27"))
                                            .canceledPriorToShipDate(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerCanceledMerchandise
                                                    .CardholderCancellation
                                                    .CanceledPriorToShipDate
                                                    .CANCELED_PRIOR_TO_SHIP_DATE
                                            )
                                            .cancellationPolicyProvided(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerCanceledMerchandise
                                                    .CardholderCancellation
                                                    .CancellationPolicyProvided
                                                    .NOT_PROVIDED
                                            )
                                            .reason("x")
                                            .build()
                                    )
                                    .notReturned(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise
                                            .NotReturned
                                            .builder()
                                            .build()
                                    )
                                    .returnAttempted(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise
                                            .ReturnAttempted
                                            .builder()
                                            .attemptExplanation("x")
                                            .attemptReason(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerCanceledMerchandise
                                                    .ReturnAttempted
                                                    .AttemptReason
                                                    .MERCHANT_NOT_RESPONDING
                                            )
                                            .attemptedAt(LocalDate.parse("2019-12-27"))
                                            .merchandiseDisposition("x")
                                            .build()
                                    )
                                    .returned(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise
                                            .Returned
                                            .builder()
                                            .returnMethod(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerCanceledMerchandise
                                                    .Returned
                                                    .ReturnMethod
                                                    .DHL
                                            )
                                            .returnedAt(LocalDate.parse("2019-12-27"))
                                            .merchantReceivedReturnAt(LocalDate.parse("2019-12-27"))
                                            .otherExplanation("x")
                                            .trackingNumber("x")
                                            .build()
                                    )
                                    .build()
                            )
                            .consumerCanceledRecurringTransaction(
                                CardDisputeCreateParams.Visa.ConsumerCanceledRecurringTransaction
                                    .builder()
                                    .cancellationTarget(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerCanceledRecurringTransaction
                                            .CancellationTarget
                                            .ACCOUNT
                                    )
                                    .merchantContactMethods(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerCanceledRecurringTransaction
                                            .MerchantContactMethods
                                            .builder()
                                            .applicationName("x")
                                            .callCenterPhoneNumber("x")
                                            .emailAddress("x")
                                            .inPersonAddress("x")
                                            .mailingAddress("x")
                                            .textPhoneNumber("x")
                                            .build()
                                    )
                                    .transactionOrAccountCanceledAt(LocalDate.parse("2019-12-27"))
                                    .otherFormOfPaymentExplanation("x")
                                    .build()
                            )
                            .consumerCanceledServices(
                                CardDisputeCreateParams.Visa.ConsumerCanceledServices.builder()
                                    .cardholderCancellation(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledServices
                                            .CardholderCancellation
                                            .builder()
                                            .canceledAt(LocalDate.parse("2019-12-27"))
                                            .cancellationPolicyProvided(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerCanceledServices
                                                    .CardholderCancellation
                                                    .CancellationPolicyProvided
                                                    .NOT_PROVIDED
                                            )
                                            .reason("x")
                                            .build()
                                    )
                                    .contractedAt(LocalDate.parse("2019-12-27"))
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledServices
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .purchaseExplanation("x")
                                    .serviceType(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledServices
                                            .ServiceType
                                            .GUARANTEED_RESERVATION
                                    )
                                    .guaranteedReservation(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledServices
                                            .GuaranteedReservation
                                            .builder()
                                            .explanation(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerCanceledServices
                                                    .GuaranteedReservation
                                                    .Explanation
                                                    .CARDHOLDER_CANCELED_PRIOR_TO_SERVICE
                                            )
                                            .build()
                                    )
                                    .other(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other
                                            .builder()
                                            .build()
                                    )
                                    .timeshare(
                                        CardDisputeCreateParams.Visa.ConsumerCanceledServices
                                            .Timeshare
                                            .builder()
                                            .build()
                                    )
                                    .build()
                            )
                            .consumerCounterfeitMerchandise(
                                CardDisputeCreateParams.Visa.ConsumerCounterfeitMerchandise
                                    .builder()
                                    .counterfeitExplanation("x")
                                    .dispositionExplanation("x")
                                    .orderExplanation("x")
                                    .receivedAt(LocalDate.parse("2019-12-27"))
                                    .build()
                            )
                            .consumerCreditNotProcessed(
                                CardDisputeCreateParams.Visa.ConsumerCreditNotProcessed.builder()
                                    .canceledOrReturnedAt(LocalDate.parse("2019-12-27"))
                                    .creditExpectedAt(LocalDate.parse("2019-12-27"))
                                    .build()
                            )
                            .consumerDamagedOrDefectiveMerchandise(
                                CardDisputeCreateParams.Visa.ConsumerDamagedOrDefectiveMerchandise
                                    .builder()
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerDamagedOrDefectiveMerchandise
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .orderAndIssueExplanation("x")
                                    .receivedAt(LocalDate.parse("2019-12-27"))
                                    .returnOutcome(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerDamagedOrDefectiveMerchandise
                                            .ReturnOutcome
                                            .NOT_RETURNED
                                    )
                                    .notReturned(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerDamagedOrDefectiveMerchandise
                                            .NotReturned
                                            .builder()
                                            .build()
                                    )
                                    .returnAttempted(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerDamagedOrDefectiveMerchandise
                                            .ReturnAttempted
                                            .builder()
                                            .attemptExplanation("x")
                                            .attemptReason(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerDamagedOrDefectiveMerchandise
                                                    .ReturnAttempted
                                                    .AttemptReason
                                                    .MERCHANT_NOT_RESPONDING
                                            )
                                            .attemptedAt(LocalDate.parse("2019-12-27"))
                                            .merchandiseDisposition("x")
                                            .build()
                                    )
                                    .returned(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerDamagedOrDefectiveMerchandise
                                            .Returned
                                            .builder()
                                            .returnMethod(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerDamagedOrDefectiveMerchandise
                                                    .Returned
                                                    .ReturnMethod
                                                    .DHL
                                            )
                                            .returnedAt(LocalDate.parse("2019-12-27"))
                                            .merchantReceivedReturnAt(LocalDate.parse("2019-12-27"))
                                            .otherExplanation("x")
                                            .trackingNumber("x")
                                            .build()
                                    )
                                    .build()
                            )
                            .consumerMerchandiseMisrepresentation(
                                CardDisputeCreateParams.Visa.ConsumerMerchandiseMisrepresentation
                                    .builder()
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerMerchandiseMisrepresentation
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .misrepresentationExplanation("x")
                                    .purchaseExplanation("x")
                                    .receivedAt(LocalDate.parse("2019-12-27"))
                                    .returnOutcome(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerMerchandiseMisrepresentation
                                            .ReturnOutcome
                                            .NOT_RETURNED
                                    )
                                    .notReturned(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerMerchandiseMisrepresentation
                                            .NotReturned
                                            .builder()
                                            .build()
                                    )
                                    .returnAttempted(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerMerchandiseMisrepresentation
                                            .ReturnAttempted
                                            .builder()
                                            .attemptExplanation("x")
                                            .attemptReason(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerMerchandiseMisrepresentation
                                                    .ReturnAttempted
                                                    .AttemptReason
                                                    .MERCHANT_NOT_RESPONDING
                                            )
                                            .attemptedAt(LocalDate.parse("2019-12-27"))
                                            .merchandiseDisposition("x")
                                            .build()
                                    )
                                    .returned(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerMerchandiseMisrepresentation
                                            .Returned
                                            .builder()
                                            .returnMethod(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerMerchandiseMisrepresentation
                                                    .Returned
                                                    .ReturnMethod
                                                    .DHL
                                            )
                                            .returnedAt(LocalDate.parse("2019-12-27"))
                                            .merchantReceivedReturnAt(LocalDate.parse("2019-12-27"))
                                            .otherExplanation("x")
                                            .trackingNumber("x")
                                            .build()
                                    )
                                    .build()
                            )
                            .consumerMerchandiseNotAsDescribed(
                                CardDisputeCreateParams.Visa.ConsumerMerchandiseNotAsDescribed
                                    .builder()
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerMerchandiseNotAsDescribed
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .receivedAt(LocalDate.parse("2019-12-27"))
                                    .returnOutcome(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerMerchandiseNotAsDescribed
                                            .ReturnOutcome
                                            .RETURNED
                                    )
                                    .returnAttempted(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerMerchandiseNotAsDescribed
                                            .ReturnAttempted
                                            .builder()
                                            .attemptExplanation("x")
                                            .attemptReason(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerMerchandiseNotAsDescribed
                                                    .ReturnAttempted
                                                    .AttemptReason
                                                    .MERCHANT_NOT_RESPONDING
                                            )
                                            .attemptedAt(LocalDate.parse("2019-12-27"))
                                            .merchandiseDisposition("x")
                                            .build()
                                    )
                                    .returned(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerMerchandiseNotAsDescribed
                                            .Returned
                                            .builder()
                                            .returnMethod(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerMerchandiseNotAsDescribed
                                                    .Returned
                                                    .ReturnMethod
                                                    .DHL
                                            )
                                            .returnedAt(LocalDate.parse("2019-12-27"))
                                            .merchantReceivedReturnAt(LocalDate.parse("2019-12-27"))
                                            .otherExplanation("x")
                                            .trackingNumber("x")
                                            .build()
                                    )
                                    .build()
                            )
                            .consumerMerchandiseNotReceived(
                                CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived
                                    .builder()
                                    .cancellationOutcome(
                                        CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived
                                            .CancellationOutcome
                                            .CARDHOLDER_CANCELLATION_PRIOR_TO_EXPECTED_RECEIPT
                                    )
                                    .deliveryIssue(
                                        CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived
                                            .DeliveryIssue
                                            .DELAYED
                                    )
                                    .lastExpectedReceiptAt(LocalDate.parse("2019-12-27"))
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .purchaseInfoAndExplanation("x")
                                    .cardholderCancellationPriorToExpectedReceipt(
                                        CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived
                                            .CardholderCancellationPriorToExpectedReceipt
                                            .builder()
                                            .canceledAt(LocalDate.parse("2019-12-27"))
                                            .reason("x")
                                            .build()
                                    )
                                    .delayed(
                                        CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived
                                            .Delayed
                                            .builder()
                                            .explanation("x")
                                            .returnOutcome(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerMerchandiseNotReceived
                                                    .Delayed
                                                    .ReturnOutcome
                                                    .NOT_RETURNED
                                            )
                                            .notReturned(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerMerchandiseNotReceived
                                                    .Delayed
                                                    .NotReturned
                                                    .builder()
                                                    .build()
                                            )
                                            .returnAttempted(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerMerchandiseNotReceived
                                                    .Delayed
                                                    .ReturnAttempted
                                                    .builder()
                                                    .attemptedAt(LocalDate.parse("2019-12-27"))
                                                    .build()
                                            )
                                            .returned(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerMerchandiseNotReceived
                                                    .Delayed
                                                    .Returned
                                                    .builder()
                                                    .merchantReceivedReturnAt(
                                                        LocalDate.parse("2019-12-27")
                                                    )
                                                    .returnedAt(LocalDate.parse("2019-12-27"))
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .deliveredToWrongLocation(
                                        CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived
                                            .DeliveredToWrongLocation
                                            .builder()
                                            .agreedLocation("x")
                                            .build()
                                    )
                                    .merchantCancellation(
                                        CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived
                                            .MerchantCancellation
                                            .builder()
                                            .canceledAt(LocalDate.parse("2019-12-27"))
                                            .build()
                                    )
                                    .noCancellation(
                                        CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived
                                            .NoCancellation
                                            .builder()
                                            .build()
                                    )
                                    .build()
                            )
                            .consumerNonReceiptOfCash(
                                CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder()
                                    .build()
                            )
                            .consumerOriginalCreditTransactionNotAccepted(
                                CardDisputeCreateParams.Visa
                                    .ConsumerOriginalCreditTransactionNotAccepted
                                    .builder()
                                    .explanation("x")
                                    .reason(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerOriginalCreditTransactionNotAccepted
                                            .Reason
                                            .PROHIBITED_BY_LOCAL_LAWS_OR_REGULATION
                                    )
                                    .build()
                            )
                            .consumerQualityMerchandise(
                                CardDisputeCreateParams.Visa.ConsumerQualityMerchandise.builder()
                                    .expectedAt(LocalDate.parse("2019-12-27"))
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa.ConsumerQualityMerchandise
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .purchaseInfoAndQualityIssue("x")
                                    .receivedAt(LocalDate.parse("2019-12-27"))
                                    .returnOutcome(
                                        CardDisputeCreateParams.Visa.ConsumerQualityMerchandise
                                            .ReturnOutcome
                                            .NOT_RETURNED
                                    )
                                    .notReturned(
                                        CardDisputeCreateParams.Visa.ConsumerQualityMerchandise
                                            .NotReturned
                                            .builder()
                                            .build()
                                    )
                                    .ongoingNegotiations(
                                        CardDisputeCreateParams.Visa.ConsumerQualityMerchandise
                                            .OngoingNegotiations
                                            .builder()
                                            .explanation("x")
                                            .issuerFirstNotifiedAt(LocalDate.parse("2019-12-27"))
                                            .startedAt(LocalDate.parse("2019-12-27"))
                                            .build()
                                    )
                                    .returnAttempted(
                                        CardDisputeCreateParams.Visa.ConsumerQualityMerchandise
                                            .ReturnAttempted
                                            .builder()
                                            .attemptExplanation("x")
                                            .attemptReason(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerQualityMerchandise
                                                    .ReturnAttempted
                                                    .AttemptReason
                                                    .MERCHANT_NOT_RESPONDING
                                            )
                                            .attemptedAt(LocalDate.parse("2019-12-27"))
                                            .merchandiseDisposition("x")
                                            .build()
                                    )
                                    .returned(
                                        CardDisputeCreateParams.Visa.ConsumerQualityMerchandise
                                            .Returned
                                            .builder()
                                            .returnMethod(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerQualityMerchandise
                                                    .Returned
                                                    .ReturnMethod
                                                    .DHL
                                            )
                                            .returnedAt(LocalDate.parse("2019-12-27"))
                                            .merchantReceivedReturnAt(LocalDate.parse("2019-12-27"))
                                            .otherExplanation("x")
                                            .trackingNumber("x")
                                            .build()
                                    )
                                    .build()
                            )
                            .consumerQualityServices(
                                CardDisputeCreateParams.Visa.ConsumerQualityServices.builder()
                                    .cardholderCancellation(
                                        CardDisputeCreateParams.Visa.ConsumerQualityServices
                                            .CardholderCancellation
                                            .builder()
                                            .acceptedByMerchant(
                                                CardDisputeCreateParams.Visa.ConsumerQualityServices
                                                    .CardholderCancellation
                                                    .AcceptedByMerchant
                                                    .ACCEPTED
                                            )
                                            .canceledAt(LocalDate.parse("2019-12-27"))
                                            .reason("x")
                                            .build()
                                    )
                                    .nonFiatCurrencyOrNonFungibleTokenRelatedAndNotMatchingDescription(
                                        CardDisputeCreateParams.Visa.ConsumerQualityServices
                                            .NonFiatCurrencyOrNonFungibleTokenRelatedAndNotMatchingDescription
                                            .NOT_RELATED
                                    )
                                    .purchaseInfoAndQualityIssue("x")
                                    .servicesReceivedAt(LocalDate.parse("2019-12-27"))
                                    .cardholderPaidToHaveWorkRedone(
                                        CardDisputeCreateParams.Visa.ConsumerQualityServices
                                            .CardholderPaidToHaveWorkRedone
                                            .DID_NOT_PAY_TO_HAVE_WORK_REDONE
                                    )
                                    .ongoingNegotiations(
                                        CardDisputeCreateParams.Visa.ConsumerQualityServices
                                            .OngoingNegotiations
                                            .builder()
                                            .explanation("x")
                                            .issuerFirstNotifiedAt(LocalDate.parse("2019-12-27"))
                                            .startedAt(LocalDate.parse("2019-12-27"))
                                            .build()
                                    )
                                    .restaurantFoodRelated(
                                        CardDisputeCreateParams.Visa.ConsumerQualityServices
                                            .RestaurantFoodRelated
                                            .NOT_RELATED
                                    )
                                    .build()
                            )
                            .consumerServicesMisrepresentation(
                                CardDisputeCreateParams.Visa.ConsumerServicesMisrepresentation
                                    .builder()
                                    .cardholderCancellation(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerServicesMisrepresentation
                                            .CardholderCancellation
                                            .builder()
                                            .acceptedByMerchant(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerServicesMisrepresentation
                                                    .CardholderCancellation
                                                    .AcceptedByMerchant
                                                    .ACCEPTED
                                            )
                                            .canceledAt(LocalDate.parse("2019-12-27"))
                                            .reason("x")
                                            .build()
                                    )
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa
                                            .ConsumerServicesMisrepresentation
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .misrepresentationExplanation("x")
                                    .purchaseExplanation("x")
                                    .receivedAt(LocalDate.parse("2019-12-27"))
                                    .build()
                            )
                            .consumerServicesNotAsDescribed(
                                CardDisputeCreateParams.Visa.ConsumerServicesNotAsDescribed
                                    .builder()
                                    .cardholderCancellation(
                                        CardDisputeCreateParams.Visa.ConsumerServicesNotAsDescribed
                                            .CardholderCancellation
                                            .builder()
                                            .acceptedByMerchant(
                                                CardDisputeCreateParams.Visa
                                                    .ConsumerServicesNotAsDescribed
                                                    .CardholderCancellation
                                                    .AcceptedByMerchant
                                                    .ACCEPTED
                                            )
                                            .canceledAt(LocalDate.parse("2019-12-27"))
                                            .reason("x")
                                            .build()
                                    )
                                    .explanation("x")
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa.ConsumerServicesNotAsDescribed
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .receivedAt(LocalDate.parse("2019-12-27"))
                                    .build()
                            )
                            .consumerServicesNotReceived(
                                CardDisputeCreateParams.Visa.ConsumerServicesNotReceived.builder()
                                    .cancellationOutcome(
                                        CardDisputeCreateParams.Visa.ConsumerServicesNotReceived
                                            .CancellationOutcome
                                            .CARDHOLDER_CANCELLATION_PRIOR_TO_EXPECTED_RECEIPT
                                    )
                                    .lastExpectedReceiptAt(LocalDate.parse("2019-12-27"))
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa.ConsumerServicesNotReceived
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .purchaseInfoAndExplanation("x")
                                    .cardholderCancellationPriorToExpectedReceipt(
                                        CardDisputeCreateParams.Visa.ConsumerServicesNotReceived
                                            .CardholderCancellationPriorToExpectedReceipt
                                            .builder()
                                            .canceledAt(LocalDate.parse("2019-12-27"))
                                            .reason("x")
                                            .build()
                                    )
                                    .merchantCancellation(
                                        CardDisputeCreateParams.Visa.ConsumerServicesNotReceived
                                            .MerchantCancellation
                                            .builder()
                                            .canceledAt(LocalDate.parse("2019-12-27"))
                                            .build()
                                    )
                                    .noCancellation(
                                        CardDisputeCreateParams.Visa.ConsumerServicesNotReceived
                                            .NoCancellation
                                            .builder()
                                            .build()
                                    )
                                    .build()
                            )
                            .fraud(
                                CardDisputeCreateParams.Visa.Fraud.builder()
                                    .fraudType(
                                        CardDisputeCreateParams.Visa.Fraud.FraudType
                                            .ACCOUNT_OR_CREDENTIALS_TAKEOVER
                                    )
                                    .build()
                            )
                            .processingError(
                                CardDisputeCreateParams.Visa.ProcessingError.builder()
                                    .errorReason(
                                        CardDisputeCreateParams.Visa.ProcessingError.ErrorReason
                                            .DUPLICATE_TRANSACTION
                                    )
                                    .merchantResolutionAttempted(
                                        CardDisputeCreateParams.Visa.ProcessingError
                                            .MerchantResolutionAttempted
                                            .ATTEMPTED
                                    )
                                    .duplicateTransaction(
                                        CardDisputeCreateParams.Visa.ProcessingError
                                            .DuplicateTransaction
                                            .builder()
                                            .otherTransactionId("x")
                                            .build()
                                    )
                                    .incorrectAmount(
                                        CardDisputeCreateParams.Visa.ProcessingError.IncorrectAmount
                                            .builder()
                                            .expectedAmount(0L)
                                            .build()
                                    )
                                    .paidByOtherMeans(
                                        CardDisputeCreateParams.Visa.ProcessingError
                                            .PaidByOtherMeans
                                            .builder()
                                            .otherFormOfPaymentEvidence(
                                                CardDisputeCreateParams.Visa.ProcessingError
                                                    .PaidByOtherMeans
                                                    .OtherFormOfPaymentEvidence
                                                    .CANCELED_CHECK
                                            )
                                            .otherTransactionId("x")
                                            .build()
                                    )
                                    .build()
                            )
                            .build()
                    )
                    .build()
            )

        val cardDispute = cardDisputeFuture.get()
        cardDispute.validate()
    }

    @Test
    fun retrieve() {
        val client =
            IncreaseOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cardDisputeServiceAsync = client.cardDisputes()

        val cardDisputeFuture =
            cardDisputeServiceAsync.retrieve("card_dispute_h9sc95nbl1cgltpp7men")

        val cardDispute = cardDisputeFuture.get()
        cardDispute.validate()
    }

    @Test
    fun list() {
        val client =
            IncreaseOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cardDisputeServiceAsync = client.cardDisputes()

        val pageFuture = cardDisputeServiceAsync.list()

        val page = pageFuture.get()
        page.response().validate()
    }

    @Test
    fun submitUserSubmission() {
        val client =
            IncreaseOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cardDisputeServiceAsync = client.cardDisputes()

        val cardDisputeFuture =
            cardDisputeServiceAsync.submitUserSubmission(
                CardDisputeSubmitUserSubmissionParams.builder()
                    .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men")
                    .network(CardDisputeSubmitUserSubmissionParams.Network.VISA)
                    .amount(1L)
                    .addAttachmentFile(
                        CardDisputeSubmitUserSubmissionParams.AttachmentFile.builder()
                            .fileId("file_id")
                            .build()
                    )
                    .explanation("x")
                    .visa(
                        CardDisputeSubmitUserSubmissionParams.Visa.builder()
                            .category(
                                CardDisputeSubmitUserSubmissionParams.Visa.Category
                                    .MERCHANT_PREARBITRATION_DECLINE
                            )
                            .chargeback(
                                CardDisputeSubmitUserSubmissionParams.Visa.Chargeback.builder()
                                    .category(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .Category
                                            .AUTHORIZATION
                                    )
                                    .authorization(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .Authorization
                                            .builder()
                                            .accountStatus(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .Authorization
                                                    .AccountStatus
                                                    .ACCOUNT_CLOSED
                                            )
                                            .build()
                                    )
                                    .consumerCanceledMerchandise(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerCanceledMerchandise
                                            .builder()
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledMerchandise
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .purchaseExplanation("x")
                                            .receivedOrExpectedAt(LocalDate.parse("2019-12-27"))
                                            .returnOutcome(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledMerchandise
                                                    .ReturnOutcome
                                                    .NOT_RETURNED
                                            )
                                            .cardholderCancellation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledMerchandise
                                                    .CardholderCancellation
                                                    .builder()
                                                    .canceledAt(LocalDate.parse("2019-12-27"))
                                                    .canceledPriorToShipDate(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerCanceledMerchandise
                                                            .CardholderCancellation
                                                            .CanceledPriorToShipDate
                                                            .CANCELED_PRIOR_TO_SHIP_DATE
                                                    )
                                                    .cancellationPolicyProvided(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerCanceledMerchandise
                                                            .CardholderCancellation
                                                            .CancellationPolicyProvided
                                                            .NOT_PROVIDED
                                                    )
                                                    .reason("x")
                                                    .build()
                                            )
                                            .notReturned(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledMerchandise
                                                    .NotReturned
                                                    .builder()
                                                    .build()
                                            )
                                            .returnAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledMerchandise
                                                    .ReturnAttempted
                                                    .builder()
                                                    .attemptExplanation("x")
                                                    .attemptReason(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerCanceledMerchandise
                                                            .ReturnAttempted
                                                            .AttemptReason
                                                            .MERCHANT_NOT_RESPONDING
                                                    )
                                                    .attemptedAt(LocalDate.parse("2019-12-27"))
                                                    .merchandiseDisposition("x")
                                                    .build()
                                            )
                                            .returned(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledMerchandise
                                                    .Returned
                                                    .builder()
                                                    .returnMethod(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerCanceledMerchandise
                                                            .Returned
                                                            .ReturnMethod
                                                            .DHL
                                                    )
                                                    .returnedAt(LocalDate.parse("2019-12-27"))
                                                    .merchantReceivedReturnAt(
                                                        LocalDate.parse("2019-12-27")
                                                    )
                                                    .otherExplanation("x")
                                                    .trackingNumber("x")
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .consumerCanceledRecurringTransaction(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerCanceledRecurringTransaction
                                            .builder()
                                            .cancellationTarget(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledRecurringTransaction
                                                    .CancellationTarget
                                                    .ACCOUNT
                                            )
                                            .merchantContactMethods(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledRecurringTransaction
                                                    .MerchantContactMethods
                                                    .builder()
                                                    .applicationName("x")
                                                    .callCenterPhoneNumber("x")
                                                    .emailAddress("x")
                                                    .inPersonAddress("x")
                                                    .mailingAddress("x")
                                                    .textPhoneNumber("x")
                                                    .build()
                                            )
                                            .transactionOrAccountCanceledAt(
                                                LocalDate.parse("2019-12-27")
                                            )
                                            .otherFormOfPaymentExplanation("x")
                                            .build()
                                    )
                                    .consumerCanceledServices(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerCanceledServices
                                            .builder()
                                            .cardholderCancellation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledServices
                                                    .CardholderCancellation
                                                    .builder()
                                                    .canceledAt(LocalDate.parse("2019-12-27"))
                                                    .cancellationPolicyProvided(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerCanceledServices
                                                            .CardholderCancellation
                                                            .CancellationPolicyProvided
                                                            .NOT_PROVIDED
                                                    )
                                                    .reason("x")
                                                    .build()
                                            )
                                            .contractedAt(LocalDate.parse("2019-12-27"))
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledServices
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .purchaseExplanation("x")
                                            .serviceType(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledServices
                                                    .ServiceType
                                                    .GUARANTEED_RESERVATION
                                            )
                                            .guaranteedReservation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledServices
                                                    .GuaranteedReservation
                                                    .builder()
                                                    .explanation(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerCanceledServices
                                                            .GuaranteedReservation
                                                            .Explanation
                                                            .CARDHOLDER_CANCELED_PRIOR_TO_SERVICE
                                                    )
                                                    .build()
                                            )
                                            .other(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledServices
                                                    .Other
                                                    .builder()
                                                    .build()
                                            )
                                            .timeshare(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerCanceledServices
                                                    .Timeshare
                                                    .builder()
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .consumerCounterfeitMerchandise(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerCounterfeitMerchandise
                                            .builder()
                                            .counterfeitExplanation("x")
                                            .dispositionExplanation("x")
                                            .orderExplanation("x")
                                            .receivedAt(LocalDate.parse("2019-12-27"))
                                            .build()
                                    )
                                    .consumerCreditNotProcessed(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerCreditNotProcessed
                                            .builder()
                                            .canceledOrReturnedAt(LocalDate.parse("2019-12-27"))
                                            .creditExpectedAt(LocalDate.parse("2019-12-27"))
                                            .build()
                                    )
                                    .consumerDamagedOrDefectiveMerchandise(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerDamagedOrDefectiveMerchandise
                                            .builder()
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerDamagedOrDefectiveMerchandise
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .orderAndIssueExplanation("x")
                                            .receivedAt(LocalDate.parse("2019-12-27"))
                                            .returnOutcome(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerDamagedOrDefectiveMerchandise
                                                    .ReturnOutcome
                                                    .NOT_RETURNED
                                            )
                                            .notReturned(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerDamagedOrDefectiveMerchandise
                                                    .NotReturned
                                                    .builder()
                                                    .build()
                                            )
                                            .returnAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerDamagedOrDefectiveMerchandise
                                                    .ReturnAttempted
                                                    .builder()
                                                    .attemptExplanation("x")
                                                    .attemptReason(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerDamagedOrDefectiveMerchandise
                                                            .ReturnAttempted
                                                            .AttemptReason
                                                            .MERCHANT_NOT_RESPONDING
                                                    )
                                                    .attemptedAt(LocalDate.parse("2019-12-27"))
                                                    .merchandiseDisposition("x")
                                                    .build()
                                            )
                                            .returned(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerDamagedOrDefectiveMerchandise
                                                    .Returned
                                                    .builder()
                                                    .returnMethod(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerDamagedOrDefectiveMerchandise
                                                            .Returned
                                                            .ReturnMethod
                                                            .DHL
                                                    )
                                                    .returnedAt(LocalDate.parse("2019-12-27"))
                                                    .merchantReceivedReturnAt(
                                                        LocalDate.parse("2019-12-27")
                                                    )
                                                    .otherExplanation("x")
                                                    .trackingNumber("x")
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .consumerMerchandiseMisrepresentation(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerMerchandiseMisrepresentation
                                            .builder()
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseMisrepresentation
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .misrepresentationExplanation("x")
                                            .purchaseExplanation("x")
                                            .receivedAt(LocalDate.parse("2019-12-27"))
                                            .returnOutcome(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseMisrepresentation
                                                    .ReturnOutcome
                                                    .NOT_RETURNED
                                            )
                                            .notReturned(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseMisrepresentation
                                                    .NotReturned
                                                    .builder()
                                                    .build()
                                            )
                                            .returnAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseMisrepresentation
                                                    .ReturnAttempted
                                                    .builder()
                                                    .attemptExplanation("x")
                                                    .attemptReason(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerMerchandiseMisrepresentation
                                                            .ReturnAttempted
                                                            .AttemptReason
                                                            .MERCHANT_NOT_RESPONDING
                                                    )
                                                    .attemptedAt(LocalDate.parse("2019-12-27"))
                                                    .merchandiseDisposition("x")
                                                    .build()
                                            )
                                            .returned(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseMisrepresentation
                                                    .Returned
                                                    .builder()
                                                    .returnMethod(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerMerchandiseMisrepresentation
                                                            .Returned
                                                            .ReturnMethod
                                                            .DHL
                                                    )
                                                    .returnedAt(LocalDate.parse("2019-12-27"))
                                                    .merchantReceivedReturnAt(
                                                        LocalDate.parse("2019-12-27")
                                                    )
                                                    .otherExplanation("x")
                                                    .trackingNumber("x")
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .consumerMerchandiseNotAsDescribed(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerMerchandiseNotAsDescribed
                                            .builder()
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotAsDescribed
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .receivedAt(LocalDate.parse("2019-12-27"))
                                            .returnOutcome(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotAsDescribed
                                                    .ReturnOutcome
                                                    .RETURNED
                                            )
                                            .returnAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotAsDescribed
                                                    .ReturnAttempted
                                                    .builder()
                                                    .attemptExplanation("x")
                                                    .attemptReason(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerMerchandiseNotAsDescribed
                                                            .ReturnAttempted
                                                            .AttemptReason
                                                            .MERCHANT_NOT_RESPONDING
                                                    )
                                                    .attemptedAt(LocalDate.parse("2019-12-27"))
                                                    .merchandiseDisposition("x")
                                                    .build()
                                            )
                                            .returned(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotAsDescribed
                                                    .Returned
                                                    .builder()
                                                    .returnMethod(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerMerchandiseNotAsDescribed
                                                            .Returned
                                                            .ReturnMethod
                                                            .DHL
                                                    )
                                                    .returnedAt(LocalDate.parse("2019-12-27"))
                                                    .merchantReceivedReturnAt(
                                                        LocalDate.parse("2019-12-27")
                                                    )
                                                    .otherExplanation("x")
                                                    .trackingNumber("x")
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .consumerMerchandiseNotReceived(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerMerchandiseNotReceived
                                            .builder()
                                            .cancellationOutcome(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotReceived
                                                    .CancellationOutcome
                                                    .CARDHOLDER_CANCELLATION_PRIOR_TO_EXPECTED_RECEIPT
                                            )
                                            .deliveryIssue(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotReceived
                                                    .DeliveryIssue
                                                    .DELAYED
                                            )
                                            .lastExpectedReceiptAt(LocalDate.parse("2019-12-27"))
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotReceived
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .purchaseInfoAndExplanation("x")
                                            .cardholderCancellationPriorToExpectedReceipt(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotReceived
                                                    .CardholderCancellationPriorToExpectedReceipt
                                                    .builder()
                                                    .canceledAt(LocalDate.parse("2019-12-27"))
                                                    .reason("x")
                                                    .build()
                                            )
                                            .delayed(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotReceived
                                                    .Delayed
                                                    .builder()
                                                    .explanation("x")
                                                    .returnOutcome(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerMerchandiseNotReceived
                                                            .Delayed
                                                            .ReturnOutcome
                                                            .NOT_RETURNED
                                                    )
                                                    .notReturned(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerMerchandiseNotReceived
                                                            .Delayed
                                                            .NotReturned
                                                            .builder()
                                                            .build()
                                                    )
                                                    .returnAttempted(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerMerchandiseNotReceived
                                                            .Delayed
                                                            .ReturnAttempted
                                                            .builder()
                                                            .attemptedAt(
                                                                LocalDate.parse("2019-12-27")
                                                            )
                                                            .build()
                                                    )
                                                    .returned(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerMerchandiseNotReceived
                                                            .Delayed
                                                            .Returned
                                                            .builder()
                                                            .merchantReceivedReturnAt(
                                                                LocalDate.parse("2019-12-27")
                                                            )
                                                            .returnedAt(
                                                                LocalDate.parse("2019-12-27")
                                                            )
                                                            .build()
                                                    )
                                                    .build()
                                            )
                                            .deliveredToWrongLocation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotReceived
                                                    .DeliveredToWrongLocation
                                                    .builder()
                                                    .agreedLocation("x")
                                                    .build()
                                            )
                                            .merchantCancellation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotReceived
                                                    .MerchantCancellation
                                                    .builder()
                                                    .canceledAt(LocalDate.parse("2019-12-27"))
                                                    .build()
                                            )
                                            .noCancellation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerMerchandiseNotReceived
                                                    .NoCancellation
                                                    .builder()
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .consumerNonReceiptOfCash(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerNonReceiptOfCash
                                            .builder()
                                            .build()
                                    )
                                    .consumerOriginalCreditTransactionNotAccepted(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerOriginalCreditTransactionNotAccepted
                                            .builder()
                                            .explanation("x")
                                            .reason(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerOriginalCreditTransactionNotAccepted
                                                    .Reason
                                                    .PROHIBITED_BY_LOCAL_LAWS_OR_REGULATION
                                            )
                                            .build()
                                    )
                                    .consumerQualityMerchandise(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerQualityMerchandise
                                            .builder()
                                            .expectedAt(LocalDate.parse("2019-12-27"))
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityMerchandise
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .purchaseInfoAndQualityIssue("x")
                                            .receivedAt(LocalDate.parse("2019-12-27"))
                                            .returnOutcome(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityMerchandise
                                                    .ReturnOutcome
                                                    .NOT_RETURNED
                                            )
                                            .notReturned(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityMerchandise
                                                    .NotReturned
                                                    .builder()
                                                    .build()
                                            )
                                            .ongoingNegotiations(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityMerchandise
                                                    .OngoingNegotiations
                                                    .builder()
                                                    .explanation("x")
                                                    .issuerFirstNotifiedAt(
                                                        LocalDate.parse("2019-12-27")
                                                    )
                                                    .startedAt(LocalDate.parse("2019-12-27"))
                                                    .build()
                                            )
                                            .returnAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityMerchandise
                                                    .ReturnAttempted
                                                    .builder()
                                                    .attemptExplanation("x")
                                                    .attemptReason(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerQualityMerchandise
                                                            .ReturnAttempted
                                                            .AttemptReason
                                                            .MERCHANT_NOT_RESPONDING
                                                    )
                                                    .attemptedAt(LocalDate.parse("2019-12-27"))
                                                    .merchandiseDisposition("x")
                                                    .build()
                                            )
                                            .returned(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityMerchandise
                                                    .Returned
                                                    .builder()
                                                    .returnMethod(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerQualityMerchandise
                                                            .Returned
                                                            .ReturnMethod
                                                            .DHL
                                                    )
                                                    .returnedAt(LocalDate.parse("2019-12-27"))
                                                    .merchantReceivedReturnAt(
                                                        LocalDate.parse("2019-12-27")
                                                    )
                                                    .otherExplanation("x")
                                                    .trackingNumber("x")
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .consumerQualityServices(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerQualityServices
                                            .builder()
                                            .cardholderCancellation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityServices
                                                    .CardholderCancellation
                                                    .builder()
                                                    .acceptedByMerchant(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerQualityServices
                                                            .CardholderCancellation
                                                            .AcceptedByMerchant
                                                            .ACCEPTED
                                                    )
                                                    .canceledAt(LocalDate.parse("2019-12-27"))
                                                    .reason("x")
                                                    .build()
                                            )
                                            .nonFiatCurrencyOrNonFungibleTokenRelatedAndNotMatchingDescription(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityServices
                                                    .NonFiatCurrencyOrNonFungibleTokenRelatedAndNotMatchingDescription
                                                    .NOT_RELATED
                                            )
                                            .purchaseInfoAndQualityIssue("x")
                                            .servicesReceivedAt(LocalDate.parse("2019-12-27"))
                                            .cardholderPaidToHaveWorkRedone(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityServices
                                                    .CardholderPaidToHaveWorkRedone
                                                    .DID_NOT_PAY_TO_HAVE_WORK_REDONE
                                            )
                                            .ongoingNegotiations(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityServices
                                                    .OngoingNegotiations
                                                    .builder()
                                                    .explanation("x")
                                                    .issuerFirstNotifiedAt(
                                                        LocalDate.parse("2019-12-27")
                                                    )
                                                    .startedAt(LocalDate.parse("2019-12-27"))
                                                    .build()
                                            )
                                            .restaurantFoodRelated(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerQualityServices
                                                    .RestaurantFoodRelated
                                                    .NOT_RELATED
                                            )
                                            .build()
                                    )
                                    .consumerServicesMisrepresentation(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerServicesMisrepresentation
                                            .builder()
                                            .cardholderCancellation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerServicesMisrepresentation
                                                    .CardholderCancellation
                                                    .builder()
                                                    .acceptedByMerchant(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerServicesMisrepresentation
                                                            .CardholderCancellation
                                                            .AcceptedByMerchant
                                                            .ACCEPTED
                                                    )
                                                    .canceledAt(LocalDate.parse("2019-12-27"))
                                                    .reason("x")
                                                    .build()
                                            )
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerServicesMisrepresentation
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .misrepresentationExplanation("x")
                                            .purchaseExplanation("x")
                                            .receivedAt(LocalDate.parse("2019-12-27"))
                                            .build()
                                    )
                                    .consumerServicesNotAsDescribed(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerServicesNotAsDescribed
                                            .builder()
                                            .cardholderCancellation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerServicesNotAsDescribed
                                                    .CardholderCancellation
                                                    .builder()
                                                    .acceptedByMerchant(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ConsumerServicesNotAsDescribed
                                                            .CardholderCancellation
                                                            .AcceptedByMerchant
                                                            .ACCEPTED
                                                    )
                                                    .canceledAt(LocalDate.parse("2019-12-27"))
                                                    .reason("x")
                                                    .build()
                                            )
                                            .explanation("x")
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerServicesNotAsDescribed
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .receivedAt(LocalDate.parse("2019-12-27"))
                                            .build()
                                    )
                                    .consumerServicesNotReceived(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ConsumerServicesNotReceived
                                            .builder()
                                            .cancellationOutcome(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerServicesNotReceived
                                                    .CancellationOutcome
                                                    .CARDHOLDER_CANCELLATION_PRIOR_TO_EXPECTED_RECEIPT
                                            )
                                            .lastExpectedReceiptAt(LocalDate.parse("2019-12-27"))
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerServicesNotReceived
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .purchaseInfoAndExplanation("x")
                                            .cardholderCancellationPriorToExpectedReceipt(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerServicesNotReceived
                                                    .CardholderCancellationPriorToExpectedReceipt
                                                    .builder()
                                                    .canceledAt(LocalDate.parse("2019-12-27"))
                                                    .reason("x")
                                                    .build()
                                            )
                                            .merchantCancellation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerServicesNotReceived
                                                    .MerchantCancellation
                                                    .builder()
                                                    .canceledAt(LocalDate.parse("2019-12-27"))
                                                    .build()
                                            )
                                            .noCancellation(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ConsumerServicesNotReceived
                                                    .NoCancellation
                                                    .builder()
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .fraud(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback.Fraud
                                            .builder()
                                            .fraudType(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .Fraud
                                                    .FraudType
                                                    .ACCOUNT_OR_CREDENTIALS_TAKEOVER
                                            )
                                            .build()
                                    )
                                    .processingError(
                                        CardDisputeSubmitUserSubmissionParams.Visa.Chargeback
                                            .ProcessingError
                                            .builder()
                                            .errorReason(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ProcessingError
                                                    .ErrorReason
                                                    .DUPLICATE_TRANSACTION
                                            )
                                            .merchantResolutionAttempted(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ProcessingError
                                                    .MerchantResolutionAttempted
                                                    .ATTEMPTED
                                            )
                                            .duplicateTransaction(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ProcessingError
                                                    .DuplicateTransaction
                                                    .builder()
                                                    .otherTransactionId("x")
                                                    .build()
                                            )
                                            .incorrectAmount(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ProcessingError
                                                    .IncorrectAmount
                                                    .builder()
                                                    .expectedAmount(0L)
                                                    .build()
                                            )
                                            .paidByOtherMeans(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .Chargeback
                                                    .ProcessingError
                                                    .PaidByOtherMeans
                                                    .builder()
                                                    .otherFormOfPaymentEvidence(
                                                        CardDisputeSubmitUserSubmissionParams.Visa
                                                            .Chargeback
                                                            .ProcessingError
                                                            .PaidByOtherMeans
                                                            .OtherFormOfPaymentEvidence
                                                            .CANCELED_CHECK
                                                    )
                                                    .otherTransactionId("x")
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .build()
                            )
                            .merchantPrearbitrationDecline(
                                CardDisputeSubmitUserSubmissionParams.Visa
                                    .MerchantPrearbitrationDecline
                                    .builder()
                                    .reason(
                                        "The pre-arbitration received from the merchantdoes not explain how they obtained permission to charge the card."
                                    )
                                    .build()
                            )
                            .userPrearbitration(
                                CardDisputeSubmitUserSubmissionParams.Visa.UserPrearbitration
                                    .builder()
                                    .reason("x")
                                    .categoryChange(
                                        CardDisputeSubmitUserSubmissionParams.Visa
                                            .UserPrearbitration
                                            .CategoryChange
                                            .builder()
                                            .category(
                                                CardDisputeSubmitUserSubmissionParams.Visa
                                                    .UserPrearbitration
                                                    .CategoryChange
                                                    .Category
                                                    .AUTHORIZATION
                                            )
                                            .reason("x")
                                            .build()
                                    )
                                    .build()
                            )
                            .build()
                    )
                    .build()
            )

        val cardDispute = cardDisputeFuture.get()
        cardDispute.validate()
    }

    @Test
    fun withdraw() {
        val client =
            IncreaseOkHttpClientAsync.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cardDisputeServiceAsync = client.cardDisputes()

        val cardDisputeFuture =
            cardDisputeServiceAsync.withdraw(
                CardDisputeWithdrawParams.builder()
                    .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men")
                    .explanation("The explanation for withdrawing the Card Dispute.")
                    .build()
            )

        val cardDispute = cardDisputeFuture.get()
        cardDispute.validate()
    }
}
