package com.gilt.svc.sundial.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 com.gilt.svc.sundial.v0.enums.NotificationOptions import java.io.Serializable import kotlin.Int 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 ) @JsonSubTypes( JsonSubTypes.Type(value = com.gilt.svc.sundial.v0.models.Notification.Email::class, name = "email"), JsonSubTypes.Type(value = com.gilt.svc.sundial.v0.models.Notification.Pagerduty::class, name = "pagerduty"), JsonSubTypes.Type(value = com.gilt.svc.sundial.v0.models.Notification.NotificationUndefined::class) ) sealed class Notification { /** * This code was generated by [models.generator.kotlin.KotlinGenerator] * An email to send notifications to */ @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE) data class Email( @JsonProperty("name") @get:JsonProperty("name") val name: String, @JsonProperty("email") @get:JsonProperty("email") val email: String, @JsonProperty("notify_when") @get:JsonProperty("notify_when") val notifyWhen: NotificationOptions ) : Notification(), Serializable { fun toJsonString(): String = com.gilt.svc.sundial.v0.models.JacksonObjectMapperFactory.create().writeValueAsString(this) companion object { fun parseJson(json: String): Email = com.gilt.svc.sundial.v0.models.JacksonObjectMapperFactory.create().readValue( json, Email::class.java) } } /** * This code was generated by [models.generator.kotlin.KotlinGenerator] * Pager Duty integration */ @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE) data class Pagerduty( @JsonProperty("service_key") @get:JsonProperty("service_key") val serviceKey: String, @JsonProperty("num_consecutive_failures") @get:JsonProperty("num_consecutive_failures") val numConsecutiveFailures: Int, @JsonProperty("api_url") @get:JsonProperty("api_url") val apiUrl: String ) : Notification(), Serializable { fun toJsonString(): String = com.gilt.svc.sundial.v0.models.JacksonObjectMapperFactory.create().writeValueAsString(this) companion object { fun parseJson(json: String): Pagerduty = com.gilt.svc.sundial.v0.models.JacksonObjectMapperFactory.create().readValue( json, Pagerduty::class.java) } } @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE) object NotificationUndefined : Notification() companion object { fun parseJson(json: String): Notification = com.gilt.svc.sundial.v0.models.JacksonObjectMapperFactory.create().readValue( json, Notification::class.java) } }