commonMain.aws.sdk.kotlin.services.cognitosync.serde.SubscribeToDatasetOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cognitosync-jvm Show documentation
Show all versions of cognitosync-jvm Show documentation
The AWS SDK for Kotlin client for Cognito Sync
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cognitosync.serde
import aws.sdk.kotlin.services.cognitosync.model.SubscribeToDatasetRequest
import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.operation.HttpSerializer
import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder
import aws.smithy.kotlin.runtime.http.request.url
import aws.smithy.kotlin.runtime.operation.ExecutionContext
import aws.smithy.kotlin.runtime.text.encoding.PercentEncoding
internal class SubscribeToDatasetOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: SubscribeToDatasetRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
requireNotNull(input.identityPoolId) { "identityPoolId is bound to the URI and must not be null" }
requireNotNull(input.identityId) { "identityId is bound to the URI and must not be null" }
requireNotNull(input.datasetName) { "datasetName is bound to the URI and must not be null" }
requireNotNull(input.deviceId) { "deviceId is bound to the URI and must not be null" }
path.encodedSegments {
add(PercentEncoding.Path.encode("identitypools"))
add(PercentEncoding.SmithyLabel.encode(input.identityPoolId))
add(PercentEncoding.Path.encode("identities"))
add(PercentEncoding.SmithyLabel.encode(input.identityId))
add(PercentEncoding.Path.encode("datasets"))
add(PercentEncoding.SmithyLabel.encode(input.datasetName))
add(PercentEncoding.Path.encode("subscriptions"))
add(PercentEncoding.SmithyLabel.encode(input.deviceId))
}
}
return builder
}
}