commonMain.aws.sdk.kotlin.services.databrew.serde.UpdateRecipeJobOperationSerializer.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.DataCatalogOutput
import aws.sdk.kotlin.services.databrew.model.DatabaseOutput
import aws.sdk.kotlin.services.databrew.model.EncryptionMode
import aws.sdk.kotlin.services.databrew.model.LogSubscription
import aws.sdk.kotlin.services.databrew.model.Output
import aws.sdk.kotlin.services.databrew.model.UpdateRecipeJobRequest
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 UpdateRecipeJobOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: UpdateRecipeJobRequest): 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("recipeJobs"))
add(PercentEncoding.SmithyLabel.encode("${input.name}"))
}
}
val payload = serializeUpdateRecipeJobOperationBody(context, input)
builder.body = HttpBody.fromBytes(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/json")
}
return builder
}
}
private fun serializeUpdateRecipeJobOperationBody(context: ExecutionContext, input: UpdateRecipeJobRequest): ByteArray {
val serializer = JsonSerializer()
val DATACATALOGOUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DataCatalogOutputs"))
val DATABASEOUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DatabaseOutputs"))
val ENCRYPTIONKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EncryptionKeyArn"))
val ENCRYPTIONMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EncryptionMode"))
val LOGSUBSCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("LogSubscription"))
val MAXCAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxCapacity"))
val MAXRETRIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxRetries"))
val OUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Outputs"))
val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RoleArn"))
val TIMEOUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Timeout"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DATACATALOGOUTPUTS_DESCRIPTOR)
field(DATABASEOUTPUTS_DESCRIPTOR)
field(ENCRYPTIONKEYARN_DESCRIPTOR)
field(ENCRYPTIONMODE_DESCRIPTOR)
field(LOGSUBSCRIPTION_DESCRIPTOR)
field(MAXCAPACITY_DESCRIPTOR)
field(MAXRETRIES_DESCRIPTOR)
field(OUTPUTS_DESCRIPTOR)
field(ROLEARN_DESCRIPTOR)
field(TIMEOUT_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
if (input.dataCatalogOutputs != null) {
listField(DATACATALOGOUTPUTS_DESCRIPTOR) {
for (el0 in input.dataCatalogOutputs) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeDataCatalogOutputDocument))
}
}
}
if (input.databaseOutputs != null) {
listField(DATABASEOUTPUTS_DESCRIPTOR) {
for (el0 in input.databaseOutputs) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeDatabaseOutputDocument))
}
}
}
input.encryptionKeyArn?.let { field(ENCRYPTIONKEYARN_DESCRIPTOR, it) }
input.encryptionMode?.let { field(ENCRYPTIONMODE_DESCRIPTOR, it.value) }
input.logSubscription?.let { field(LOGSUBSCRIPTION_DESCRIPTOR, it.value) }
input.maxCapacity?.let { field(MAXCAPACITY_DESCRIPTOR, it) }
input.maxRetries?.let { field(MAXRETRIES_DESCRIPTOR, it) }
if (input.outputs != null) {
listField(OUTPUTS_DESCRIPTOR) {
for (el0 in input.outputs) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeOutputDocument))
}
}
}
input.roleArn?.let { field(ROLEARN_DESCRIPTOR, it) }
input.timeout?.let { field(TIMEOUT_DESCRIPTOR, it) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy