-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
674 additions
and
605 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 36 additions & 34 deletions
70
kotlin/services/keyspaces/src/main/kotlin/com/example/keyspace/HelloKeyspaces.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package com.example.keyspace | ||
|
||
import aws.sdk.kotlin.services.keyspaces.KeyspacesClient | ||
import aws.sdk.kotlin.services.keyspaces.model.ListKeyspacesRequest | ||
|
||
// snippet-start:[keyspace.kotlin.hello.main] | ||
/** | ||
Before running this Kotlin code example, set up your development environment, including your credentials. | ||
For more information, see the following documentation topic: | ||
https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/setup.html | ||
*/ | ||
|
||
suspend fun main() { | ||
listKeyspaces() | ||
} | ||
|
||
suspend fun listKeyspaces() { | ||
val keyspacesRequest = ListKeyspacesRequest { | ||
maxResults = 10 | ||
} | ||
|
||
KeyspacesClient { region = "us-east-1" }.use { keyClient -> | ||
val response = keyClient.listKeyspaces(keyspacesRequest) | ||
response.keyspaces?.forEach { keyspace -> | ||
println("The name of the keyspace is ${keyspace.keyspaceName}") | ||
} | ||
} | ||
} | ||
// snippet-end:[keyspace.kotlin.hello.main] | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package com.example.keyspace | ||
|
||
import aws.sdk.kotlin.services.keyspaces.KeyspacesClient | ||
import aws.sdk.kotlin.services.keyspaces.model.ListKeyspacesRequest | ||
|
||
// snippet-start:[keyspace.kotlin.hello.main] | ||
|
||
/** | ||
Before running this Kotlin code example, set up your development environment, including your credentials. | ||
For more information, see the following documentation topic: | ||
https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/setup.html | ||
*/ | ||
|
||
suspend fun main() { | ||
listKeyspaces() | ||
} | ||
|
||
suspend fun listKeyspaces() { | ||
val keyspacesRequest = | ||
ListKeyspacesRequest { | ||
maxResults = 10 | ||
} | ||
|
||
KeyspacesClient { region = "us-east-1" }.use { keyClient -> | ||
val response = keyClient.listKeyspaces(keyspacesRequest) | ||
response.keyspaces?.forEach { keyspace -> | ||
println("The name of the keyspace is ${keyspace.keyspaceName}") | ||
} | ||
} | ||
} | ||
// snippet-end:[keyspace.kotlin.hello.main] |
Oops, something went wrong.