Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalafmt-core to 3.7.3 #362

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.7.3
f5635f11b2aa3dca62348c5e2e77fb53338c8e58
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.4.3"
version = "3.7.3"
runner.dialect = scala213
style = default
maxColumn = 100
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
31 changes: 17 additions & 14 deletions src/main/scala/ciris/aws/ssm/Param.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import cats.effect.Async
import cats.implicits.{catsSyntaxApplicativeError, toFunctorOps}
import ciris.{ConfigKey, ConfigValue, Effect}
import software.amazon.awssdk.services.ssm.SsmAsyncClient
import software.amazon.awssdk.services.ssm.model.{GetParameterRequest, GetParameterResponse, ParameterNotFoundException}
import software.amazon.awssdk.services.ssm.model.{
GetParameterRequest,
GetParameterResponse,
ParameterNotFoundException
}

sealed abstract class Param[F[_]] {
def apply(key: String): ConfigValue[F, String]
Expand Down Expand Up @@ -35,23 +39,22 @@ private[ssm] object Param {
loaded.getOrElse(ConfigValue.missing(configKey))
}


final def fromAsync[F[_]: Async](client: SsmAsyncClient): Param[F] =
new Param[F] {
override final def apply(key: String): ConfigValue[F, String] =
ConfigValue.eval {
val configKey = buildKey(key)
Async[F]
.fromCompletableFuture(
Async[F].delay(
client.getParameter(buildRequest(key))
)
ConfigValue.eval {
val configKey = buildKey(key)
Async[F]
.fromCompletableFuture(
Async[F].delay(
client.getParameter(buildRequest(key))
)
.map(result => awsResponseToConfigValue(configKey, result).covary[F])
.handleError {
case _: ParameterNotFoundException => ConfigValue.missing(configKey)
}
}
)
.map(result => awsResponseToConfigValue(configKey, result).covary[F])
.handleError { case _: ParameterNotFoundException =>
ConfigValue.missing(configKey)
}
}
}

}