commonMain.aws.sdk.kotlin.services.databrew.serde.CreateRecipeJobOperationSerializer.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.CreateRecipeJobRequest
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.RecipeReference
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.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
internal class CreateRecipeJobOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: CreateRecipeJobRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/recipeJobs"
}
val payload = serializeCreateRecipeJobOperationBody(context, input)
builder.body = HttpBody.fromBytes(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/json")
}
return builder
}
}
private fun serializeCreateRecipeJobOperationBody(context: ExecutionContext, input: CreateRecipeJobRequest): ByteArray {
val serializer = JsonSerializer()
val DATACATALOGOUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DataCatalogOutputs"))
val DATABASEOUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DatabaseOutputs"))
val DATASETNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DatasetName"))
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 NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val OUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Outputs"))
val PROJECTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ProjectName"))
val RECIPEREFERENCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RecipeReference"))
val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RoleArn"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Tags"))
val TIMEOUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Timeout"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DATACATALOGOUTPUTS_DESCRIPTOR)
field(DATABASEOUTPUTS_DESCRIPTOR)
field(DATASETNAME_DESCRIPTOR)
field(ENCRYPTIONKEYARN_DESCRIPTOR)
field(ENCRYPTIONMODE_DESCRIPTOR)
field(LOGSUBSCRIPTION_DESCRIPTOR)
field(MAXCAPACITY_DESCRIPTOR)
field(MAXRETRIES_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(OUTPUTS_DESCRIPTOR)
field(PROJECTNAME_DESCRIPTOR)
field(RECIPEREFERENCE_DESCRIPTOR)
field(ROLEARN_DESCRIPTOR)
field(TAGS_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.datasetName?.let { field(DATASETNAME_DESCRIPTOR, it) }
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) }
input.name?.let { field(NAME_DESCRIPTOR, it) }
if (input.outputs != null) {
listField(OUTPUTS_DESCRIPTOR) {
for (el0 in input.outputs) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeOutputDocument))
}
}
}
input.projectName?.let { field(PROJECTNAME_DESCRIPTOR, it) }
input.recipeReference?.let { field(RECIPEREFERENCE_DESCRIPTOR, it, ::serializeRecipeReferenceDocument) }
input.roleArn?.let { field(ROLEARN_DESCRIPTOR, it) }
if (input.tags != null) {
mapField(TAGS_DESCRIPTOR) {
input.tags.forEach { (key, value) ->
entry(key, value)
}
}
}
input.timeout?.let { field(TIMEOUT_DESCRIPTOR, it) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy