package de.nccloud.reporting.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 kotlin.Any 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 = "type", defaultImpl = de.nccloud.reporting.api.v0.models.ReportingEvent.ReportingEventUndefined::class ) @JsonSubTypes( JsonSubTypes.Type(value = de.nccloud.reporting.api.v0.models.ReportingEvent.UpdateEvent::class, name = "update_event"), JsonSubTypes.Type(value = de.nccloud.reporting.api.v0.models.ReportingEvent.DeleteEvent::class, name = "delete_event"), JsonSubTypes.Type(value = de.nccloud.reporting.api.v0.models.ReportingEvent.ReportingEventUndefined::class) ) sealed class ReportingEvent { /** * This code was generated by [models.generator.kotlin.KotlinGenerator] * Deletes a reporting entity defined by its `tracking_id`. */ @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE) data class DeleteEvent( @JsonProperty("tracking_id") @get:JsonProperty("tracking_id") val trackingId: String, @JsonProperty("audit") @get:JsonProperty("audit") val audit: de.nccloud.common.v0.models.Audit ) : ReportingEvent(), Serializable { fun toJsonString(): String = de.nccloud.reporting.api.v0.models.JacksonObjectMapperFactory.create().writeValueAsString(this) companion object { fun parseJson(json: String): DeleteEvent = de.nccloud.reporting.api.v0.models.JacksonObjectMapperFactory.create().readValue( json, DeleteEvent::class.java) } } /** * This code was generated by [models.generator.kotlin.KotlinGenerator] * Updates one or more data fields. */ @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE) data class UpdateEvent( @JsonProperty("tracking_id") @get:JsonProperty("tracking_id") val trackingId: String, @JsonProperty("payload") @get:JsonProperty("payload") val payload: Any, @JsonProperty("audit") @get:JsonProperty("audit") val audit: de.nccloud.common.v0.models.Audit ) : ReportingEvent(), Serializable { fun toJsonString(): String = de.nccloud.reporting.api.v0.models.JacksonObjectMapperFactory.create().writeValueAsString(this) companion object { fun parseJson(json: String): UpdateEvent = de.nccloud.reporting.api.v0.models.JacksonObjectMapperFactory.create().readValue( json, UpdateEvent::class.java) } } @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE) object ReportingEventUndefined : ReportingEvent() companion object { fun parseJson(json: String): ReportingEvent = de.nccloud.reporting.api.v0.models.JacksonObjectMapperFactory.create().readValue( json, ReportingEvent::class.java) } }