io.github.nafg.dialoguestate.CallInfo.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core_3 Show documentation
Show all versions of core_3 Show documentation
Define a Twilio app in terms of a sane call tree
The newest version!
package io.github.nafg.dialoguestate
import zio.ZIO
case class CallInfo(callId: String, callerId: Option[String])
object CallInfo {
// noinspection ScalaWeakerAccess
def maybeCallerId: ZIO[CallInfo, Nothing, Option[String]] =
ZIO.serviceWith[CallInfo](_.callerId)
def callerId: ZIO[CallInfo, String, String] =
maybeCallerId.someOrFail("No caller ID")
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy