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

commonMain.aws.sdk.kotlin.services.chimesdkmediapipelines.serde.MediaInsightsPipelineDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.chimesdkmediapipelines.serde

import aws.sdk.kotlin.services.chimesdkmediapipelines.model.MediaInsightsPipeline
import aws.sdk.kotlin.services.chimesdkmediapipelines.model.MediaInsightsPipelineElementStatus
import aws.sdk.kotlin.services.chimesdkmediapipelines.model.MediaPipelineStatus
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf

internal fun deserializeMediaInsightsPipelineDocument(deserializer: Deserializer): MediaInsightsPipeline {
    val builder = MediaInsightsPipeline.Builder()
    val CREATEDTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedTimestamp"))
    val ELEMENTSTATUSES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ElementStatuses"))
    val KINESISVIDEOSTREAMRECORDINGSOURCERUNTIMECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("KinesisVideoStreamRecordingSourceRuntimeConfiguration"))
    val KINESISVIDEOSTREAMSOURCERUNTIMECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("KinesisVideoStreamSourceRuntimeConfiguration"))
    val MEDIAINSIGHTSPIPELINECONFIGURATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MediaInsightsPipelineConfigurationArn"))
    val MEDIAINSIGHTSRUNTIMEMETADATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("MediaInsightsRuntimeMetadata"))
    val MEDIAPIPELINEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MediaPipelineArn"))
    val MEDIAPIPELINEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MediaPipelineId"))
    val S3RECORDINGSINKRUNTIMECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("S3RecordingSinkRuntimeConfiguration"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CREATEDTIMESTAMP_DESCRIPTOR)
        field(ELEMENTSTATUSES_DESCRIPTOR)
        field(KINESISVIDEOSTREAMRECORDINGSOURCERUNTIMECONFIGURATION_DESCRIPTOR)
        field(KINESISVIDEOSTREAMSOURCERUNTIMECONFIGURATION_DESCRIPTOR)
        field(MEDIAINSIGHTSPIPELINECONFIGURATIONARN_DESCRIPTOR)
        field(MEDIAINSIGHTSRUNTIMEMETADATA_DESCRIPTOR)
        field(MEDIAPIPELINEARN_DESCRIPTOR)
        field(MEDIAPIPELINEID_DESCRIPTOR)
        field(S3RECORDINGSINKRUNTIMECONFIGURATION_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CREATEDTIMESTAMP_DESCRIPTOR.index -> builder.createdTimestamp = deserializeInstant(TimestampFormat.ISO_8601)
                ELEMENTSTATUSES_DESCRIPTOR.index -> builder.elementStatuses =
                    deserializer.deserializeList(ELEMENTSTATUSES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeMediaInsightsPipelineElementStatusDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                KINESISVIDEOSTREAMRECORDINGSOURCERUNTIMECONFIGURATION_DESCRIPTOR.index -> builder.kinesisVideoStreamRecordingSourceRuntimeConfiguration = deserializeKinesisVideoStreamRecordingSourceRuntimeConfigurationDocument(deserializer)
                KINESISVIDEOSTREAMSOURCERUNTIMECONFIGURATION_DESCRIPTOR.index -> builder.kinesisVideoStreamSourceRuntimeConfiguration = deserializeKinesisVideoStreamSourceRuntimeConfigurationDocument(deserializer)
                MEDIAINSIGHTSPIPELINECONFIGURATIONARN_DESCRIPTOR.index -> builder.mediaInsightsPipelineConfigurationArn = deserializeString()
                MEDIAINSIGHTSRUNTIMEMETADATA_DESCRIPTOR.index -> builder.mediaInsightsRuntimeMetadata =
                    deserializer.deserializeMap(MEDIAINSIGHTSRUNTIMEMETADATA_DESCRIPTOR) {
                        val map0 = mutableMapOf()
                        while (hasNextEntry()) {
                            val k0 = key()
                            val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            map0[k0] = v0
                        }
                        map0
                    }
                MEDIAPIPELINEARN_DESCRIPTOR.index -> builder.mediaPipelineArn = deserializeString()
                MEDIAPIPELINEID_DESCRIPTOR.index -> builder.mediaPipelineId = deserializeString()
                S3RECORDINGSINKRUNTIMECONFIGURATION_DESCRIPTOR.index -> builder.s3RecordingSinkRuntimeConfiguration = deserializeS3RecordingSinkRuntimeConfigurationDocument(deserializer)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { MediaPipelineStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy