Skip to content

Commit

Permalink
cleaned up kotlin files
Browse files Browse the repository at this point in the history
  • Loading branch information
scmacdon authored and Laren-AWS committed Jun 18, 2024
1 parent 216f4b7 commit e571365
Show file tree
Hide file tree
Showing 40 changed files with 15 additions and 869 deletions.
3 changes: 1 addition & 2 deletions kotlin/services/bedrock/src/test/kotlin/BedrockTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import org.junit.jupiter.api.TestMethodOrder
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(OrderAnnotation::class)
class BedrockTest {

@Test
@Order(1)
fun ListFoundationModels() = runBlocking {
fun listFoundationModels() = runBlocking {
val modelSummaries = listFoundationModels()
assertFalse(modelSummaries!!.isEmpty())
}
Expand Down
2 changes: 1 addition & 1 deletion kotlin/services/sts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildscript {
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.5.1")
classpath("org.jlleitschuh.gradle:ktlint-gradle:12.1.1")
}
}

Expand Down
Binary file not shown.

This file was deleted.

185 changes: 0 additions & 185 deletions kotlin/usecases/creating_pam/gradlew

This file was deleted.

89 changes: 0 additions & 89 deletions kotlin/usecases/creating_pam/gradlew.bat

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import kotlinx.coroutines.runBlocking
import java.util.TreeMap

class GetHandler : RequestHandler<APIGatewayProxyRequestEvent?, APIGatewayProxyResponseEvent?> {
val CORS_HEADER_MAP: Map<String, String> = java.util.Map.of("Access-Control-Allow-Origin", "*")
val corsHeaderMap: Map<String, String> = java.util.Map.of("Access-Control-Allow-Origin", "*")

fun toJson(src: Any?): String? {
val gson = Gson()
Expand All @@ -33,7 +33,7 @@ class GetHandler : RequestHandler<APIGatewayProxyRequestEvent?, APIGatewayProxyR

fun makeResponse(src: Any?): APIGatewayProxyResponseEvent = APIGatewayProxyResponseEvent()
.withStatusCode(200)
.withHeaders(CORS_HEADER_MAP)
.withHeaders(corsHeaderMap)
.withBody(toJson(src))
.withIsBase64Encoded(false)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import kotlinx.coroutines.runBlocking
import java.util.UUID

class UploadHandler : RequestHandler<APIGatewayProxyRequestEvent?, APIGatewayProxyResponseEvent?> {
val CORS_HEADER_MAP: Map<String, String> = java.util.Map.of("Access-Control-Allow-Origin", "*")
val corsHeaderMap: Map<String, String> = java.util.Map.of("Access-Control-Allow-Origin", "*")

fun toJson(src: Any?): String? {
val gson = Gson()
Expand All @@ -30,7 +30,7 @@ class UploadHandler : RequestHandler<APIGatewayProxyRequestEvent?, APIGatewayPro
if (fileName == null || fileName == "") {
return@runBlocking APIGatewayProxyResponseEvent()
.withStatusCode(400)
.withHeaders(CORS_HEADER_MAP)
.withHeaders(corsHeaderMap)
.withBody("{\"error\":\"Missing filename\"}")
.withIsBase64Encoded(false)
}
Expand All @@ -45,7 +45,7 @@ class UploadHandler : RequestHandler<APIGatewayProxyRequestEvent?, APIGatewayPro

fun makeResponse(src: Any?): APIGatewayProxyResponseEvent = APIGatewayProxyResponseEvent()
.withStatusCode(200)
.withHeaders(CORS_HEADER_MAP)
.withHeaders(corsHeaderMap)
.withBody(toJson(src))
.withIsBase64Encoded(false)
}
Expand Down
Loading

0 comments on commit e571365

Please sign in to comment.