// File generated from our OpenAPI spec by Stainless.

package com.openai.services.blocking.admin.organization

import com.openai.TestServerExtension
import com.openai.client.okhttp.OpenAIOkHttpClient
import com.openai.models.admin.organization.dataretention.DataRetentionUpdateParams
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

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

    @Test
    fun retrieve() {
        val client =
            OpenAIOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .adminApiKey("My Admin API Key")
                .build()
        val dataRetentionService = client.admin().organization().dataRetention()

        val organizationDataRetention = dataRetentionService.retrieve()

        organizationDataRetention.validate()
    }

    @Test
    fun update() {
        val client =
            OpenAIOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .adminApiKey("My Admin API Key")
                .build()
        val dataRetentionService = client.admin().organization().dataRetention()

        val organizationDataRetention =
            dataRetentionService.update(
                DataRetentionUpdateParams.builder()
                    .retentionType(DataRetentionUpdateParams.RetentionType.ZERO_DATA_RETENTION)
                    .build()
            )

        organizationDataRetention.validate()
    }
}
