Skip to content

Commit 9621476

Browse files
committed
Fixes linting errors across the full Kotlin directory.
1 parent e0387c9 commit 9621476

File tree

367 files changed

+22283
-22851
lines changed

Some content is hidden

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

367 files changed

+22283
-22851
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
1-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2-
// SPDX-License-Identifier: Apache-2.0
3-
4-
package com.kotlin.gateway
5-
6-
// snippet-start:[apigateway.kotlin.create_deployment.import]
7-
import aws.sdk.kotlin.services.apigateway.ApiGatewayClient
8-
import aws.sdk.kotlin.services.apigateway.model.CreateDeploymentRequest
9-
import kotlin.system.exitProcess
10-
// snippet-end:[apigateway.kotlin.create_deployment.import]
11-
12-
suspend fun main(args:Array<String>) {
13-
14-
val usage = """
15-
Usage:
16-
<restApiId> <stageName>
17-
18-
Where:
19-
restApiId - The string identifier of the associated RestApi. (for example, xxxx99ewyg).
20-
stageName - The name of the stage.
21-
"""
22-
23-
if (args.size != 2) {
24-
println(usage)
25-
exitProcess(0)
26-
}
27-
28-
val restApiId = args[0]
29-
val stageName = args[1]
30-
createNewDeployment(restApiId, stageName)
31-
}
32-
33-
// snippet-start:[apigateway.kotlin.create_deployment.main]
34-
suspend fun createNewDeployment(restApiIdVal: String?, stageNameVal: String?): String? {
35-
36-
val request = CreateDeploymentRequest {
37-
restApiId = restApiIdVal
38-
description = "Created using the AWS API Gateway Kotlin API"
39-
stageName = stageNameVal
40-
}
41-
42-
ApiGatewayClient { region = "us-east-1" }.use { apiGateway ->
43-
val response = apiGateway.createDeployment(request)
44-
println("The id of the deployment is " + response.id)
45-
return response.id
46-
}
47-
}
48-
// snippet-end:[apigateway.kotlin.create_deployment.main]
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package com.kotlin.gateway
5+
6+
// snippet-start:[apigateway.kotlin.create_deployment.import]
7+
import aws.sdk.kotlin.services.apigateway.ApiGatewayClient
8+
import aws.sdk.kotlin.services.apigateway.model.CreateDeploymentRequest
9+
import kotlin.system.exitProcess
10+
// snippet-end:[apigateway.kotlin.create_deployment.import]
11+
12+
suspend fun main(args: Array<String>) {
13+
val usage = """
14+
Usage:
15+
<restApiId> <stageName>
16+
17+
Where:
18+
restApiId - The string identifier of the associated RestApi. (for example, xxxx99ewyg).
19+
stageName - The name of the stage.
20+
"""
21+
22+
if (args.size != 2) {
23+
println(usage)
24+
exitProcess(0)
25+
}
26+
27+
val restApiId = args[0]
28+
val stageName = args[1]
29+
createNewDeployment(restApiId, stageName)
30+
}
31+
32+
// snippet-start:[apigateway.kotlin.create_deployment.main]
33+
suspend fun createNewDeployment(restApiIdVal: String?, stageNameVal: String?): String? {
34+
val request = CreateDeploymentRequest {
35+
restApiId = restApiIdVal
36+
description = "Created using the AWS API Gateway Kotlin API"
37+
stageName = stageNameVal
38+
}
39+
40+
ApiGatewayClient { region = "us-east-1" }.use { apiGateway ->
41+
val response = apiGateway.createDeployment(request)
42+
println("The id of the deployment is " + response.id)
43+
return response.id
44+
}
45+
}
46+
// snippet-end:[apigateway.kotlin.create_deployment.main]
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,44 @@
1-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2-
// SPDX-License-Identifier: Apache-2.0
3-
4-
package com.kotlin.gateway
5-
6-
// snippet-start:[apigateway.kotlin.create_api.import]
7-
import aws.sdk.kotlin.services.apigateway.ApiGatewayClient
8-
import aws.sdk.kotlin.services.apigateway.model.CreateRestApiRequest
9-
import kotlin.system.exitProcess
10-
// snippet-end:[apigateway.kotlin.create_api.import]
11-
12-
suspend fun main(args:Array<String>) {
13-
14-
val usage = """
15-
Usage:
16-
<restApiId>
17-
18-
Where:
19-
restApiId - The string identifier of an existing RestApi. (for example, xxxx99ewyg).
20-
21-
"""
22-
23-
if (args.size != 1) {
24-
println(usage)
25-
exitProcess(0)
26-
}
27-
28-
val restApiId = args[0]
29-
createAPI(restApiId)
30-
}
31-
32-
// snippet-start:[apigateway.kotlin.create_api.main]
33-
suspend fun createAPI(restApiName: String?): String? {
34-
35-
val request = CreateRestApiRequest {
36-
description = "Created using the Gateway Kotlin API"
37-
name = restApiName
38-
}
39-
40-
ApiGatewayClient { region = "us-east-1" }.use { apiGateway ->
41-
val response = apiGateway.createRestApi(request)
42-
println("The id of the new api is ${response.id}")
43-
return response.id
44-
}
45-
}
46-
// snippet-end:[apigateway.kotlin.create_api.main]
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package com.kotlin.gateway
5+
6+
// snippet-start:[apigateway.kotlin.create_api.import]
7+
import aws.sdk.kotlin.services.apigateway.ApiGatewayClient
8+
import aws.sdk.kotlin.services.apigateway.model.CreateRestApiRequest
9+
import kotlin.system.exitProcess
10+
// snippet-end:[apigateway.kotlin.create_api.import]
11+
12+
suspend fun main(args: Array<String>) {
13+
val usage = """
14+
Usage:
15+
<restApiId>
16+
17+
Where:
18+
restApiId - The string identifier of an existing RestApi. (for example, xxxx99ewyg).
19+
20+
"""
21+
22+
if (args.size != 1) {
23+
println(usage)
24+
exitProcess(0)
25+
}
26+
27+
val restApiId = args[0]
28+
createAPI(restApiId)
29+
}
30+
31+
// snippet-start:[apigateway.kotlin.create_api.main]
32+
suspend fun createAPI(restApiName: String?): String? {
33+
val request = CreateRestApiRequest {
34+
description = "Created using the Gateway Kotlin API"
35+
name = restApiName
36+
}
37+
38+
ApiGatewayClient { region = "us-east-1" }.use { apiGateway ->
39+
val response = apiGateway.createRestApi(request)
40+
println("The id of the new api is ${response.id}")
41+
return response.id
42+
}
43+
}
44+
// snippet-end:[apigateway.kotlin.create_api.main]
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
1-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2-
// SPDX-License-Identifier: Apache-2.0
3-
4-
package com.kotlin.gateway
5-
6-
// snippet-start:[apigateway.kotlin.delete_api.import]
7-
import aws.sdk.kotlin.services.apigateway.ApiGatewayClient
8-
import aws.sdk.kotlin.services.apigateway.model.DeleteRestApiRequest
9-
import kotlin.system.exitProcess
10-
// snippet-end:[apigateway.kotlin.delete_api.import]
11-
12-
13-
suspend fun main(args:Array<String>) {
14-
15-
val usage = """
16-
Usage:
17-
<restApiId>
18-
19-
Where:
20-
restApiId - The string identifier of an existing RestApi. (for example, xxxx99ewyg).
21-
"""
22-
23-
if (args.size != 1) {
24-
println(usage)
25-
exitProcess(1)
26-
}
27-
28-
val restApiId = args[0]
29-
deleteAPI(restApiId)
30-
}
31-
32-
// snippet-start:[apigateway.kotlin.delete_api.main]
33-
suspend fun deleteAPI(restApiIdVal: String?) {
34-
35-
val request = DeleteRestApiRequest {
36-
restApiId = restApiIdVal
37-
}
38-
39-
ApiGatewayClient { region = "us-east-1" }.use { apiGateway ->
40-
apiGateway.deleteRestApi(request)
41-
println("The API was successfully deleted")
42-
}
43-
}
44-
// snippet-end:[apigateway.kotlin.delete_api.main]
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package com.kotlin.gateway
5+
6+
// snippet-start:[apigateway.kotlin.delete_api.import]
7+
import aws.sdk.kotlin.services.apigateway.ApiGatewayClient
8+
import aws.sdk.kotlin.services.apigateway.model.DeleteRestApiRequest
9+
import kotlin.system.exitProcess
10+
// snippet-end:[apigateway.kotlin.delete_api.import]
11+
12+
suspend fun main(args: Array<String>) {
13+
val usage = """
14+
Usage:
15+
<restApiId>
16+
17+
Where:
18+
restApiId - The string identifier of an existing RestApi. (for example, xxxx99ewyg).
19+
"""
20+
21+
if (args.size != 1) {
22+
println(usage)
23+
exitProcess(1)
24+
}
25+
26+
val restApiId = args[0]
27+
deleteAPI(restApiId)
28+
}
29+
30+
// snippet-start:[apigateway.kotlin.delete_api.main]
31+
suspend fun deleteAPI(restApiIdVal: String?) {
32+
val request = DeleteRestApiRequest {
33+
restApiId = restApiIdVal
34+
}
35+
36+
ApiGatewayClient { region = "us-east-1" }.use { apiGateway ->
37+
apiGateway.deleteRestApi(request)
38+
println("The API was successfully deleted")
39+
}
40+
}
41+
// snippet-end:[apigateway.kotlin.delete_api.main]
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2-
// SPDX-License-Identifier: Apache-2.0
3-
4-
package com.kotlin.gateway
5-
6-
// snippet-start:[apigateway.kotlin.get_apikeys.import]
7-
import aws.sdk.kotlin.services.apigateway.ApiGatewayClient
8-
import aws.sdk.kotlin.services.apigateway.model.GetApiKeysRequest
9-
// snippet-end:[apigateway.kotlin.get_apikeys.import]
10-
11-
suspend fun main() {
12-
getKeys()
13-
}
14-
15-
// snippet-start:[apigateway.kotlin.get_apikeys.main]
16-
suspend fun getKeys() {
17-
18-
ApiGatewayClient { region = "us-east-1" }.use { apiGateway ->
19-
val response = apiGateway.getApiKeys(GetApiKeysRequest { })
20-
response.items?.forEach { key ->
21-
println("Key is $key")
22-
}
23-
}
24-
}
25-
// snippet-end:[apigateway.kotlin.get_apikeys.main]
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package com.kotlin.gateway
5+
6+
// snippet-start:[apigateway.kotlin.get_apikeys.import]
7+
import aws.sdk.kotlin.services.apigateway.ApiGatewayClient
8+
import aws.sdk.kotlin.services.apigateway.model.GetApiKeysRequest
9+
// snippet-end:[apigateway.kotlin.get_apikeys.import]
10+
11+
suspend fun main() {
12+
getKeys()
13+
}
14+
15+
// snippet-start:[apigateway.kotlin.get_apikeys.main]
16+
suspend fun getKeys() {
17+
ApiGatewayClient { region = "us-east-1" }.use { apiGateway ->
18+
val response = apiGateway.getApiKeys(GetApiKeysRequest { })
19+
response.items?.forEach { key ->
20+
println("Key is $key")
21+
}
22+
}
23+
}
24+
// snippet-end:[apigateway.kotlin.get_apikeys.main]

0 commit comments

Comments
 (0)