33 * SPDX-License-Identifier: Apache-2.0.
44 */
55
6- package aws.sdk .kotlin.runtime.crt
6+ package aws.smithy .kotlin.runtime.crt
77
88import aws.sdk.kotlin.crt.http.HttpRequestBodyStream
9- import aws.sdk.kotlin.runtime.InternalSdkApi
109import aws.smithy.kotlin.runtime.http.*
1110import aws.smithy.kotlin.runtime.http.request.HttpRequest
1211import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder
1312import aws.smithy.kotlin.runtime.http.util.splitAsQueryParameters
13+ import aws.smithy.kotlin.runtime.util.InternalApi
1414import kotlin.coroutines.coroutineContext
1515import aws.sdk.kotlin.crt.http.Headers as HeadersCrt
1616import aws.sdk.kotlin.crt.http.HttpRequest as HttpRequestCrt
1717
1818/* *
1919 * Convert an [HttpRequestBuilder] into a CRT HttpRequest for the purpose of signing.
2020 */
21- @InternalSdkApi
21+ @InternalApi
2222public suspend fun HttpRequestBuilder.toSignableCrtRequest (unsignedPayload : Boolean = false): HttpRequestCrt {
2323 // Streams that implement HttpBody.Streaming and are not replayable are not signable without consuming the stream
2424 // and would need to go through chunked signing or unsigned payload
@@ -49,7 +49,7 @@ private suspend fun signableBodyStream(body: HttpBody): HttpRequestBodyStream? =
4949/* *
5050 * Convert an [HttpRequest] into a CRT HttpRequest for the purposes of signing
5151 */
52- @InternalSdkApi
52+ @InternalApi
5353public suspend fun HttpRequest.toSignableCrtRequest (): HttpRequestCrt =
5454 HttpRequestCrt (
5555 method = method.name,
@@ -70,7 +70,7 @@ private class HttpHeadersCrt(val headers: HeadersBuilder) : HeadersCrt {
7070/* *
7171 * Update a request builder from a CRT HTTP request (primary use is updating a request builder after signing)
7272 */
73- @InternalSdkApi
73+ @InternalApi
7474public fun HttpRequestBuilder.update (crtRequest : HttpRequestCrt ) {
7575 crtRequest.headers.entries().forEach { entry ->
7676 headers.appendMissing(entry.key, entry.value)
@@ -94,7 +94,7 @@ public fun HttpRequestBuilder.update(crtRequest: HttpRequestCrt) {
9494 * Get just the query parameters (if any)
9595 * @return the query parameters from the path or null if there weren't any
9696 */
97- @InternalSdkApi
97+ @InternalApi
9898public fun HttpRequestCrt.queryParameters (): QueryParameters ? {
9999 val idx = encodedPath.indexOf(" ?" )
100100 if (idx < 0 || idx + 1 > encodedPath.length) return null
@@ -108,14 +108,14 @@ public fun HttpRequestCrt.queryParameters(): QueryParameters? {
108108 * Get just the encoded path sans any query or fragment
109109 * @return the URI path segment from the encoded path
110110 */
111- @InternalSdkApi
111+ @InternalApi
112112public fun HttpRequestCrt.path (): String {
113113 val idx = encodedPath.indexOf(" ?" )
114114 return if (idx > 0 ) encodedPath.substring(0 , idx) else encodedPath
115115}
116116
117117// Convert CRT header type to SDK header type
118- @InternalSdkApi
118+ @InternalApi
119119public fun aws.sdk.kotlin.crt.http.Headers.toSdkHeaders (): Headers {
120120 val headersBuilder = HeadersBuilder ()
121121
@@ -127,7 +127,7 @@ public fun aws.sdk.kotlin.crt.http.Headers.toSdkHeaders(): Headers {
127127}
128128
129129// Convert SDK header type to CRT header type
130- @InternalSdkApi
130+ @InternalApi
131131public fun Headers.toCrtHeaders (): aws.sdk.kotlin.crt.http.Headers {
132132 val headersBuilder = aws.sdk.kotlin.crt.http.HeadersBuilder ()
133133
0 commit comments