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

commonMain.aws.sdk.kotlin.services.sagemakergeospatial.serde.GetTileOperationSerializer.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.sagemakergeospatial.serde

import aws.sdk.kotlin.services.sagemakergeospatial.model.GetTileRequest
import aws.sdk.kotlin.services.sagemakergeospatial.model.OutputType
import aws.sdk.kotlin.services.sagemakergeospatial.model.TargetOptions
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 GetTileOperationSerializer: HttpSerializer.NonStreaming {
    override fun serialize(context: ExecutionContext, input: GetTileRequest): HttpRequestBuilder {
        val builder = HttpRequestBuilder()
        builder.method = HttpMethod.GET

        builder.url {
            requireNotNull(input.z) { "z is bound to the URI and must not be null" }
            requireNotNull(input.x) { "x is bound to the URI and must not be null" }
            requireNotNull(input.y) { "y is bound to the URI and must not be null" }
            path.encodedSegments {
                add(PercentEncoding.Path.encode("tile"))
                add(PercentEncoding.SmithyLabel.encode(input.z.toString()))
                add(PercentEncoding.SmithyLabel.encode(input.x.toString()))
                add(PercentEncoding.SmithyLabel.encode(input.y.toString()))
            }
            parameters.decodedParameters(PercentEncoding.SmithyLabel) {
                if (input.arn != null) add("Arn", input.arn)
                if (input.executionRoleArn != null) add("ExecutionRoleArn", input.executionRoleArn)
                if (input.imageAssets?.isNotEmpty() == true) addAll("ImageAssets", input.imageAssets)
                if (input.imageMask != null) add("ImageMask", input.imageMask.toString())
                if (input.outputDataType != null) add("OutputDataType", input.outputDataType.value)
                if (input.outputFormat != null) add("OutputFormat", input.outputFormat)
                if (input.propertyFilters != null) add("PropertyFilters", input.propertyFilters)
                if (input.target != null) add("Target", input.target.value)
                if (input.timeRangeFilter != null) add("TimeRangeFilter", input.timeRangeFilter)
            }
        }

        return builder
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy