Skip to content

Commit cbf83d8

Browse files
authored
refactor: break out service client runtime into own module (#789)
1 parent 0dc1b26 commit cbf83d8

30 files changed

+76
-38
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "7aac1367-7140-43d9-9e3b-b69a2429fec7",
3+
"type": "misc",
4+
"description": "Refactor: break out service client runtime components into own module"
5+
}

runtime/protocol/http/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ kotlin {
1616
dependencies {
1717
// exposes: Attributes, middleware
1818
api(project(":runtime:runtime-core"))
19+
// FIXME: temporary until we split out http-client
20+
api(project(":runtime:smithy-client"))
1921
implementation(project(":runtime:logging"))
2022
// exposes: TracingContext.TraceSpan
2123
api(project(":runtime:tracing:tracing-core"))

runtime/runtime-core/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ plugins {
1818
kotlin("plugin.serialization") version "1.8.0"
1919
}
2020

21-
description = "Client runtime for Smithy services generated by smithy-kotlin"
22-
extra["displayName"] = "Smithy :: Kotlin :: Client Runtime"
21+
description = "Core runtime for Smithy clients and services generated by smithy-kotlin"
22+
extra["displayName"] = "Smithy :: Kotlin :: Runtime"
2323
extra["moduleName"] = "aws.smithy.kotlin.runtime"
2424

2525
val coroutinesVersion: String by project

runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Exceptions.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55
package aws.smithy.kotlin.runtime
66

7-
import aws.smithy.kotlin.runtime.client.SdkClientOption
87
import aws.smithy.kotlin.runtime.util.AttributeKey
98
import aws.smithy.kotlin.runtime.util.Attributes
109

@@ -82,12 +81,6 @@ public open class ServiceErrorMetadata : ErrorMetadata() {
8281
public val RequestId: AttributeKey<String> = AttributeKey("RequestId")
8382
}
8483

85-
/**
86-
* The name of the service that sent this error response
87-
*/
88-
public val serviceName: String
89-
get() = attributes.getOrNull(SdkClientOption.ServiceName) ?: ""
90-
9184
/**
9285
* Returns the error code associated with the response (if available).
9386
*
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
description = "Client runtime for Smithy services generated by smithy-kotlin"
6+
extra["displayName"] = "Smithy :: Kotlin :: Client Runtime"
7+
extra["moduleName"] = "aws.smithy.kotlin.runtime.client"
8+
9+
val coroutinesVersion: String by project
10+
11+
kotlin {
12+
sourceSets {
13+
commonMain {
14+
dependencies {
15+
api(project(":runtime:runtime-core"))
16+
}
17+
}
18+
commonTest {
19+
dependencies {
20+
api("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
21+
implementation(project(":runtime:testing"))
22+
}
23+
}
24+
25+
all {
26+
languageSettings.optIn("aws.smithy.kotlin.runtime.InternalApi")
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)