From 9e8323d2cf1a5d403905601d586f14e7d9ca08f7 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Mon, 5 Jan 2026 10:30:06 -0500 Subject: [PATCH 1/7] bootstrap quickstart kotlin example --- settings.gradle.kts | 4 + .../server/example/CafeService.java | 2 +- .../server/example/CreateOrder.java | 2 +- .../server/example/GetMenu.java | 2 +- .../server/example/GetOrder.java | 2 +- .../server/example/Order.java | 2 +- .../server/example/OrderTracker.java | 2 +- smithy-kotlin-examples/README.MD | 2 + .../quickstart-kotlin/README.MD | 38 +++++++++ .../quickstart-kotlin/build.gradle.kts | 8 ++ .../quickstart-kotlin/client/build.gradle.kts | 53 ++++++++++++ .../client/smithy-build.json | 20 +++++ .../io/smithy/kotlin/client/example/Main.kt | 37 +++++++++ .../quickstart-kotlin/gradle.properties | 8 ++ .../quickstart-kotlin/license.txt | 4 + .../quickstart-kotlin/server/build.gradle.kts | 42 ++++++++++ .../server/smithy-build.json | 10 +++ .../kotlin/server/example/CafeService.java | 46 ++++++++++ .../kotlin/server/example/CreateOrder.java | 36 ++++++++ .../smithy/kotlin/server/example/GetMenu.java | 59 +++++++++++++ .../kotlin/server/example/GetOrder.java | 39 +++++++++ .../smithy/kotlin/server/example/Order.java | 19 +++++ .../kotlin/server/example/OrderTracker.java | 40 +++++++++ .../quickstart-kotlin/settings.gradle.kts | 20 +++++ .../quickstart-kotlin/smithy/build.gradle.kts | 24 ++++++ .../smithy/model/common.smithy | 27 ++++++ .../smithy/model/main.smithy | 32 +++++++ .../smithy/model/order.smithy | 83 +++++++++++++++++++ .../smithy/smithy-build.json | 3 + 29 files changed, 660 insertions(+), 6 deletions(-) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{java => kotlin}/server/example/CafeService.java (97%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{java => kotlin}/server/example/CreateOrder.java (96%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{java => kotlin}/server/example/GetMenu.java (98%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{java => kotlin}/server/example/GetOrder.java (97%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{java => kotlin}/server/example/Order.java (91%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{java => kotlin}/server/example/OrderTracker.java (96%) create mode 100644 smithy-kotlin-examples/README.MD create mode 100644 smithy-kotlin-examples/quickstart-kotlin/README.MD create mode 100644 smithy-kotlin-examples/quickstart-kotlin/build.gradle.kts create mode 100644 smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts create mode 100644 smithy-kotlin-examples/quickstart-kotlin/client/smithy-build.json create mode 100644 smithy-kotlin-examples/quickstart-kotlin/client/src/main/kotlin/io/smithy/kotlin/client/example/Main.kt create mode 100644 smithy-kotlin-examples/quickstart-kotlin/gradle.properties create mode 100644 smithy-kotlin-examples/quickstart-kotlin/license.txt create mode 100644 smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts create mode 100644 smithy-kotlin-examples/quickstart-kotlin/server/smithy-build.json create mode 100644 smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java create mode 100644 smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java create mode 100644 smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java create mode 100644 smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java create mode 100644 smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java create mode 100644 smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java create mode 100644 smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts create mode 100644 smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts create mode 100644 smithy-kotlin-examples/quickstart-kotlin/smithy/model/common.smithy create mode 100644 smithy-kotlin-examples/quickstart-kotlin/smithy/model/main.smithy create mode 100644 smithy-kotlin-examples/quickstart-kotlin/smithy/model/order.smithy create mode 100644 smithy-kotlin-examples/quickstart-kotlin/smithy/smithy-build.json diff --git a/settings.gradle.kts b/settings.gradle.kts index 220fb0e..eb582be 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -64,3 +64,7 @@ include(":smithy-java-examples:integ") // ---- Smithy-Rust examples ---- // templates includeBuild("smithy-rs-examples/quickstart-rust") + +// ---- Smithy-Kotlin examples ---- +// templates +includeBuild("smithy-kotlin-examples/quickstart-kotlin") diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CafeService.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java similarity index 97% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CafeService.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java index d75eecb..b9a1b0b 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CafeService.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server.example; import io.smithy.java.server.example.service.CoffeeShop; import java.net.URI; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CreateOrder.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java similarity index 96% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CreateOrder.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java index e561a4e..a239bfa 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CreateOrder.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server.example; import io.smithy.java.server.example.model.CreateOrderInput; import io.smithy.java.server.example.model.CreateOrderOutput; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetMenu.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java similarity index 98% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetMenu.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java index b7278af..fa3d4f6 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetMenu.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server.example; import io.smithy.java.server.example.model.CoffeeItem; import io.smithy.java.server.example.model.CoffeeType; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetOrder.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java similarity index 97% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetOrder.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java index d7e60d9..a569e8a 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetOrder.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server.example; import io.smithy.java.server.example.model.GetOrderInput; import io.smithy.java.server.example.model.GetOrderOutput; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/Order.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/Order.java similarity index 91% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/Order.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/Order.java index a2efa2d..cd30c49 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/Order.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/Order.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server.example; import io.smithy.java.server.example.model.CoffeeType; import io.smithy.java.server.example.model.OrderStatus; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/OrderTracker.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java similarity index 96% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/OrderTracker.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java index 9474957..f0f532e 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/OrderTracker.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server.example; import io.smithy.java.server.example.model.OrderStatus; import java.util.Map; diff --git a/smithy-kotlin-examples/README.MD b/smithy-kotlin-examples/README.MD new file mode 100644 index 0000000..eb2dcae --- /dev/null +++ b/smithy-kotlin-examples/README.MD @@ -0,0 +1,2 @@ +# Smithy Kotlin +The examples in this directory demonstrate the use of the [Smithy Kotlin](https://github.com/smithy-lang/smithy-kotlin) code generator for clients. \ No newline at end of file diff --git a/smithy-kotlin-examples/quickstart-kotlin/README.MD b/smithy-kotlin-examples/quickstart-kotlin/README.MD new file mode 100644 index 0000000..dc88142 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/README.MD @@ -0,0 +1,38 @@ +## Smithy-Kotlin Quickstart + +This project provides a template to get started using [Smithy Kotlin](https://github.com/smithy-lang/smithy-kotlin) +to create Kotlin clients. + +### Layout + +- `client/`: Code generated Kotlin client that can call the server. +- `smithy/`: Common package for the service API model. Shared by both client and server. +- `server/`: Code generated Java Server that implements stubbed operations code-generated from the service model. + +### Usage + +To create a new project from this template, use the [Smithy CLI](https://smithy.io/2.0/guides/smithy-cli/index.html) +`init` command as follows: + +```console +smithy init -t smithy-kotlin-quickstart +``` + +### Running and testing server + +To run and test the server, run `./gradlew :server:run` from the root of a project created from this +template. That will start the server running on port `8888`. + +Once the server is running you can call the server by running the client application in the `client` subproject + +```console +./gradlew :client:run +``` + +Or by using `curl` + +```console +curl -H "content-type: application/json" -d '{"coffeeType": "LATTE"}' -X POST localhost:8888/order +``` + + diff --git a/smithy-kotlin-examples/quickstart-kotlin/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/build.gradle.kts new file mode 100644 index 0000000..fca222d --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/build.gradle.kts @@ -0,0 +1,8 @@ + +// Add repositories for all subprojects to resolve dependencies. +allprojects { + repositories { + mavenLocal() + mavenCentral() + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts new file mode 100644 index 0000000..668ec61 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts @@ -0,0 +1,53 @@ +description = "Cafe service client" + +plugins { + application + kotlin("jvm") version "2.2.0" + // Executes smithy-build process to generate client code + id("software.amazon.smithy.gradle.smithy-base") +} + +// Add generated client source code to the main sourceSet +afterEvaluate { + val clientPath = smithy.getPluginProjectionPath(smithy.sourceProjection.get(), "kotlin-codegen") + sourceSets.main.get().kotlin.srcDir(clientPath) +} + +tasks.named("compileKotlin") { + dependsOn("smithyBuild") +} + +dependencies { + val coroutinesCoreVersion: String by project + val smithyKotlinCodegenVersion: String by project + val smithyKotlinRuntimeVersion: String by project + + // Code generators + compileOnly("software.amazon.smithy.kotlin:smithy-aws-kotlin-codegen:$smithyKotlinCodegenVersion") + + // Service model + implementation(project(":smithy")) + + // Client Dependencies + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesCoreVersion") + implementation("aws.smithy.kotlin:runtime-core:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:smithy-client:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:http-client:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:telemetry-api:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:telemetry-defaults:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:smithy-rpcv2-protocols:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:aws-protocol-core:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:aws-signing-common:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:serde:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:serde-cbor:$smithyKotlinRuntimeVersion") + implementation("aws.smithy.kotlin:http-client-engine-default:$smithyKotlinRuntimeVersion") +} + +val optinAnnotations = listOf("kotlin.RequiresOptIn", "aws.smithy.kotlin.runtime.InternalApi") +kotlin.sourceSets.all { + optinAnnotations.forEach { languageSettings.optIn(it) } +} + +application { + mainClass.set("io.smithy.kotlin.client.example.MainKt") +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/client/smithy-build.json b/smithy-kotlin-examples/quickstart-kotlin/client/smithy-build.json new file mode 100644 index 0000000..ff8f8e4 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/client/smithy-build.json @@ -0,0 +1,20 @@ +{ + "version": "1.0", + "plugins": { + "kotlin-codegen": { + "service": "com.example#CoffeeShop", + "sdkId": "CoffeeShop", + "package": { + "name": "io.smithy.kotlin.client.example", + "version": "0.0.1" + }, + "build": { + "rootProject": false, + "generateDefaultBuildFiles": false + }, + "api": { + "nullabilityCheckMode": "client" + } + } + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/client/src/main/kotlin/io/smithy/kotlin/client/example/Main.kt b/smithy-kotlin-examples/quickstart-kotlin/client/src/main/kotlin/io/smithy/kotlin/client/example/Main.kt new file mode 100644 index 0000000..6343866 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/client/src/main/kotlin/io/smithy/kotlin/client/example/Main.kt @@ -0,0 +1,37 @@ +package io.smithy.kotlin.client.example + +import aws.smithy.kotlin.runtime.client.endpoints.Endpoint +import io.smithy.kotlin.client.example.endpoints.CoffeeShopEndpointProvider +import io.smithy.kotlin.client.example.model.CoffeeType +import kotlinx.coroutines.delay +import kotlinx.coroutines.runBlocking +import java.util.logging.Logger +import kotlin.time.Duration.Companion.seconds + +fun main(): Unit = runBlocking { + val logger: Logger = Logger.getLogger("SmithyKotlinClient") + + CoffeeShopClient { + endpointProvider = CoffeeShopEndpointProvider { + Endpoint("http://localhost:8888") + } + }.use { client -> + logger.info("Creating coffee order") + + val createOrderResponse = client.createOrder { + coffeeType = CoffeeType.Latte + } + + logger.info("Created order with ID: ${createOrderResponse.id}") + + logger.info("Waiting for order to complete.") + delay(5.seconds) + + logger.info("Checking order status") + val orderStatus = client.getOrder { + id = createOrderResponse.id + }.status + + logger.info("Order status: $orderStatus") + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/gradle.properties b/smithy-kotlin-examples/quickstart-kotlin/gradle.properties new file mode 100644 index 0000000..09f2ff0 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/gradle.properties @@ -0,0 +1,8 @@ +smithyVersion=1.63.0 +smithyGradleVersion=1.3.0 +smithyKotlinCodegenVersion=0.35.25 +smithyKotlinRuntimeVersion=1.5.25 +smithyJavaVersion=0.0.1 + +jvmVersion=2.2.0 +coroutinesCoreVersion=1.10.2 \ No newline at end of file diff --git a/smithy-kotlin-examples/quickstart-kotlin/license.txt b/smithy-kotlin-examples/quickstart-kotlin/license.txt new file mode 100644 index 0000000..edaafd8 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/license.txt @@ -0,0 +1,4 @@ +/* + * Example file license header. + * File header line two + */ diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts new file mode 100644 index 0000000..6c55f60 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts @@ -0,0 +1,42 @@ +description = "Cafe service server implementation" + +plugins { + `java-library` + application + // Executes smithy-build process to generate server stubs + id("software.amazon.smithy.gradle.smithy-base") +} + +dependencies { + val smithyJavaVersion: String by project + + // Code generators + smithyBuild("software.amazon.smithy.java.codegen:plugins:$smithyJavaVersion") + + // Service model + implementation(project(":smithy")) + + // Server dependencies + // Adds an HTTP server implementation based on netty + implementation("software.amazon.smithy.java:server-netty:$smithyJavaVersion") + // Adds the server implementation of the `RestJson1` protocol + implementation("software.amazon.smithy.java:aws-server-restjson:$smithyJavaVersion") + // Adds the server implementation of the `Rpcv2Cbor` protocol + implementation("software.amazon.smithy.java:server-rpcv2-cbor:${smithyJavaVersion}") +} + +// Add generated source code to the compilation sourceSet +afterEvaluate { + val serverPath = smithy.getPluginProjectionPath(smithy.sourceProjection.get(), "java-server-codegen") + sourceSets.main.get().java.srcDir(serverPath) +} + +tasks.named("compileJava") { + dependsOn("smithyBuild") +} + +// Use the application plugin to start the service via the `run` task. +application { + mainClass = "io.smithy.kotlin.server.example.CafeService" +} + diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/smithy-build.json b/smithy-kotlin-examples/quickstart-kotlin/server/smithy-build.json new file mode 100644 index 0000000..57b0154 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/server/smithy-build.json @@ -0,0 +1,10 @@ +{ + "version": "1.0", + "plugins": { + "java-server-codegen": { + "service": "com.example#CoffeeShop", + "namespace": "io.smithy.kotlin.server.example", + "headerFile": "../license.txt" + } + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java new file mode 100644 index 0000000..d15958d --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java @@ -0,0 +1,46 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: MIT-0 + */ + +package io.smithy.kotlin.server.example; + +import io.smithy.kotlin.server.example.service.CoffeeShop; +import java.net.URI; +import java.util.concurrent.ExecutionException; +import java.util.logging.Logger; +import software.amazon.smithy.java.server.Server; + +public class CafeService implements Runnable { + private static final Logger LOGGER = Logger.getLogger(CafeService.class.getName()); + + public static void main(String... args) throws InterruptedException, ExecutionException { + new CafeService().run(); + } + + @Override + public void run() { + Server server = Server.builder() + .endpoints(URI.create("http://localhost:8888")) + .addService( + CoffeeShop.builder() + .addCreateOrderOperation(new CreateOrder()) + .addGetMenuOperation(new GetMenu()) + .addGetOrderOperation(new GetOrder()) + .build() + ) + .build(); + LOGGER.info("Starting server..."); + server.start(); + try { + Thread.currentThread().join(); + } catch (InterruptedException e) { + LOGGER.info("Stopping server..."); + try { + server.shutdown().get(); + } catch (InterruptedException | ExecutionException ex) { + throw new RuntimeException(ex); + } + } + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java new file mode 100644 index 0000000..757d977 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java @@ -0,0 +1,36 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: MIT-0 + */ + +package io.smithy.kotlin.server.example; + +import io.smithy.kotlin.server.example.model.CreateOrderInput; +import io.smithy.kotlin.server.example.model.CreateOrderOutput; +import io.smithy.kotlin.server.example.model.OrderStatus; +import io.smithy.kotlin.server.example.service.CreateOrderOperation; +import java.util.UUID; + +import java.util.logging.Logger; +import software.amazon.smithy.java.server.RequestContext; + +/** + * Create an order for a coffee. + */ +final class CreateOrder implements CreateOrderOperation { + private static final Logger LOGGER = Logger.getLogger(CreateOrder.class.getName()); + + @Override + public CreateOrderOutput createOrder(CreateOrderInput input, RequestContext context) { + var id = UUID.randomUUID(); + OrderTracker.putOrder(new Order(id, input.coffeeType(), OrderStatus.IN_PROGRESS)); + + LOGGER.info("Created order " + id + " for a " + input.coffeeType()); + + return CreateOrderOutput.builder() + .id(id.toString()) + .coffeeType(input.coffeeType()) + .status(OrderStatus.IN_PROGRESS) + .build(); + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java new file mode 100644 index 0000000..571807c --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java @@ -0,0 +1,59 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: MIT-0 + */ + +package io.smithy.kotlin.server.example; + +import io.smithy.kotlin.server.example.model.CoffeeItem; +import io.smithy.kotlin.server.example.model.CoffeeType; +import io.smithy.kotlin.server.example.model.GetMenuInput; +import io.smithy.kotlin.server.example.model.GetMenuOutput; +import io.smithy.kotlin.server.example.service.GetMenuOperation; +import java.util.List; + +import software.amazon.smithy.java.server.RequestContext; + +/** + * Returns the menu for the coffee shop + */ +final class GetMenu implements GetMenuOperation { + private static final List MENU = List.of( + CoffeeItem.builder() + .typeMember(CoffeeType.DRIP) + .description(""" + A clean-bodied, rounder, and more simplistic flavour profile. + Often praised for mellow and less intense notes. + Far less concentrated than espresso. + """) + .build(), + CoffeeItem.builder() + .typeMember(CoffeeType.POUR_OVER) + .description(""" + Similar to drip coffee, but with a process that brings out more subtle nuances in flavor. + More concentrated than drip, but less than espresso. + """) + .build(), + CoffeeItem.builder() + .typeMember(CoffeeType.LATTE) + .description(""" + A creamier, milk-based drink made with espresso. + A subtle coffee taste, with smooth texture. + High milk-to-coffee ratio. + """) + .build(), + CoffeeItem.builder() + .typeMember(CoffeeType.ESPRESSO) + .description(""" + A highly concentrated form of coffee, brewed under high pressure. + Syrupy, thick liquid in a small serving size. + Full bodied and intensely aromatic. + """) + .build() + ); + + @Override + public GetMenuOutput getMenu(GetMenuInput input, RequestContext context) { + return GetMenuOutput.builder().items(MENU).build(); + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java new file mode 100644 index 0000000..6fde21e --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java @@ -0,0 +1,39 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: MIT-0 + */ + +package io.smithy.kotlin.server.example; + +import io.smithy.kotlin.server.example.model.GetOrderInput; +import io.smithy.kotlin.server.example.model.GetOrderOutput; +import io.smithy.kotlin.server.example.model.OrderNotFound; +import io.smithy.kotlin.server.example.service.GetOrderOperation; +import java.util.UUID; +import java.util.logging.Logger; +import software.amazon.smithy.java.server.RequestContext; + +/** + * Returns the specified order if found. + */ +final class GetOrder implements GetOrderOperation { + private static final Logger LOGGER = Logger.getLogger(GetOrder.class.getName()); + + @Override + public GetOrderOutput getOrder(GetOrderInput input, RequestContext context) { + var order = OrderTracker.getOrderById(UUID.fromString(input.id())); + if (order == null) { + LOGGER.warning("Order not found: " + input.id()); + throw OrderNotFound.builder() + .orderId(input.id()) + .message("Order not found") + .build(); + } + LOGGER.info("Order " + input.id() + " found."); + return GetOrderOutput.builder() + .id(input.id()) + .coffeeType(order.type()) + .status(order.status()) + .build(); + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java new file mode 100644 index 0000000..1e1fcb0 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java @@ -0,0 +1,19 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: MIT-0 + */ + +package io.smithy.kotlin.server.example; + +import io.smithy.kotlin.server.example.model.CoffeeType; +import io.smithy.kotlin.server.example.model.OrderStatus; +import java.util.UUID; + +/** + * A coffee drink order. + * + * @param id UUID of the order + * @param type Type of drink for the order + * @param status status of the order. + */ +public record Order(UUID id, CoffeeType type, OrderStatus status) {} diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java new file mode 100644 index 0000000..78ad17d --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java @@ -0,0 +1,40 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: MIT-0 + */ + +package io.smithy.kotlin.server.example; + +import io.smithy.kotlin.server.example.model.OrderStatus; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.logging.Logger; + +/** + * This class is a stand-in for a database. + */ +final class OrderTracker { + private static final Logger LOGGER = Logger.getLogger(OrderTracker.class.getName()); + private static final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1); + private static final Map ORDERS = new ConcurrentHashMap<>(); + + public static void putOrder(Order order) { + ORDERS.put(order.id(), order); + + // Start a process to complete the order in the background. + executor.schedule(() -> completeOrder(order), 5, TimeUnit.SECONDS); + } + + private static void completeOrder(Order order) { + ORDERS.put(order.id(), new Order(order.id(), order.type(), OrderStatus.COMPLETED)); + LOGGER.info("Order completed: " + order.id()); + } + + public static Order getOrderById(UUID id) { + return ORDERS.get(id); + } +} + diff --git a/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts new file mode 100644 index 0000000..33c8ebf --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts @@ -0,0 +1,20 @@ +rootProject.name = "smithy-kotlin-quickstart" + +pluginManagement { + val smithyGradleVersion: String by settings + plugins { + id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion) + id("software.amazon.smithy.gradle.smithy-base").version(smithyGradleVersion) + } + + repositories { + mavenLocal() + mavenCentral() + gradlePluginPortal() + } +} + +// Subprojects +include("client") +include("smithy") +include("server") \ No newline at end of file diff --git a/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts new file mode 100644 index 0000000..2248922 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts @@ -0,0 +1,24 @@ +description = "Smithy definition of a Cafe service." + +plugins { + `java-library` + // Packages the models in this package into a jar for sharing/distribution by other packages + id("software.amazon.smithy.gradle.smithy-jar") +} + +dependencies { + val smithyVersion: String by project + + // Adds the `@rpcv2Cbor` and `@restJson1` protocol trait + api("software.amazon.smithy:smithy-aws-traits:$smithyVersion") + +} + +// Helps the Smithy IntelliJ plugin identify models +sourceSets { + main { + java { + srcDir("model") + } + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/smithy/model/common.smithy b/smithy-kotlin-examples/quickstart-kotlin/smithy/model/common.smithy new file mode 100644 index 0000000..192c4f5 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/smithy/model/common.smithy @@ -0,0 +1,27 @@ +$version: "2" + +namespace com.example + +/// An enum describing the types of coffees available +enum CoffeeType { + DRIP + POUR_OVER + LATTE + ESPRESSO + COLD_BREW +} + +/// A structure which defines a coffee item which can be ordered +structure CoffeeItem { + /// A type of coffee + @required + type: CoffeeType + + @required + description: String +} + +/// A list of coffee items +list CoffeeItems { + member: CoffeeItem +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/smithy/model/main.smithy b/smithy-kotlin-examples/quickstart-kotlin/smithy/model/main.smithy new file mode 100644 index 0000000..13c994b --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/smithy/model/main.smithy @@ -0,0 +1,32 @@ +$version: "2" + +namespace com.example + +use aws.api#service +use aws.protocols#restJson1 +use smithy.protocols#rpcv2Cbor + +/// Allows users to retrieve a menu, create a coffee order, and +/// and to view the status of their orders +@title("Coffee Shop Service") +@restJson1 +@rpcv2Cbor +@service(sdkId: "CoffeeShop") +service CoffeeShop { + version: "2024-08-23" + operations: [ + GetMenu + ] + resources: [ + Order + ] +} + +/// Retrieve the menu +@http(method: "GET", uri: "/menu") +@readonly +operation GetMenu { + output := { + items: CoffeeItems + } +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/smithy/model/order.smithy b/smithy-kotlin-examples/quickstart-kotlin/smithy/model/order.smithy new file mode 100644 index 0000000..45d6264 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/smithy/model/order.smithy @@ -0,0 +1,83 @@ +$version: "2.0" + +namespace com.example + +/// An Order resource, which has an id and describes an order by the type of coffee +/// and the order's status +resource Order { + identifiers: { + id: Uuid + } + properties: { + coffeeType: CoffeeType + status: OrderStatus + } + read: GetOrder + create: CreateOrder +} + +/// Create an order +@idempotent +@http(method: "POST", uri: "/order") +operation CreateOrder { + input := for Order { + @required + $coffeeType + } + + output := for Order { + @required + $id + + @required + $coffeeType + + @required + $status + } +} + +/// Retrieve an order +@readonly +@http(method: "GET", uri: "/order/{id}") +operation GetOrder { + input := for Order { + @httpLabel + @required + $id + } + + output := for Order { + @required + $id + + @required + $coffeeType + + @required + $status + } + + errors: [ + OrderNotFound + ] +} + +/// An error indicating an order could not be found +@httpError(404) +@error("client") +structure OrderNotFound { + message: String + orderId: Uuid +} + +/// An identifier to describe a unique order +@length(min: 1, max: 128) +@pattern("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$") +string Uuid + +/// An enum describing the status of an order +enum OrderStatus { + IN_PROGRESS + COMPLETED +} diff --git a/smithy-kotlin-examples/quickstart-kotlin/smithy/smithy-build.json b/smithy-kotlin-examples/quickstart-kotlin/smithy/smithy-build.json new file mode 100644 index 0000000..703ffb7 --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/smithy/smithy-build.json @@ -0,0 +1,3 @@ +{ + "version": "1.0" +} From d606f9ffe59151b209859a0cd731bf53d68ed01a Mon Sep 17 00:00:00 2001 From: 0marperez Date: Mon, 5 Jan 2026 10:36:51 -0500 Subject: [PATCH 2/7] fix temp refactor --- .../{kotlin => java}/server/example/CafeService.java | 2 +- .../{kotlin => java}/server/example/CreateOrder.java | 2 +- .../{kotlin => java}/server/example/GetMenu.java | 2 +- .../{kotlin => java}/server/example/GetOrder.java | 2 +- .../{kotlin => java}/server/example/Order.java | 2 +- .../server/example/OrderTracker.java | 2 +- .../{kotlin => java}/server/example/CafeService.java | 4 ++-- .../{kotlin => java}/server/example/CreateOrder.java | 10 +++++----- .../{kotlin => java}/server/example/GetMenu.java | 12 ++++++------ .../{kotlin => java}/server/example/GetOrder.java | 10 +++++----- .../{kotlin => java}/server/example/Order.java | 6 +++--- .../server/example/OrderTracker.java | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{kotlin => java}/server/example/CafeService.java (97%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{kotlin => java}/server/example/CreateOrder.java (96%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{kotlin => java}/server/example/GetMenu.java (98%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{kotlin => java}/server/example/GetOrder.java (97%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{kotlin => java}/server/example/Order.java (91%) rename smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/{kotlin => java}/server/example/OrderTracker.java (96%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{kotlin => java}/server/example/CafeService.java (93%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{kotlin => java}/server/example/CreateOrder.java (76%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{kotlin => java}/server/example/GetMenu.java (85%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{kotlin => java}/server/example/GetOrder.java (79%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{kotlin => java}/server/example/Order.java (69%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{kotlin => java}/server/example/OrderTracker.java (92%) diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CafeService.java similarity index 97% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CafeService.java index b9a1b0b..d75eecb 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CafeService.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; import io.smithy.java.server.example.service.CoffeeShop; import java.net.URI; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CreateOrder.java similarity index 96% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CreateOrder.java index a239bfa..e561a4e 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/CreateOrder.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; import io.smithy.java.server.example.model.CreateOrderInput; import io.smithy.java.server.example.model.CreateOrderOutput; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetMenu.java similarity index 98% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetMenu.java index fa3d4f6..b7278af 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetMenu.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; import io.smithy.java.server.example.model.CoffeeItem; import io.smithy.java.server.example.model.CoffeeType; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetOrder.java similarity index 97% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetOrder.java index a569e8a..d7e60d9 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/GetOrder.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; import io.smithy.java.server.example.model.GetOrderInput; import io.smithy.java.server.example.model.GetOrderOutput; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/Order.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/Order.java similarity index 91% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/Order.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/Order.java index cd30c49..a2efa2d 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/Order.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/Order.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; import io.smithy.java.server.example.model.CoffeeType; import io.smithy.java.server.example.model.OrderStatus; diff --git a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/OrderTracker.java similarity index 96% rename from smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java rename to smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/OrderTracker.java index f0f532e..9474957 100644 --- a/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java +++ b/smithy-java-examples/quickstart-java/server/src/main/java/io/smithy/java/server/example/OrderTracker.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; import io.smithy.java.server.example.model.OrderStatus; import java.util.Map; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CafeService.java similarity index 93% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CafeService.java index d15958d..d75eecb 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CafeService.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; -import io.smithy.kotlin.server.example.service.CoffeeShop; +import io.smithy.java.server.example.service.CoffeeShop; import java.net.URI; import java.util.concurrent.ExecutionException; import java.util.logging.Logger; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CreateOrder.java similarity index 76% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CreateOrder.java index 757d977..e561a4e 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CreateOrder.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; -import io.smithy.kotlin.server.example.model.CreateOrderInput; -import io.smithy.kotlin.server.example.model.CreateOrderOutput; -import io.smithy.kotlin.server.example.model.OrderStatus; -import io.smithy.kotlin.server.example.service.CreateOrderOperation; +import io.smithy.java.server.example.model.CreateOrderInput; +import io.smithy.java.server.example.model.CreateOrderOutput; +import io.smithy.java.server.example.model.OrderStatus; +import io.smithy.java.server.example.service.CreateOrderOperation; import java.util.UUID; import java.util.logging.Logger; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetMenu.java similarity index 85% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetMenu.java index 571807c..b7278af 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetMenu.java @@ -3,13 +3,13 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; -import io.smithy.kotlin.server.example.model.CoffeeItem; -import io.smithy.kotlin.server.example.model.CoffeeType; -import io.smithy.kotlin.server.example.model.GetMenuInput; -import io.smithy.kotlin.server.example.model.GetMenuOutput; -import io.smithy.kotlin.server.example.service.GetMenuOperation; +import io.smithy.java.server.example.model.CoffeeItem; +import io.smithy.java.server.example.model.CoffeeType; +import io.smithy.java.server.example.model.GetMenuInput; +import io.smithy.java.server.example.model.GetMenuOutput; +import io.smithy.java.server.example.service.GetMenuOperation; import java.util.List; import software.amazon.smithy.java.server.RequestContext; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetOrder.java similarity index 79% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetOrder.java index 6fde21e..d7e60d9 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetOrder.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; -import io.smithy.kotlin.server.example.model.GetOrderInput; -import io.smithy.kotlin.server.example.model.GetOrderOutput; -import io.smithy.kotlin.server.example.model.OrderNotFound; -import io.smithy.kotlin.server.example.service.GetOrderOperation; +import io.smithy.java.server.example.model.GetOrderInput; +import io.smithy.java.server.example.model.GetOrderOutput; +import io.smithy.java.server.example.model.OrderNotFound; +import io.smithy.java.server.example.service.GetOrderOperation; import java.util.UUID; import java.util.logging.Logger; import software.amazon.smithy.java.server.RequestContext; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/Order.java similarity index 69% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/Order.java index 1e1fcb0..a2efa2d 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/Order.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; -import io.smithy.kotlin.server.example.model.CoffeeType; -import io.smithy.kotlin.server.example.model.OrderStatus; +import io.smithy.java.server.example.model.CoffeeType; +import io.smithy.java.server.example.model.OrderStatus; import java.util.UUID; /** diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/OrderTracker.java similarity index 92% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/OrderTracker.java index 78ad17d..9474957 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/OrderTracker.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server.example; +package io.smithy.java.server.example; -import io.smithy.kotlin.server.example.model.OrderStatus; +import io.smithy.java.server.example.model.OrderStatus; import java.util.Map; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; From 4579c19f0c454726f3a9e85fe68285bfdcf6ef36 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Mon, 5 Jan 2026 10:39:37 -0500 Subject: [PATCH 3/7] fix intellij refactoring mistakes --- smithy-kotlin-examples/quickstart-kotlin/gradle.properties | 2 +- .../{java/server/example => kotlin/server}/CafeService.java | 2 +- .../{java/server/example => kotlin/server}/CreateOrder.java | 2 +- .../smithy/{java/server/example => kotlin/server}/GetMenu.java | 2 +- .../smithy/{java/server/example => kotlin/server}/GetOrder.java | 2 +- .../io/smithy/{java/server/example => kotlin/server}/Order.java | 2 +- .../{java/server/example => kotlin/server}/OrderTracker.java | 2 +- smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{java/server/example => kotlin/server}/CafeService.java (97%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{java/server/example => kotlin/server}/CreateOrder.java (96%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{java/server/example => kotlin/server}/GetMenu.java (98%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{java/server/example => kotlin/server}/GetOrder.java (97%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{java/server/example => kotlin/server}/Order.java (92%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/{java/server/example => kotlin/server}/OrderTracker.java (97%) diff --git a/smithy-kotlin-examples/quickstart-kotlin/gradle.properties b/smithy-kotlin-examples/quickstart-kotlin/gradle.properties index 09f2ff0..9ee4a9d 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/gradle.properties +++ b/smithy-kotlin-examples/quickstart-kotlin/gradle.properties @@ -5,4 +5,4 @@ smithyKotlinRuntimeVersion=1.5.25 smithyJavaVersion=0.0.1 jvmVersion=2.2.0 -coroutinesCoreVersion=1.10.2 \ No newline at end of file +coroutinesCoreVersion=1.10.2 diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CafeService.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CafeService.java similarity index 97% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CafeService.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CafeService.java index d75eecb..71eccac 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CafeService.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CafeService.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server; import io.smithy.java.server.example.service.CoffeeShop; import java.net.URI; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CreateOrder.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CreateOrder.java similarity index 96% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CreateOrder.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CreateOrder.java index e561a4e..fc9a514 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/CreateOrder.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CreateOrder.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server; import io.smithy.java.server.example.model.CreateOrderInput; import io.smithy.java.server.example.model.CreateOrderOutput; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetMenu.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetMenu.java similarity index 98% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetMenu.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetMenu.java index b7278af..2cb4449 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetMenu.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetMenu.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server; import io.smithy.java.server.example.model.CoffeeItem; import io.smithy.java.server.example.model.CoffeeType; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetOrder.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetOrder.java similarity index 97% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetOrder.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetOrder.java index d7e60d9..52d608d 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/GetOrder.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetOrder.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server; import io.smithy.java.server.example.model.GetOrderInput; import io.smithy.java.server.example.model.GetOrderOutput; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/Order.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/Order.java similarity index 92% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/Order.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/Order.java index a2efa2d..717b62b 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/Order.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/Order.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server; import io.smithy.java.server.example.model.CoffeeType; import io.smithy.java.server.example.model.OrderStatus; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/OrderTracker.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/OrderTracker.java similarity index 97% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/OrderTracker.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/OrderTracker.java index 9474957..76e4dbd 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/java/server/example/OrderTracker.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/OrderTracker.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.java.server.example; +package io.smithy.kotlin.server; import io.smithy.java.server.example.model.OrderStatus; import java.util.Map; diff --git a/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts index 33c8ebf..3ae8190 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts +++ b/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts @@ -17,4 +17,4 @@ pluginManagement { // Subprojects include("client") include("smithy") -include("server") \ No newline at end of file +include("server") From d9b75574f29e58f8559ea74114433154bb787dc6 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Mon, 5 Jan 2026 15:47:46 -0500 Subject: [PATCH 4/7] fixes to server module name and imports --- .../kotlin/server/{ => example}/CafeService.java | 4 ++-- .../kotlin/server/{ => example}/CreateOrder.java | 10 +++++----- .../smithy/kotlin/server/{ => example}/GetMenu.java | 12 ++++++------ .../smithy/kotlin/server/{ => example}/GetOrder.java | 10 +++++----- .../io/smithy/kotlin/server/{ => example}/Order.java | 6 +++--- .../kotlin/server/{ => example}/OrderTracker.java | 4 ++-- smithy-templates.json | 11 +++++++++++ 7 files changed, 34 insertions(+), 23 deletions(-) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/{ => example}/CafeService.java (93%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/{ => example}/CreateOrder.java (76%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/{ => example}/GetMenu.java (85%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/{ => example}/GetOrder.java (79%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/{ => example}/Order.java (69%) rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/{ => example}/OrderTracker.java (92%) diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CafeService.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java similarity index 93% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CafeService.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java index 71eccac..d15958d 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CafeService.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server; +package io.smithy.kotlin.server.example; -import io.smithy.java.server.example.service.CoffeeShop; +import io.smithy.kotlin.server.example.service.CoffeeShop; import java.net.URI; import java.util.concurrent.ExecutionException; import java.util.logging.Logger; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CreateOrder.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java similarity index 76% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CreateOrder.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java index fc9a514..757d977 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/CreateOrder.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CreateOrder.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server; +package io.smithy.kotlin.server.example; -import io.smithy.java.server.example.model.CreateOrderInput; -import io.smithy.java.server.example.model.CreateOrderOutput; -import io.smithy.java.server.example.model.OrderStatus; -import io.smithy.java.server.example.service.CreateOrderOperation; +import io.smithy.kotlin.server.example.model.CreateOrderInput; +import io.smithy.kotlin.server.example.model.CreateOrderOutput; +import io.smithy.kotlin.server.example.model.OrderStatus; +import io.smithy.kotlin.server.example.service.CreateOrderOperation; import java.util.UUID; import java.util.logging.Logger; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetMenu.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java similarity index 85% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetMenu.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java index 2cb4449..571807c 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetMenu.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetMenu.java @@ -3,13 +3,13 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server; +package io.smithy.kotlin.server.example; -import io.smithy.java.server.example.model.CoffeeItem; -import io.smithy.java.server.example.model.CoffeeType; -import io.smithy.java.server.example.model.GetMenuInput; -import io.smithy.java.server.example.model.GetMenuOutput; -import io.smithy.java.server.example.service.GetMenuOperation; +import io.smithy.kotlin.server.example.model.CoffeeItem; +import io.smithy.kotlin.server.example.model.CoffeeType; +import io.smithy.kotlin.server.example.model.GetMenuInput; +import io.smithy.kotlin.server.example.model.GetMenuOutput; +import io.smithy.kotlin.server.example.service.GetMenuOperation; import java.util.List; import software.amazon.smithy.java.server.RequestContext; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetOrder.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java similarity index 79% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetOrder.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java index 52d608d..6fde21e 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/GetOrder.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/GetOrder.java @@ -3,12 +3,12 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server; +package io.smithy.kotlin.server.example; -import io.smithy.java.server.example.model.GetOrderInput; -import io.smithy.java.server.example.model.GetOrderOutput; -import io.smithy.java.server.example.model.OrderNotFound; -import io.smithy.java.server.example.service.GetOrderOperation; +import io.smithy.kotlin.server.example.model.GetOrderInput; +import io.smithy.kotlin.server.example.model.GetOrderOutput; +import io.smithy.kotlin.server.example.model.OrderNotFound; +import io.smithy.kotlin.server.example.service.GetOrderOperation; import java.util.UUID; import java.util.logging.Logger; import software.amazon.smithy.java.server.RequestContext; diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/Order.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java similarity index 69% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/Order.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java index 717b62b..1e1fcb0 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/Order.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/Order.java @@ -3,10 +3,10 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server; +package io.smithy.kotlin.server.example; -import io.smithy.java.server.example.model.CoffeeType; -import io.smithy.java.server.example.model.OrderStatus; +import io.smithy.kotlin.server.example.model.CoffeeType; +import io.smithy.kotlin.server.example.model.OrderStatus; import java.util.UUID; /** diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/OrderTracker.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java similarity index 92% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/OrderTracker.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java index 76e4dbd..78ad17d 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/OrderTracker.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/OrderTracker.java @@ -3,9 +3,9 @@ * SPDX-License-Identifier: MIT-0 */ -package io.smithy.kotlin.server; +package io.smithy.kotlin.server.example; -import io.smithy.java.server.example.model.OrderStatus; +import io.smithy.kotlin.server.example.model.OrderStatus; import java.util.Map; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; diff --git a/smithy-templates.json b/smithy-templates.json index 7cc3350..3559f26 100644 --- a/smithy-templates.json +++ b/smithy-templates.json @@ -180,6 +180,17 @@ ".gitattributes" ] }, + "smithy-kotlin-quickstart": { + "documentation": "Quickstart example for Smithy Kotlin", + "path": "smithy-kotlin-examples/quickstart-kotlin", + "include": [ + "gradle/", + "gradlew", + "gradlew.bat", + ".gitignore", + ".gitattributes" + ] + }, "docgen-cli": { "documentation": "Generate documentation using the smithy-docgen plugin.", "path": "smithy-docgen-examples/docgen-cli" From 27e4ab807d72e7c5c342bb85054dc5fed19c62b3 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Tue, 6 Jan 2026 15:50:17 -0500 Subject: [PATCH 5/7] address feedback except version catalog --- smithy-kotlin-examples/quickstart-kotlin/README.MD | 14 +++----------- .../quickstart-kotlin/client/build.gradle.kts | 4 ++-- .../quickstart-kotlin/gradle/libs.versions.toml | 14 ++++++++++++++ .../quickstart-kotlin/license.txt | 4 ---- .../quickstart-kotlin/server/build.gradle.kts | 4 ++-- .../{CafeService.java => CoffeeShopService.java} | 6 +++--- 6 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml delete mode 100644 smithy-kotlin-examples/quickstart-kotlin/license.txt rename smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/{CafeService.java => CoffeeShopService.java} (88%) diff --git a/smithy-kotlin-examples/quickstart-kotlin/README.MD b/smithy-kotlin-examples/quickstart-kotlin/README.MD index dc88142..1dec5f4 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/README.MD +++ b/smithy-kotlin-examples/quickstart-kotlin/README.MD @@ -18,21 +18,13 @@ To create a new project from this template, use the [Smithy CLI](https://smithy. smithy init -t smithy-kotlin-quickstart ``` -### Running and testing server +### Running and testing client -To run and test the server, run `./gradlew :server:run` from the root of a project created from this +To run and test the client, first start a server by running `./gradlew :server:run` from the root of a project created from this template. That will start the server running on port `8888`. -Once the server is running you can call the server by running the client application in the `client` subproject +Once the server is running you can run the client application in the `client` subproject ```console ./gradlew :client:run ``` - -Or by using `curl` - -```console -curl -H "content-type: application/json" -d '{"coffeeType": "LATTE"}' -X POST localhost:8888/order -``` - - diff --git a/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts index 668ec61..3218a75 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts +++ b/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts @@ -1,8 +1,8 @@ -description = "Cafe service client" +description = "CoffeeShop service client" plugins { application - kotlin("jvm") version "2.2.0" + kotlin("jvm") version "2.3.0" // Executes smithy-build process to generate client code id("software.amazon.smithy.gradle.smithy-base") } diff --git a/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml b/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml new file mode 100644 index 0000000..15cd23b --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml @@ -0,0 +1,14 @@ +[versions] +smithyVersion="1.63.0" +smithyGradleVersion="1.3.0" +smithyKotlinCodegenVersion="0.35.25" +smithyKotlinRuntimeVersion="1.5.25" +smithyJavaVersion="0.0.1" + +jvmVersion="2.2.0" +coroutinesCoreVersion="1.10.2" + +[libraries] +aws-kotlin-repo-tools-build-support = { module="aws.sdk.kotlin.gradle:build-support", version.ref = "aws-kotlin-repo-tools-version" } + + diff --git a/smithy-kotlin-examples/quickstart-kotlin/license.txt b/smithy-kotlin-examples/quickstart-kotlin/license.txt deleted file mode 100644 index edaafd8..0000000 --- a/smithy-kotlin-examples/quickstart-kotlin/license.txt +++ /dev/null @@ -1,4 +0,0 @@ -/* - * Example file license header. - * File header line two - */ diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts index 6c55f60..235b899 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts +++ b/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts @@ -1,4 +1,4 @@ -description = "Cafe service server implementation" +description = "Coffee shop service server implementation" plugins { `java-library` @@ -37,6 +37,6 @@ tasks.named("compileJava") { // Use the application plugin to start the service via the `run` task. application { - mainClass = "io.smithy.kotlin.server.example.CafeService" + mainClass = "io.smithy.kotlin.server.example.CoffeeShopService" } diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CoffeeShopService.java similarity index 88% rename from smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java rename to smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CoffeeShopService.java index d15958d..d5ef9b7 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CafeService.java +++ b/smithy-kotlin-examples/quickstart-kotlin/server/src/main/java/io/smithy/kotlin/server/example/CoffeeShopService.java @@ -11,11 +11,11 @@ import java.util.logging.Logger; import software.amazon.smithy.java.server.Server; -public class CafeService implements Runnable { - private static final Logger LOGGER = Logger.getLogger(CafeService.class.getName()); +public class CoffeeShopService implements Runnable { + private static final Logger LOGGER = Logger.getLogger(CoffeeShopService.class.getName()); public static void main(String... args) throws InterruptedException, ExecutionException { - new CafeService().run(); + new CoffeeShopService().run(); } @Override From bf33db84d983855d7e094858c925284c5514683b Mon Sep 17 00:00:00 2001 From: 0marperez Date: Tue, 6 Jan 2026 16:30:49 -0500 Subject: [PATCH 6/7] version catalog --- .../quickstart-kotlin/client/build.gradle.kts | 30 ++++++++----------- .../quickstart-kotlin/gradle.properties | 8 ----- .../gradle/libs.versions.toml | 25 ++++++++++++---- .../quickstart-kotlin/license.txt | 4 +++ .../quickstart-kotlin/server/build.gradle.kts | 14 ++++----- .../quickstart-kotlin/settings.gradle.kts | 2 +- .../quickstart-kotlin/smithy/build.gradle.kts | 7 ++--- 7 files changed, 46 insertions(+), 44 deletions(-) delete mode 100644 smithy-kotlin-examples/quickstart-kotlin/gradle.properties create mode 100644 smithy-kotlin-examples/quickstart-kotlin/license.txt diff --git a/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts index 3218a75..077e3c4 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts +++ b/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts @@ -18,29 +18,25 @@ tasks.named("compileKotlin") { } dependencies { - val coroutinesCoreVersion: String by project - val smithyKotlinCodegenVersion: String by project - val smithyKotlinRuntimeVersion: String by project - // Code generators - compileOnly("software.amazon.smithy.kotlin:smithy-aws-kotlin-codegen:$smithyKotlinCodegenVersion") + compileOnly(libs.smithy.kotlin.aws.codegen) // Service model implementation(project(":smithy")) // Client Dependencies - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesCoreVersion") - implementation("aws.smithy.kotlin:runtime-core:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:smithy-client:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:http-client:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:telemetry-api:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:telemetry-defaults:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:smithy-rpcv2-protocols:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:aws-protocol-core:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:aws-signing-common:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:serde:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:serde-cbor:$smithyKotlinRuntimeVersion") - implementation("aws.smithy.kotlin:http-client-engine-default:$smithyKotlinRuntimeVersion") + implementation(libs.smithy.kotlin.runtime.core) + implementation(libs.smithy.kotlin.smithy.client) + implementation(libs.smithy.kotlin.http.client) + implementation(libs.smithy.kotlin.telemetry.api) + implementation(libs.smithy.kotlin.telemetry.defaults) + implementation(libs.smithy.kotlin.rpcv2.protocol) + implementation(libs.smithy.kotlin.aws.protocol.core) + implementation(libs.smithy.kotlin.aws.signing.common) + implementation(libs.smithy.kotlin.serde) + implementation(libs.smithy.kotlin.serde.cbor) + implementation(libs.smithy.kotlin.http.client.engine.default) + implementation(libs.kotlinx.coroutines.core) } val optinAnnotations = listOf("kotlin.RequiresOptIn", "aws.smithy.kotlin.runtime.InternalApi") diff --git a/smithy-kotlin-examples/quickstart-kotlin/gradle.properties b/smithy-kotlin-examples/quickstart-kotlin/gradle.properties deleted file mode 100644 index 9ee4a9d..0000000 --- a/smithy-kotlin-examples/quickstart-kotlin/gradle.properties +++ /dev/null @@ -1,8 +0,0 @@ -smithyVersion=1.63.0 -smithyGradleVersion=1.3.0 -smithyKotlinCodegenVersion=0.35.25 -smithyKotlinRuntimeVersion=1.5.25 -smithyJavaVersion=0.0.1 - -jvmVersion=2.2.0 -coroutinesCoreVersion=1.10.2 diff --git a/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml b/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml index 15cd23b..8ab7a8a 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml +++ b/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml @@ -1,14 +1,29 @@ [versions] smithyVersion="1.63.0" -smithyGradleVersion="1.3.0" +smithyJavaVersion="0.0.1" smithyKotlinCodegenVersion="0.35.25" smithyKotlinRuntimeVersion="1.5.25" -smithyJavaVersion="0.0.1" - -jvmVersion="2.2.0" coroutinesCoreVersion="1.10.2" [libraries] -aws-kotlin-repo-tools-build-support = { module="aws.sdk.kotlin.gradle:build-support", version.ref = "aws-kotlin-repo-tools-version" } +smithy-aws-traits = { module="software.amazon.smithy:smithy-aws-traits", version.ref = "smithyVersion" } + +smithy-java-plugins = { module="software.amazon.smithy.java.codegen:plugins", version.ref = "smithyJavaVersion" } +smithy-java-server-netty = { module="software.amazon.smithy.java:server-netty", version.ref = "smithyJavaVersion" } +smithy-java-aws-server-restjson = { module="software.amazon.smithy.java:aws-server-restjson", version.ref = "smithyJavaVersion" } +smithy-java-aws-server-rpcv2-cbor = { module="software.amazon.smithy.java:server-rpcv2-cbor", version.ref = "smithyJavaVersion" } +smithy-kotlin-aws-codegen = { module = "software.amazon.smithy.kotlin:smithy-aws-kotlin-codegen", version.ref = "smithyKotlinCodegenVersion" } +smithy-kotlin-runtime-core = { module = "aws.smithy.kotlin:runtime-core", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-smithy-client = { module = "aws.smithy.kotlin:smithy-client", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-http-client = { module = "aws.smithy.kotlin:http-client", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-telemetry-api = { module = "aws.smithy.kotlin:telemetry-api", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-telemetry-defaults = { module = "aws.smithy.kotlin:telemetry-defaults", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-rpcv2-protocol = { module = "aws.smithy.kotlin:smithy-rpcv2-protocols", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-aws-protocol-core = { module = "aws.smithy.kotlin:aws-protocol-core", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-aws-signing-common = { module = "aws.smithy.kotlin:aws-signing-common", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-serde = { module = "aws.smithy.kotlin:serde", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-serde-cbor = { module = "aws.smithy.kotlin:serde-cbor", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-http-client-engine-default = { module = "aws.smithy.kotlin:http-client-engine-default", version.ref = "smithyKotlinRuntimeVersion" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutinesCoreVersion" } diff --git a/smithy-kotlin-examples/quickstart-kotlin/license.txt b/smithy-kotlin-examples/quickstart-kotlin/license.txt new file mode 100644 index 0000000..2dd564b --- /dev/null +++ b/smithy-kotlin-examples/quickstart-kotlin/license.txt @@ -0,0 +1,4 @@ +/* + * Example file license header. + * File header line two + */ \ No newline at end of file diff --git a/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts index 235b899..67a7453 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts +++ b/smithy-kotlin-examples/quickstart-kotlin/server/build.gradle.kts @@ -8,21 +8,19 @@ plugins { } dependencies { - val smithyJavaVersion: String by project - // Code generators - smithyBuild("software.amazon.smithy.java.codegen:plugins:$smithyJavaVersion") + smithyBuild(libs.smithy.java.plugins) // Service model implementation(project(":smithy")) // Server dependencies // Adds an HTTP server implementation based on netty - implementation("software.amazon.smithy.java:server-netty:$smithyJavaVersion") - // Adds the server implementation of the `RestJson1` protocol - implementation("software.amazon.smithy.java:aws-server-restjson:$smithyJavaVersion") - // Adds the server implementation of the `Rpcv2Cbor` protocol - implementation("software.amazon.smithy.java:server-rpcv2-cbor:${smithyJavaVersion}") + implementation(libs.smithy.java.server.netty) + // Adds a server implementation of the `RestJson1` protocol + implementation(libs.smithy.java.aws.server.restjson) + // Adds a server implementation of the `Rpcv2Cbor` protocol + implementation(libs.smithy.java.aws.server.rpcv2.cbor) } // Add generated source code to the compilation sourceSet diff --git a/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts index 3ae8190..a9b2faf 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts +++ b/smithy-kotlin-examples/quickstart-kotlin/settings.gradle.kts @@ -1,7 +1,7 @@ rootProject.name = "smithy-kotlin-quickstart" pluginManagement { - val smithyGradleVersion: String by settings + val smithyGradleVersion = "1.3.0" plugins { id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion) id("software.amazon.smithy.gradle.smithy-base").version(smithyGradleVersion) diff --git a/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts index 2248922..44fd208 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts +++ b/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts @@ -7,11 +7,8 @@ plugins { } dependencies { - val smithyVersion: String by project - - // Adds the `@rpcv2Cbor` and `@restJson1` protocol trait - api("software.amazon.smithy:smithy-aws-traits:$smithyVersion") - + // Adds the `@rpcv2Cbor` and `@restJson1` protocol traits + api(libs.smithy.aws.traits) } // Helps the Smithy IntelliJ plugin identify models From e51c674511abd7c12b5d6cf2eac2ce44a7cb2204 Mon Sep 17 00:00:00 2001 From: 0marperez Date: Fri, 9 Jan 2026 17:19:50 -0500 Subject: [PATCH 7/7] feedback --- .../quickstart-kotlin/client/build.gradle.kts | 2 +- .../gradle/libs.versions.toml | 46 +++++++++---------- .../quickstart-kotlin/smithy/build.gradle.kts | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts index 077e3c4..f804e59 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts +++ b/smithy-kotlin-examples/quickstart-kotlin/client/build.gradle.kts @@ -1,4 +1,4 @@ -description = "CoffeeShop service client" +description = "Coffee shop service client" plugins { application diff --git a/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml b/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml index 8ab7a8a..e903caf 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml +++ b/smithy-kotlin-examples/quickstart-kotlin/gradle/libs.versions.toml @@ -1,29 +1,29 @@ [versions] -smithyVersion="1.63.0" -smithyJavaVersion="0.0.1" -smithyKotlinCodegenVersion="0.35.25" -smithyKotlinRuntimeVersion="1.5.25" -coroutinesCoreVersion="1.10.2" +smithy-version="1.63.0" +smithy-java-version="0.0.1" +smithy-kotlin-codegen-version="0.35.25" +smithy-kotlin-runtime-version="1.5.25" +coroutines-core-version="1.10.2" [libraries] -smithy-aws-traits = { module="software.amazon.smithy:smithy-aws-traits", version.ref = "smithyVersion" } +smithy-aws-traits = { module="software.amazon.smithy:smithy-aws-traits", version.ref = "smithy-version" } -smithy-java-plugins = { module="software.amazon.smithy.java.codegen:plugins", version.ref = "smithyJavaVersion" } -smithy-java-server-netty = { module="software.amazon.smithy.java:server-netty", version.ref = "smithyJavaVersion" } -smithy-java-aws-server-restjson = { module="software.amazon.smithy.java:aws-server-restjson", version.ref = "smithyJavaVersion" } -smithy-java-aws-server-rpcv2-cbor = { module="software.amazon.smithy.java:server-rpcv2-cbor", version.ref = "smithyJavaVersion" } +smithy-java-plugins = { module="software.amazon.smithy.java.codegen:plugins", version.ref = "smithy-java-version" } +smithy-java-server-netty = { module="software.amazon.smithy.java:server-netty", version.ref = "smithy-java-version" } +smithy-java-aws-server-restjson = { module="software.amazon.smithy.java:aws-server-restjson", version.ref = "smithy-java-version" } +smithy-java-aws-server-rpcv2-cbor = { module="software.amazon.smithy.java:server-rpcv2-cbor", version.ref = "smithy-java-version" } -smithy-kotlin-aws-codegen = { module = "software.amazon.smithy.kotlin:smithy-aws-kotlin-codegen", version.ref = "smithyKotlinCodegenVersion" } -smithy-kotlin-runtime-core = { module = "aws.smithy.kotlin:runtime-core", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-smithy-client = { module = "aws.smithy.kotlin:smithy-client", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-http-client = { module = "aws.smithy.kotlin:http-client", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-telemetry-api = { module = "aws.smithy.kotlin:telemetry-api", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-telemetry-defaults = { module = "aws.smithy.kotlin:telemetry-defaults", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-rpcv2-protocol = { module = "aws.smithy.kotlin:smithy-rpcv2-protocols", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-aws-protocol-core = { module = "aws.smithy.kotlin:aws-protocol-core", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-aws-signing-common = { module = "aws.smithy.kotlin:aws-signing-common", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-serde = { module = "aws.smithy.kotlin:serde", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-serde-cbor = { module = "aws.smithy.kotlin:serde-cbor", version.ref = "smithyKotlinRuntimeVersion" } -smithy-kotlin-http-client-engine-default = { module = "aws.smithy.kotlin:http-client-engine-default", version.ref = "smithyKotlinRuntimeVersion" } +smithy-kotlin-aws-codegen = { module = "software.amazon.smithy.kotlin:smithy-aws-kotlin-codegen", version.ref = "smithy-kotlin-codegen-version" } +smithy-kotlin-runtime-core = { module = "aws.smithy.kotlin:runtime-core", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-smithy-client = { module = "aws.smithy.kotlin:smithy-client", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-http-client = { module = "aws.smithy.kotlin:http-client", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-telemetry-api = { module = "aws.smithy.kotlin:telemetry-api", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-telemetry-defaults = { module = "aws.smithy.kotlin:telemetry-defaults", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-rpcv2-protocol = { module = "aws.smithy.kotlin:smithy-rpcv2-protocols", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-aws-protocol-core = { module = "aws.smithy.kotlin:aws-protocol-core", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-aws-signing-common = { module = "aws.smithy.kotlin:aws-signing-common", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-serde = { module = "aws.smithy.kotlin:serde", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-serde-cbor = { module = "aws.smithy.kotlin:serde-cbor", version.ref = "smithy-kotlin-runtime-version" } +smithy-kotlin-http-client-engine-default = { module = "aws.smithy.kotlin:http-client-engine-default", version.ref = "smithy-kotlin-runtime-version" } -kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutinesCoreVersion" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines-core-version" } diff --git a/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts b/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts index 44fd208..2fa49d3 100644 --- a/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts +++ b/smithy-kotlin-examples/quickstart-kotlin/smithy/build.gradle.kts @@ -1,4 +1,4 @@ -description = "Smithy definition of a Cafe service." +description = "Smithy definition of a coffee shop service." plugins { `java-library`