commonMain.aws.sdk.kotlin.services.elastictranscoder.serde.JobDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elastictranscoder-jvm Show documentation
Show all versions of elastictranscoder-jvm Show documentation
The AWS SDK for Kotlin client for Elastic Transcoder
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.elastictranscoder.serde
import aws.sdk.kotlin.services.elastictranscoder.model.Job
import aws.sdk.kotlin.services.elastictranscoder.model.JobInput
import aws.sdk.kotlin.services.elastictranscoder.model.JobOutput
import aws.sdk.kotlin.services.elastictranscoder.model.Playlist
import aws.smithy.kotlin.runtime.serde.Deserializer
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.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf
internal fun deserializeJobDocument(deserializer: Deserializer): Job {
val builder = Job.Builder()
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Arn"))
val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Id"))
val INPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Input"))
val INPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Inputs"))
val OUTPUT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Output"))
val OUTPUTKEYPREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OutputKeyPrefix"))
val OUTPUTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Outputs"))
val PIPELINEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PipelineId"))
val PLAYLISTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Playlists"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Status"))
val TIMING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Timing"))
val USERMETADATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("UserMetadata"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ARN_DESCRIPTOR)
field(ID_DESCRIPTOR)
field(INPUT_DESCRIPTOR)
field(INPUTS_DESCRIPTOR)
field(OUTPUT_DESCRIPTOR)
field(OUTPUTKEYPREFIX_DESCRIPTOR)
field(OUTPUTS_DESCRIPTOR)
field(PIPELINEID_DESCRIPTOR)
field(PLAYLISTS_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TIMING_DESCRIPTOR)
field(USERMETADATA_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
ID_DESCRIPTOR.index -> builder.id = deserializeString()
INPUT_DESCRIPTOR.index -> builder.input = deserializeJobInputDocument(deserializer)
INPUTS_DESCRIPTOR.index -> builder.inputs =
deserializer.deserializeList(INPUTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeJobInputDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
OUTPUT_DESCRIPTOR.index -> builder.output = deserializeJobOutputDocument(deserializer)
OUTPUTKEYPREFIX_DESCRIPTOR.index -> builder.outputKeyPrefix = deserializeString()
OUTPUTS_DESCRIPTOR.index -> builder.outputs =
deserializer.deserializeList(OUTPUTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeJobOutputDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
PIPELINEID_DESCRIPTOR.index -> builder.pipelineId = deserializeString()
PLAYLISTS_DESCRIPTOR.index -> builder.playlists =
deserializer.deserializeList(PLAYLISTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializePlaylistDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
STATUS_DESCRIPTOR.index -> builder.status = deserializeString()
TIMING_DESCRIPTOR.index -> builder.timing = deserializeTimingDocument(deserializer)
USERMETADATA_DESCRIPTOR.index -> builder.userMetadata =
deserializer.deserializeMap(USERMETADATA_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy