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

commonMain.aws.sdk.kotlin.services.deadline.serde.JobParameterDocumentSerializer.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.deadline.serde

import aws.sdk.kotlin.services.deadline.model.JobParameter
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.SerializationException
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 serializeJobParameterDocument(serializer: Serializer, input: JobParameter) {
    val FLOAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("float"))
    val INT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("int"))
    val PATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("path"))
    val STRING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("string"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(FLOAT_DESCRIPTOR)
        field(INT_DESCRIPTOR)
        field(PATH_DESCRIPTOR)
        field(STRING_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        when (input) {
            is JobParameter.Int -> field(INT_DESCRIPTOR, input.value)
            is JobParameter.Float -> field(FLOAT_DESCRIPTOR, input.value)
            is JobParameter.String -> field(STRING_DESCRIPTOR, input.value)
            is JobParameter.Path -> field(PATH_DESCRIPTOR, input.value)
            is JobParameter.SdkUnknown -> throw SerializationException("Cannot serialize SdkUnknown")
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy