diff --git a/kotlin/services/eventbridge/build.gradle.kts b/kotlin/services/eventbridge/build.gradle.kts index 1795c3a6c69..b9447ba38f9 100644 --- a/kotlin/services/eventbridge/build.gradle.kts +++ b/kotlin/services/eventbridge/build.gradle.kts @@ -18,7 +18,7 @@ buildscript { maven("https://plugins.gradle.org/m2/") } dependencies { - classpath("org.jlleitschuh.gradle:ktlint-gradle:10.3.0") + classpath("org.jlleitschuh.gradle:ktlint-gradle:12.1.1") } } @@ -37,7 +37,7 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter:5.9.2") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") } -tasks.withType() { +tasks.withType { kotlinOptions.jvmTarget = "17" } tasks.test { diff --git a/kotlin/services/eventbridge/src/main/kotlin/com/kotlin/eventbridge/CreateRuleSchedule.kt b/kotlin/services/eventbridge/src/main/kotlin/com/kotlin/eventbridge/CreateRuleSchedule.kt index 3b2729692f3..f03405da061 100644 --- a/kotlin/services/eventbridge/src/main/kotlin/com/kotlin/eventbridge/CreateRuleSchedule.kt +++ b/kotlin/services/eventbridge/src/main/kotlin/com/kotlin/eventbridge/CreateRuleSchedule.kt @@ -49,7 +49,7 @@ suspend fun main(args: Array) { // snippet-start:[eventbridge.kotlin._create_schedule_rule.main] suspend fun createScRule( ruleName: String?, - cronExpression: String? + cronExpression: String?, ) { val ruleRequest = PutRuleRequest { @@ -72,7 +72,7 @@ suspend fun putRuleTarget( ruleName: String?, lambdaARN: String, json: String?, - targetId: String + targetId: String, ) { val lambdaTarget = Target { diff --git a/kotlin/services/eventbridge/src/main/kotlin/com/kotlin/eventbridge/EventbridgeMVP.kt b/kotlin/services/eventbridge/src/main/kotlin/com/kotlin/eventbridge/EventbridgeMVP.kt index 54c4edc3c67..4093167ef16 100644 --- a/kotlin/services/eventbridge/src/main/kotlin/com/kotlin/eventbridge/EventbridgeMVP.kt +++ b/kotlin/services/eventbridge/src/main/kotlin/com/kotlin/eventbridge/EventbridgeMVP.kt @@ -3,6 +3,7 @@ package com.kotlin.eventbridge +// snippet-start:[eventbridge.kotlin.mvp.main] import aws.sdk.kotlin.services.eventbridge.EventBridgeClient import aws.sdk.kotlin.services.eventbridge.model.DeleteRuleRequest import aws.sdk.kotlin.services.eventbridge.model.DescribeRuleRequest @@ -53,7 +54,6 @@ import java.util.Scanner import java.util.UUID import kotlin.system.exitProcess -// snippet-start:[eventbridge.kotlin.mvp.main] /* Before running this Kotlin code example, set up your development environment, including your credentials. @@ -248,7 +248,7 @@ suspend fun cleanupResources( topicArn: String?, eventRuleName: String?, bucketName: String?, - roleName: String? + roleName: String?, ) { println("Removing all targets from the event rule.") deleteTargetsFromRule(eventRuleName) @@ -296,7 +296,7 @@ suspend fun deleteS3Bucket(bucketName: String?) { toDelete.add( ObjectIdentifier { key = myValue.key - } + }, ) } } @@ -407,7 +407,7 @@ suspend fun triggerCustomRule(email: String) { // snippet-start:[eventbridge.kotlin._put_target.custom.transform.main] suspend fun updateCustomRuleTargetWithTransform( topicArn: String?, - ruleName: String? + ruleName: String?, ) { val targetId = UUID.randomUUID().toString() @@ -459,7 +459,7 @@ suspend fun updateToCustomRule(ruleName: String?) { // Update an Amazon S3 object created rule with a transform on the target. suspend fun updateSnsEventRule( topicArn: String?, - ruleName: String? + ruleName: String?, ) { val targetId = UUID.randomUUID().toString() val myMap = mutableMapOf() @@ -507,7 +507,7 @@ suspend fun checkRule(eventRuleName: String?) { // snippet-start:[eventbridge.kotlin.disable.rule.main] suspend fun changeRuleState( eventRuleName: String, - isEnabled: Boolean? + isEnabled: Boolean?, ) { if (!isEnabled!!) { println("Disabling the rule: $eventRuleName") @@ -593,7 +593,7 @@ suspend fun addSnsEventRule( topicArn: String?, topicName: String, eventRuleName: String, - bucketName: String + bucketName: String, ) { val targetID = UUID.randomUUID().toString() val myTarget = @@ -621,7 +621,7 @@ suspend fun addSnsEventRule( suspend fun subEmail( topicArnVal: String?, - email: String? + email: String?, ) { val request = SubscribeRequest { @@ -691,7 +691,7 @@ suspend fun listRules() { suspend fun addEventRule( roleArnVal: String?, bucketName: String, - eventRuleName: String? + eventRuleName: String?, ) { val pattern = """{ "source": ["aws.s3"], @@ -778,7 +778,7 @@ suspend fun checkBucket(bucketName: String?): Boolean { suspend fun createIAMRole( rolenameVal: String?, - polJSON: String? + polJSON: String?, ): String? { val request = CreateRoleRequest { diff --git a/kotlin/services/eventbridge/src/test/kotlin/EventBridgeKotlinTest.kt b/kotlin/services/eventbridge/src/test/kotlin/EventBridgeKotlinTest.kt index 5963c275848..b49a7b88145 100644 --- a/kotlin/services/eventbridge/src/test/kotlin/EventBridgeKotlinTest.kt +++ b/kotlin/services/eventbridge/src/test/kotlin/EventBridgeKotlinTest.kt @@ -1,9 +1,5 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -/* - Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - SPDX-License-Identifier: Apache-2.0 -*/ import com.kotlin.eventbridge.listBusesHello import kotlinx.coroutines.runBlocking