Skip to content

Commit

Permalink
Ugh http4s ...
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Jul 18, 2022
1 parent 72febd1 commit dcbe991
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ package com.armanbilge.sbt.bundlemon
import cats.effect.Concurrent
import cats.effect.Sync
import cats.syntax.all._
import io.circe.Encoder
import io.circe.Json
import org.http4s.EntityEncoder
import org.http4s.Headers
import org.http4s.Method
import org.http4s.Query
import org.http4s.Request
import org.http4s.Uri
import org.http4s.circe.CirceEntityDecoder
import org.http4s.circe.CirceEntityEncoder
import org.http4s.circe.CirceInstances
import org.http4s.client.Client

Expand Down Expand Up @@ -63,10 +64,13 @@ object BundleMonClient {

val baseUri = (endpoint / "v1").copy(query = authQuery)

new BundleMonClient[F] with CirceInstances with CirceEntityDecoder with CirceEntityEncoder {
new BundleMonClient[F] with CirceInstances with CirceEntityDecoder {

override protected val defaultPrinter = super.defaultPrinter.copy(dropNullValues = true)

implicit def circeEntityEncoder[A: Encoder]: EntityEncoder[F, A] =
jsonEncoderOf[F, A]

def getOrCreateProjectId(payload: GitDetails): F[Project] = {
val uri = baseUri / "projects" / "id"
client.expect(Request[F](Method.POST, uri, headers = headers).withEntity(payload))
Expand Down

0 comments on commit dcbe991

Please sign in to comment.