commonMain.com.xebia.functional.openai.generated.model.CreateImageEditRequestModel.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xef-openai-client Show documentation
Show all versions of xef-openai-client Show documentation
Building applications with LLMs through composability in Kotlin
/**
*
* 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.CreateImageEditRequestModel.Supported.dall_e_2
/**
* The model to use for image generation. Only `dall-e-2` is supported at this time.
*/
// We define a serializer for the parent sum type, and then use it to serialize the child types
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@Serializable(with = CreateImageEditRequestModelSerializer::class)
sealed interface CreateImageEditRequestModel {
val value: kotlin.String
@Serializable(with = CreateImageEditRequestModelSerializer::class)
enum class Supported(override val value: kotlin.String) : CreateImageEditRequestModel {
@SerialName(value = "dall-e-2") dall_e_2("dall-e-2");
override fun toString(): kotlin.String = value
}
@Serializable(with = CreateImageEditRequestModelSerializer::class)
data class Custom(override val value: kotlin.String) : CreateImageEditRequestModel
companion object {
@JvmStatic
fun valueOf(value: kotlin.String): CreateImageEditRequestModel =
values().firstOrNull { it.value == value } ?: Custom(value)
inline val dall_e_2: CreateImageEditRequestModel
get() = Supported.dall_e_2
@JvmStatic fun values(): List = Supported.entries
}
}
object CreateImageEditRequestModelSerializer : KSerializer {
private val valueSerializer = kotlin.String.serializer()
override val descriptor = valueSerializer.descriptor
override fun deserialize(decoder: Decoder): CreateImageEditRequestModel {
val value = decoder.decodeSerializableValue(valueSerializer)
return CreateImageEditRequestModel.valueOf(value)
}
override fun serialize(encoder: Encoder, value: CreateImageEditRequestModel) {
encoder.encodeSerializableValue(valueSerializer, value.value)
}
}