// File generated from our OpenAPI spec by Stainless.

package com.openai.models

import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

class ModerationTest {

    @Test
    fun createModeration() {
        val moderation =
            Moderation.builder()
                .categories(
                    Moderation.Categories.builder()
                        .harassment(true)
                        .harassmentThreatening(true)
                        .hate(true)
                        .hateThreatening(true)
                        .illicit(true)
                        .illicitViolent(true)
                        .selfHarm(true)
                        .selfHarmInstructions(true)
                        .selfHarmIntent(true)
                        .sexual(true)
                        .sexualMinors(true)
                        .violence(true)
                        .violenceGraphic(true)
                        .build()
                )
                .categoryAppliedInputTypes(
                    Moderation.CategoryAppliedInputTypes.builder()
                        .harassment(listOf(Moderation.CategoryAppliedInputTypes.Harassment.TEXT))
                        .harassmentThreatening(
                            listOf(Moderation.CategoryAppliedInputTypes.HarassmentThreatening.TEXT)
                        )
                        .hate(listOf(Moderation.CategoryAppliedInputTypes.Hate.TEXT))
                        .hateThreatening(
                            listOf(Moderation.CategoryAppliedInputTypes.HateThreatening.TEXT)
                        )
                        .illicit(listOf(Moderation.CategoryAppliedInputTypes.Illicit.TEXT))
                        .illicitViolent(
                            listOf(Moderation.CategoryAppliedInputTypes.IllicitViolent.TEXT)
                        )
                        .selfHarm(listOf(Moderation.CategoryAppliedInputTypes.SelfHarm.TEXT))
                        .selfHarmInstructions(
                            listOf(Moderation.CategoryAppliedInputTypes.SelfHarmInstruction.TEXT)
                        )
                        .selfHarmIntent(
                            listOf(Moderation.CategoryAppliedInputTypes.SelfHarmIntent.TEXT)
                        )
                        .sexual(listOf(Moderation.CategoryAppliedInputTypes.Sexual.TEXT))
                        .sexualMinors(listOf(Moderation.CategoryAppliedInputTypes.SexualMinor.TEXT))
                        .violence(listOf(Moderation.CategoryAppliedInputTypes.Violence.TEXT))
                        .violenceGraphic(
                            listOf(Moderation.CategoryAppliedInputTypes.ViolenceGraphic.TEXT)
                        )
                        .build()
                )
                .categoryScores(
                    Moderation.CategoryScores.builder()
                        .harassment(0.0)
                        .harassmentThreatening(0.0)
                        .hate(0.0)
                        .hateThreatening(0.0)
                        .illicit(0.0)
                        .illicitViolent(0.0)
                        .selfHarm(0.0)
                        .selfHarmInstructions(0.0)
                        .selfHarmIntent(0.0)
                        .sexual(0.0)
                        .sexualMinors(0.0)
                        .violence(0.0)
                        .violenceGraphic(0.0)
                        .build()
                )
                .flagged(true)
                .build()
        assertThat(moderation).isNotNull
        assertThat(moderation.categories())
            .isEqualTo(
                Moderation.Categories.builder()
                    .harassment(true)
                    .harassmentThreatening(true)
                    .hate(true)
                    .hateThreatening(true)
                    .illicit(true)
                    .illicitViolent(true)
                    .selfHarm(true)
                    .selfHarmInstructions(true)
                    .selfHarmIntent(true)
                    .sexual(true)
                    .sexualMinors(true)
                    .violence(true)
                    .violenceGraphic(true)
                    .build()
            )
        assertThat(moderation.categoryAppliedInputTypes())
            .isEqualTo(
                Moderation.CategoryAppliedInputTypes.builder()
                    .harassment(listOf(Moderation.CategoryAppliedInputTypes.Harassment.TEXT))
                    .harassmentThreatening(
                        listOf(Moderation.CategoryAppliedInputTypes.HarassmentThreatening.TEXT)
                    )
                    .hate(listOf(Moderation.CategoryAppliedInputTypes.Hate.TEXT))
                    .hateThreatening(
                        listOf(Moderation.CategoryAppliedInputTypes.HateThreatening.TEXT)
                    )
                    .illicit(listOf(Moderation.CategoryAppliedInputTypes.Illicit.TEXT))
                    .illicitViolent(
                        listOf(Moderation.CategoryAppliedInputTypes.IllicitViolent.TEXT)
                    )
                    .selfHarm(listOf(Moderation.CategoryAppliedInputTypes.SelfHarm.TEXT))
                    .selfHarmInstructions(
                        listOf(Moderation.CategoryAppliedInputTypes.SelfHarmInstruction.TEXT)
                    )
                    .selfHarmIntent(
                        listOf(Moderation.CategoryAppliedInputTypes.SelfHarmIntent.TEXT)
                    )
                    .sexual(listOf(Moderation.CategoryAppliedInputTypes.Sexual.TEXT))
                    .sexualMinors(listOf(Moderation.CategoryAppliedInputTypes.SexualMinor.TEXT))
                    .violence(listOf(Moderation.CategoryAppliedInputTypes.Violence.TEXT))
                    .violenceGraphic(
                        listOf(Moderation.CategoryAppliedInputTypes.ViolenceGraphic.TEXT)
                    )
                    .build()
            )
        assertThat(moderation.categoryScores())
            .isEqualTo(
                Moderation.CategoryScores.builder()
                    .harassment(0.0)
                    .harassmentThreatening(0.0)
                    .hate(0.0)
                    .hateThreatening(0.0)
                    .illicit(0.0)
                    .illicitViolent(0.0)
                    .selfHarm(0.0)
                    .selfHarmInstructions(0.0)
                    .selfHarmIntent(0.0)
                    .sexual(0.0)
                    .sexualMinors(0.0)
                    .violence(0.0)
                    .violenceGraphic(0.0)
                    .build()
            )
        assertThat(moderation.flagged()).isEqualTo(true)
    }
}
