/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1 * User agent: apibuilder app.apibuilder.io/speedwing/pagerduty-api/0.0.1/scala_models */ package com.speedwing.pagerduty.api.v0.models { final case class CreateEvent( serviceKey: String, eventType: com.speedwing.pagerduty.api.v0.models.EventType, incidentKey: _root_.scala.Option[String] = None, description: _root_.scala.Option[String] = None, details: _root_.scala.Option[_root_.play.api.libs.json.JsObject] = None, client: _root_.scala.Option[String] = None, clientUrl: _root_.scala.Option[String] = None, contexts: _root_.scala.Option[_root_.play.api.libs.json.JsObject] = None ) final case class Result( status: String, message: String, incidentKey: String ) sealed trait EventType extends _root_.scala.Product with _root_.scala.Serializable object EventType { case object Trigger extends EventType { override def toString = "trigger" } case object Acknowledge extends EventType { override def toString = "acknowledge" } case object Resolve extends EventType { override def toString = "resolve" } /** * UNDEFINED captures values that are sent either in error or * that were added by the server after this library was * generated. We want to make it easy and obvious to users of * this library to handle this case gracefully. * * We use all CAPS for the variable name to avoid collisions * with the camel cased values above. */ final case class UNDEFINED(override val toString: String) extends EventType /** * all returns a list of all the valid, known values. We use * lower case to avoid collisions with the camel cased values * above. */ val all: scala.List[EventType] = scala.List(Trigger, Acknowledge, Resolve) private val byName: Map[String, EventType] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): EventType = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[EventType] = byName.get(value.toLowerCase) } }