Skip to content

Instantly share code, notes, and snippets.

@adamw
Created May 18, 2020 08:08
Show Gist options
  • Save adamw/b1cfb9906d9c2c5c794eb513c4b4ba0a to your computer and use it in GitHub Desktop.
Save adamw/b1cfb9906d9c2c5c794eb513c4b4ba0a to your computer and use it in GitHub Desktop.
import java.util.UUID
import cats.effect.{ContextShift, IO, Timer}
import sttp.tapir._
import sttp.model.StatusCode
case class AuthToken(token: String)
case class Error(msg: String, statusCode: StatusCode)
case class User(id: UUID, name: String)
case class Pet(id: UUID, kind: String, name: String)
def authorize(authToken: AuthToken): IO[Either[Error, User]] = ???
def findPetForUser(user: User, id: UUID): IO[Either[Error, Option[Pet]]] = ???
def addPetToUser(user: User, pet: Pet): IO[Either[Error, Unit]] = ???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment