// File generated from our OpenAPI spec by Stainless.

package com.increase.api.services.blocking

import com.increase.api.TestServerExtension
import com.increase.api.client.okhttp.IncreaseOkHttpClient
import com.increase.api.models.intrafiexclusions.IntrafiExclusionCreateParams
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

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

    @Test
    fun create() {
        val client =
            IncreaseOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val intrafiExclusionService = client.intrafiExclusions()

        val intrafiExclusion =
            intrafiExclusionService.create(
                IntrafiExclusionCreateParams.builder()
                    .entityId("entity_n8y8tnk2p9339ti393yi")
                    .fdicCertificateNumber("314159")
                    .build()
            )

        intrafiExclusion.validate()
    }

    @Test
    fun retrieve() {
        val client =
            IncreaseOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val intrafiExclusionService = client.intrafiExclusions()

        val intrafiExclusion = intrafiExclusionService.retrieve("account_in71c4amph0vgo2qllky")

        intrafiExclusion.validate()
    }

    @Test
    fun list() {
        val client =
            IncreaseOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val intrafiExclusionService = client.intrafiExclusions()

        val page = intrafiExclusionService.list()

        page.response().validate()
    }

    @Test
    fun archive() {
        val client =
            IncreaseOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val intrafiExclusionService = client.intrafiExclusions()

        val intrafiExclusion =
            intrafiExclusionService.archive("intrafi_exclusion_ygfqduuzpau3jqof6jyh")

        intrafiExclusion.validate()
    }
}
