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

commonMain.aws.sdk.kotlin.services.kinesisvideo.serde.ImageGenerationConfigurationDocumentSerializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.34
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.kinesisvideo.serde

import aws.sdk.kotlin.services.kinesisvideo.model.ImageGenerationConfiguration
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.Serializer
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

internal fun serializeImageGenerationConfigurationDocument(serializer: Serializer, input: ImageGenerationConfiguration) {
    val DESTINATIONCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DestinationConfig"))
    val FORMAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Format"))
    val FORMATCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("FormatConfig"))
    val HEIGHTPIXELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("HeightPixels"))
    val IMAGESELECTORTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ImageSelectorType"))
    val SAMPLINGINTERVAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("SamplingInterval"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
    val WIDTHPIXELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("WidthPixels"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DESTINATIONCONFIG_DESCRIPTOR)
        field(FORMAT_DESCRIPTOR)
        field(FORMATCONFIG_DESCRIPTOR)
        field(HEIGHTPIXELS_DESCRIPTOR)
        field(IMAGESELECTORTYPE_DESCRIPTOR)
        field(SAMPLINGINTERVAL_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(WIDTHPIXELS_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        field(STATUS_DESCRIPTOR, input.status.value)
        field(IMAGESELECTORTYPE_DESCRIPTOR, input.imageSelectorType.value)
        input.destinationConfig?.let { field(DESTINATIONCONFIG_DESCRIPTOR, it, ::serializeImageGenerationDestinationConfigDocument) }
        field(SAMPLINGINTERVAL_DESCRIPTOR, input.samplingInterval)
        field(FORMAT_DESCRIPTOR, input.format.value)
        if (input.formatConfig != null) {
            mapField(FORMATCONFIG_DESCRIPTOR) {
                input.formatConfig.forEach { (key, value) ->
                    entry(key.value, value)
                }
            }
        }
        input.widthPixels?.let { field(WIDTHPIXELS_DESCRIPTOR, it) }
        input.heightPixels?.let { field(HEIGHTPIXELS_DESCRIPTOR, it) }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy