Skip to content

Commit 52df0f0

Browse files
committed
updated the Kotlin SDK build
1 parent 5762d3c commit 52df0f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+78
-80
lines changed

kotlin/services/appsync/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

33
plugins {
4-
kotlin("jvm") version "1.9.0"
4+
kotlin("jvm") version "2.0.0"
55
application
66
}
77

@@ -27,7 +27,7 @@ repositories {
2727
}
2828
apply(plugin = "org.jlleitschuh.gradle.ktlint")
2929
dependencies {
30-
implementation(platform("aws.sdk.kotlin:bom:1.3.112"))
30+
implementation(platform("aws.sdk.kotlin:bom:1.4.119"))
3131
implementation("aws.sdk.kotlin:appsync")
3232
implementation("aws.sdk.kotlin:sts")
3333
implementation("aws.sdk.kotlin:s3")

kotlin/services/appsync/src/main/kotlin/com/example/appsync/CreateApiKey.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ suspend fun createKey(apiIdVal: String): String? {
4242
description = "Created using the AWS SDK for Kotlin"
4343
}
4444

45-
AppSyncClient { region = "us-east-1" }.use { appClient ->
45+
AppSyncClient.fromEnvironment { region = "us-east-1" }.use { appClient ->
4646
val response = appClient.createApiKey(apiKeyRequest)
4747
return response.apiKey?.id
4848
}

kotlin/services/appsync/src/main/kotlin/com/example/appsync/CreateDataSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ suspend fun createDS(
6868
type = DataSourceType.AmazonDynamodb
6969
}
7070

71-
AppSyncClient { region = "us-east-1" }.use { appClient ->
71+
AppSyncClient.fromEnvironment { region = "us-east-1" }.use { appClient ->
7272
val response = appClient.createDataSource(request)
7373
return response.dataSource?.dataSourceArn
7474
}

kotlin/services/appsync/src/main/kotlin/com/example/appsync/DeleteApiKey.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ suspend fun deleteKey(
4747
id = keyIdVal
4848
}
4949

50-
AppSyncClient { region = "us-east-1" }.use { appClient ->
50+
AppSyncClient.fromEnvironment { region = "us-east-1" }.use { appClient ->
5151
appClient.deleteApiKey(apiKeyRequest)
5252
println("$keyIdVal key was deleted.")
5353
}

kotlin/services/appsync/src/main/kotlin/com/example/appsync/DeleteDataSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ suspend fun deleteDS(
4747
name = dsName
4848
}
4949

50-
AppSyncClient { region = "us-east-1" }.use { appClient ->
50+
AppSyncClient.fromEnvironment { region = "us-east-1" }.use { appClient ->
5151
appClient.deleteDataSource(request)
5252
println("The data source was deleted.")
5353
}

kotlin/services/appsync/src/main/kotlin/com/example/appsync/GetDataSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ suspend fun getDS(apiIdVal: String?, dsName: String?) {
4444
name = dsName
4545
}
4646

47-
AppSyncClient { region = "us-east-1" }.use { appClient ->
47+
AppSyncClient.fromEnvironment { region = "us-east-1" }.use { appClient ->
4848
val response = appClient.getDataSource(request)
4949
println("The DataSource ARN is ${response.dataSource?.dataSourceArn}")
5050
}

kotlin/services/appsync/src/main/kotlin/com/example/appsync/ListApiKeys.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ suspend fun getKeys(apiIdVal: String?) {
4141
apiId = apiIdVal
4242
}
4343

44-
AppSyncClient { region = "us-east-1" }.use { appClient ->
44+
AppSyncClient.fromEnvironment { region = "us-east-1" }.use { appClient ->
4545
val response = appClient.listApiKeys(request)
4646
response.apiKeys?.forEach { key ->
4747
println("The key Id is ${key.id}")

kotlin/services/appsync/src/main/kotlin/com/example/appsync/ListGraphqlApis.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ suspend fun main() {
2222

2323
// snippet-start:[appsync.kotlin.get_apis.main]
2424
suspend fun getApis() {
25-
AppSyncClient { region = "us-east-1" }.use { appClient ->
25+
AppSyncClient.fromEnvironment { region = "us-east-1" }.use { appClient ->
2626
val response = appClient.listGraphqlApis(ListGraphqlApisRequest {})
2727
response.graphqlApis?.forEach { graph ->
2828
println("The name of the graph api is ${graph.name}")

kotlin/services/athena/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

33
plugins {
4-
kotlin("jvm") version "1.9.0"
4+
kotlin("jvm") version "2.0.0"
55
application
66
}
77

@@ -27,7 +27,7 @@ repositories {
2727
}
2828
apply(plugin = "org.jlleitschuh.gradle.ktlint")
2929
dependencies {
30-
implementation(platform("aws.sdk.kotlin:bom:1.3.112"))
30+
implementation(platform("aws.sdk.kotlin:bom:1.4.119"))
3131
implementation("aws.sdk.kotlin:athena")
3232
implementation("aws.sdk.kotlin:secretsmanager")
3333
implementation("aws.smithy.kotlin:http-client-engine-okhttp")

kotlin/services/athena/src/main/kotlin/com/kotlin/athena/CreateNamedQueryExample.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ suspend fun main(args: Array<String>) {
3434

3535
// snippet-start:[athena.kotlin.CreateNamedQueryExample.main]
3636
suspend fun createNamedQuery(queryStringVal: String, namedQuery: String, databaseVal: String): String? {
37-
AthenaClient { region = "us-west-2" }.use { athenaClient ->
37+
AthenaClient.fromEnvironment { region = "us-west-2" }.use { athenaClient ->
3838
val resp = athenaClient.createNamedQuery(
3939
CreateNamedQueryRequest {
4040
database = databaseVal

0 commit comments

Comments
 (0)