All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.cognitosync.serde.SubscribeToDatasetOperationSerializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.77
Show newest version
// 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
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy