package solutions.poole.questlog.api.v0.models import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSubTypes import com.fasterxml.jackson.annotation.JsonTypeInfo import java.io.Serializable import java.util.UUID import kotlin.String /** * This code was generated by [models.generator.kotlin.KotlinGenerator] */ @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeInfo( use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY, property = "discriminator", defaultImpl = solutions.poole.questlog.api.v0.models.Person.PersonUndefined::class ) @JsonSubTypes( JsonSubTypes.Type(value = solutions.poole.questlog.api.v0.models.Person.Guest::class, name = "guest"), JsonSubTypes.Type(value = solutions.poole.questlog.api.v0.models.Person.User::class, name = "user"), JsonSubTypes.Type(value = solutions.poole.questlog.api.v0.models.Person.PersonUndefined::class) ) sealed class Person { /** * This code was generated by [models.generator.kotlin.KotlinGenerator] */ @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE) data class Guest( @JsonProperty("email") @get:JsonProperty("email") val email: String?, @JsonProperty("name") @get:JsonProperty("name") val name: String? ) : Person(), Serializable { fun toJsonString(): String = solutions.poole.questlog.api.v0.models.JacksonObjectMapperFactory.create().writeValueAsString(this) companion object { fun parseJson(json: String): Guest = solutions.poole.questlog.api.v0.models.JacksonObjectMapperFactory.create().readValue( json, Guest::class.java) } } /** * This code was generated by [models.generator.kotlin.KotlinGenerator] */ @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE) data class User( @JsonProperty("guid") @get:JsonProperty("guid") val guid: UUID, @JsonProperty("email") @get:JsonProperty("email") val email: String?, @JsonProperty("name") @get:JsonProperty("name") val name: String? ) : Person(), Serializable { fun toJsonString(): String = solutions.poole.questlog.api.v0.models.JacksonObjectMapperFactory.create().writeValueAsString(this) companion object { fun parseJson(json: String): User = solutions.poole.questlog.api.v0.models.JacksonObjectMapperFactory.create().readValue( json, User::class.java) } } @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE) object PersonUndefined : Person() companion object { fun parseJson(json: String): Person = solutions.poole.questlog.api.v0.models.JacksonObjectMapperFactory.create().readValue( json, Person::class.java) } }