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

commonMain.aws.sdk.kotlin.services.codeguruprofiler.transform.GetProfileOperationSerializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.codeguruprofiler.transform

import aws.sdk.kotlin.services.codeguruprofiler.model.GetProfileRequest
import aws.smithy.kotlin.runtime.client.ExecutionContext
import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.content.ByteArrayContent
import aws.smithy.kotlin.runtime.http.operation.HttpSerialize
import aws.smithy.kotlin.runtime.http.parameters
import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder
import aws.smithy.kotlin.runtime.http.request.headers
import aws.smithy.kotlin.runtime.http.request.url
import aws.smithy.kotlin.runtime.http.util.encodeLabel
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat


internal class GetProfileOperationSerializer: HttpSerialize {
    override suspend fun serialize(context: ExecutionContext, input: GetProfileRequest): HttpRequestBuilder {
        val builder = HttpRequestBuilder()
        builder.method = HttpMethod.GET

        builder.url {
            val pathSegments = listOf(
                "profilingGroups",
                "${input.profilingGroupName}".encodeLabel(),
                "profile",
            )
            path = pathSegments.joinToString(separator = "/", prefix = "/")
            parameters {
                if (input.endTime != null) append("endTime", input.endTime.format(TimestampFormat.ISO_8601))
                if (input.maxDepth != null) append("maxDepth", "${input.maxDepth}")
                if (input.period != null) append("period", input.period)
                if (input.startTime != null) append("startTime", input.startTime.format(TimestampFormat.ISO_8601))
            }
        }

        builder.headers {
            if (input.accept?.isNotEmpty() == true) append("Accept", input.accept)
        }

        return builder
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy