Skip to content

Commit f80a720

Browse files
committed
update snapStart parameter type
1 parent 9a65c0a commit f80a720

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

AwsLambdaApi.scala

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ object AwsLambdaApi {
176176
* The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU
177177
* allocation. The default value is 128 MB. The value can be any multiple of 1 MB.
178178
* @param snapStart
179-
* Enable SnapStart if true
179+
* The function's SnapStart setting.
180180
*/
181181
inline def updateFunctionConfiguration(
182182
lambdaArn: String,
183183
runtime: Option[Runtime] = None,
184184
handler: Option[String] = None,
185185
memorySize: Option[Int] = None,
186186
timeout: Option[Int] = None,
187-
snapStart: Option[Boolean] = None
187+
snapStart: Option[SnapStart] = None
188188
)(using aws: AwsClient) =
189189
AwsClient.invoke(s"updateFunctionConfiguration") {
190190
val (revisionId, codeSha256) = {
@@ -197,13 +197,7 @@ object AwsLambdaApi {
197197
.optionally(handler, _.handler)
198198
.optionally(memorySize, b => i => b.memorySize(Integer.valueOf(i)))
199199
.optionally(timeout, b => i => b.timeout(Integer.valueOf(i)))
200-
.optionally(
201-
snapStart,
202-
b => {
203-
case true => b.snapStart(SnapStart.builder().applyOn(SnapStartApplyOn.PUBLISHED_VERSIONS).build())
204-
case false => b.snapStart(SnapStart.builder().applyOn(SnapStartApplyOn.NONE).build())
205-
}
206-
)
200+
.optionally(snapStart, b => s => b.snapStart(s))
207201
.build()
208202
)
209203
(response.revisionId(), response.codeSha256())

0 commit comments

Comments
 (0)