// File generated from our OpenAPI spec by Stainless.

package com.increase.api.services.blocking.simulations

import com.google.errorprone.annotations.MustBeClosed
import com.increase.api.core.ClientOptions
import com.increase.api.core.RequestOptions
import com.increase.api.core.http.HttpResponseFor
import com.increase.api.models.simulations.cardrefunds.CardRefundCreateParams
import com.increase.api.models.transactions.Transaction
import java.util.function.Consumer

interface CardRefundService {

    /**
     * Returns a view of this service that provides access to raw HTTP responses for each method.
     */
    fun withRawResponse(): WithRawResponse

    /**
     * Returns a view of this service with the given option modifications applied.
     *
     * The original service is not modified.
     */
    fun withOptions(modifier: Consumer<ClientOptions.Builder>): CardRefundService

    /**
     * Simulates refunding a card transaction. The full value of the original sandbox transaction is
     * refunded.
     */
    fun create(): Transaction = create(CardRefundCreateParams.none())

    /** @see create */
    fun create(
        params: CardRefundCreateParams = CardRefundCreateParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): Transaction

    /** @see create */
    fun create(params: CardRefundCreateParams = CardRefundCreateParams.none()): Transaction =
        create(params, RequestOptions.none())

    /** @see create */
    fun create(requestOptions: RequestOptions): Transaction =
        create(CardRefundCreateParams.none(), requestOptions)

    /** A view of [CardRefundService] that provides access to raw HTTP responses for each method. */
    interface WithRawResponse {

        /**
         * Returns a view of this service with the given option modifications applied.
         *
         * The original service is not modified.
         */
        fun withOptions(
            modifier: Consumer<ClientOptions.Builder>
        ): CardRefundService.WithRawResponse

        /**
         * Returns a raw HTTP response for `post /simulations/card_refunds`, but is otherwise the
         * same as [CardRefundService.create].
         */
        @MustBeClosed
        fun create(): HttpResponseFor<Transaction> = create(CardRefundCreateParams.none())

        /** @see create */
        @MustBeClosed
        fun create(
            params: CardRefundCreateParams = CardRefundCreateParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<Transaction>

        /** @see create */
        @MustBeClosed
        fun create(
            params: CardRefundCreateParams = CardRefundCreateParams.none()
        ): HttpResponseFor<Transaction> = create(params, RequestOptions.none())

        /** @see create */
        @MustBeClosed
        fun create(requestOptions: RequestOptions): HttpResponseFor<Transaction> =
            create(CardRefundCreateParams.none(), requestOptions)
    }
}
