Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
fix(style): adapt to newer Scala style
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Aug 24, 2024
1 parent 75b4a8a commit a52c9a7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/scala/net.rfc1149/octopush/Octopush.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class Octopush(userLogin: String, apiKey: String)(implicit system: ActorSystem)

import Octopush._

private[this] implicit val executionContext: ExecutionContext = system.dispatcher
private[this] implicit val log: LoggingAdapter = system.log
private[this] val apiPool = Http().cachedHostConnectionPoolHttps[NotUsed]("www.octopush-dm.com")
private implicit val executionContext: ExecutionContext = system.dispatcher
private implicit val log: LoggingAdapter = system.log
private val apiPool = Http().cachedHostConnectionPoolHttps[NotUsed]("www.octopush-dm.com")

private[this] def apiRequest[T](path: String, fields: (String, String)*)(implicit ev: Unmarshaller[NodeSeq, T]): Future[T] = {
val formData = FormData(Seq("user_login" -> userLogin, "api_key" -> apiKey) ++ fields: _*)
private def apiRequest[T](path: String, fields: (String, String)*)(implicit ev: Unmarshaller[NodeSeq, T]): Future[T] = {
val formData = FormData(Seq("user_login" -> userLogin, "api_key" -> apiKey) ++ fields*)
val request = Post(s"/api/$path", formData).addHeader(Accept(MediaTypes.`application/xml`))
log.debug("Posting {}", request)
Source.single((request, NotUsed)).via(apiPool).runWith(Sink.head).map(_._1).flatMap {
Expand All @@ -52,7 +52,7 @@ class Octopush(userLogin: String, apiKey: String)(implicit system: ActorSystem)

def credit(): Future[Double] = apiRequest("credit")(creditUnmarshaller)

def sms(sms: SMS): Future[SMSResult] = apiRequest("sms", sms.buildParameters.toSeq: _*)(smsResultUnmarshaller)
def sms(sms: SMS): Future[SMSResult] = apiRequest("sms", sms.buildParameters.toSeq*)(smsResultUnmarshaller)

}

Expand Down

0 comments on commit a52c9a7

Please sign in to comment.