commonMain.aws.sdk.kotlin.services.databrew.serde.SendProjectSessionActionOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of databrew-jvm Show documentation
Show all versions of databrew-jvm Show documentation
The AWS Kotlin client for DataBrew
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.databrew.serde
import aws.sdk.kotlin.services.databrew.model.RecipeStep
import aws.sdk.kotlin.services.databrew.model.SendProjectSessionActionRequest
import aws.sdk.kotlin.services.databrew.model.ViewFrame
import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.operation.HttpSerialize
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.serde.SdkFieldDescriptor
import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor
import aws.smithy.kotlin.runtime.serde.SerialKind
import aws.smithy.kotlin.runtime.serde.asSdkSerializable
import aws.smithy.kotlin.runtime.serde.deserializeList
import aws.smithy.kotlin.runtime.serde.deserializeMap
import aws.smithy.kotlin.runtime.serde.deserializeStruct
import aws.smithy.kotlin.runtime.serde.field
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
import aws.smithy.kotlin.runtime.serde.json.JsonSerializer
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import aws.smithy.kotlin.runtime.text.encoding.PercentEncoding
internal class SendProjectSessionActionOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: SendProjectSessionActionRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.PUT
builder.url {
requireNotNull(input.name) { "name is bound to the URI and must not be null" }
path.encodedSegments {
add(PercentEncoding.Path.encode("projects"))
add(PercentEncoding.SmithyLabel.encode("${input.name}"))
add(PercentEncoding.Path.encode("sendProjectSessionAction"))
}
}
val payload = serializeSendProjectSessionActionOperationBody(context, input)
builder.body = HttpBody.fromBytes(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/json")
}
return builder
}
}
private fun serializeSendProjectSessionActionOperationBody(context: ExecutionContext, input: SendProjectSessionActionRequest): ByteArray {
val serializer = JsonSerializer()
val CLIENTSESSIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ClientSessionId"))
val PREVIEW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Preview"))
val RECIPESTEP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RecipeStep"))
val STEPINDEX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("StepIndex"))
val VIEWFRAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ViewFrame"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CLIENTSESSIONID_DESCRIPTOR)
field(PREVIEW_DESCRIPTOR)
field(RECIPESTEP_DESCRIPTOR)
field(STEPINDEX_DESCRIPTOR)
field(VIEWFRAME_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.clientSessionId?.let { field(CLIENTSESSIONID_DESCRIPTOR, it) }
input.preview?.let { field(PREVIEW_DESCRIPTOR, it) }
input.recipeStep?.let { field(RECIPESTEP_DESCRIPTOR, it, ::serializeRecipeStepDocument) }
input.stepIndex?.let { field(STEPINDEX_DESCRIPTOR, it) }
input.viewFrame?.let { field(VIEWFRAME_DESCRIPTOR, it, ::serializeViewFrameDocument) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy