Last active
September 12, 2017 01:23
-
-
Save animatedlew/5bbf4e460afe284e56c3bc1d2580e328 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import eu.timepit.refined._ | |
| import eu.timepit.refined.string._ | |
| import eu.timepit.refined.api._ | |
| import io.circe.generic.auto._ | |
| import io.circe.parser._ | |
| import io.circe.syntax._ | |
| import io.circe.refined._ | |
| import Log._ | |
| case class Log(auth: Auth0, version: Version) | |
| object Log { | |
| val auth0 = W("auth0") | |
| val version = W("v([1-9]+)(\\.(\\d+)(\\.(\\d+))?)?") | |
| type Version = String Refined MatchesRegex[version.T] | |
| type Auth0 = String Refined StartsWith[auth0.T] | |
| } | |
| decode[Log]("""{"auth": "auth0","version": "v1.23.2"}""").map(_.asJson.noSpaces) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment