All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.xebia.functional.openai.generated.model.CreateImageRequestModel.kt Maven / Gradle / Ivy

There is a newer version: 0.0.5-alpha.119
Show newest version
/**
 *
 * Please note:
 * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * Do not edit this file manually.
 *
 */

@file:Suppress(
    "ArrayInDataClass",
    "EnumEntryName",
    "RemoveRedundantQualifierName",
    "UnusedImport"
)

package com.xebia.functional.openai.generated.model


import kotlinx.serialization.*
import kotlinx.serialization.builtins.*
import kotlinx.serialization.encoding.*
import kotlin.jvm.JvmStatic
import com.xebia.functional.openai.generated.model.CreateImageRequestModel.Supported.dall_e_2
import com.xebia.functional.openai.generated.model.CreateImageRequestModel.Supported.dall_e_3


/**
 * The model to use for image generation.
 */
// We define a serializer for the parent sum type, and then use it to serialize the child types
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@Serializable(with = CreateImageRequestModelSerializer::class)
sealed interface CreateImageRequestModel {
  val value: kotlin.String

  @Serializable(with = CreateImageRequestModelSerializer::class)
  enum class Supported(override val value: kotlin.String) : CreateImageRequestModel {
    @SerialName(value = "dall-e-2") dall_e_2("dall-e-2"),@SerialName(value = "dall-e-3") dall_e_3("dall-e-3");

    override fun toString(): kotlin.String = value
  }

  @Serializable(with = CreateImageRequestModelSerializer::class)
  data class Custom(override val value: kotlin.String) : CreateImageRequestModel

    companion object {
      @JvmStatic
      fun valueOf(value: kotlin.String): CreateImageRequestModel =
        values().firstOrNull { it.value == value } ?: Custom(value)

      
          inline val dall_e_2: CreateImageRequestModel
            get() = Supported.dall_e_2
      
          inline val dall_e_3: CreateImageRequestModel
            get() = Supported.dall_e_3
      

      @JvmStatic fun values(): List = Supported.entries
    }
}

object CreateImageRequestModelSerializer : KSerializer {
    private val valueSerializer = kotlin.String.serializer()
    override val descriptor = valueSerializer.descriptor

    override fun deserialize(decoder: Decoder): CreateImageRequestModel {
        val value = decoder.decodeSerializableValue(valueSerializer)
        return CreateImageRequestModel.valueOf(value)
    }

    override fun serialize(encoder: Encoder, value: CreateImageRequestModel) {
        encoder.encodeSerializableValue(valueSerializer, value.value)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy