aws.sdk.kotlin.services.sagemaker.transform.ContainerDefinitionDocumentSerializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.sagemaker.transform
import aws.sdk.kotlin.services.sagemaker.model.ContainerDefinition
import aws.sdk.kotlin.services.sagemaker.model.ContainerMode
import aws.sdk.kotlin.services.sagemaker.model.ImageConfig
import aws.sdk.kotlin.services.sagemaker.model.MultiModelConfig
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 serializeContainerDefinitionDocument(serializer: Serializer, input: ContainerDefinition) {
val CONTAINERHOSTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ContainerHostname"))
val ENVIRONMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Environment"))
val IMAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Image"))
val IMAGECONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ImageConfig"))
val INFERENCESPECIFICATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InferenceSpecificationName"))
val MODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Mode"))
val MODELDATAURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ModelDataUrl"))
val MODELPACKAGENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ModelPackageName"))
val MULTIMODELCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MultiModelConfig"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONTAINERHOSTNAME_DESCRIPTOR)
field(ENVIRONMENT_DESCRIPTOR)
field(IMAGE_DESCRIPTOR)
field(IMAGECONFIG_DESCRIPTOR)
field(INFERENCESPECIFICATIONNAME_DESCRIPTOR)
field(MODE_DESCRIPTOR)
field(MODELDATAURL_DESCRIPTOR)
field(MODELPACKAGENAME_DESCRIPTOR)
field(MULTIMODELCONFIG_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.containerHostname?.let { field(CONTAINERHOSTNAME_DESCRIPTOR, it) }
input.image?.let { field(IMAGE_DESCRIPTOR, it) }
input.imageConfig?.let { field(IMAGECONFIG_DESCRIPTOR, it, ::serializeImageConfigDocument) }
input.mode?.let { field(MODE_DESCRIPTOR, it.value) }
input.modelDataUrl?.let { field(MODELDATAURL_DESCRIPTOR, it) }
if (input.environment != null) {
mapField(ENVIRONMENT_DESCRIPTOR) {
input.environment.forEach { (key, value) -> entry(key, value) }
}
}
input.modelPackageName?.let { field(MODELPACKAGENAME_DESCRIPTOR, it) }
input.inferenceSpecificationName?.let { field(INFERENCESPECIFICATIONNAME_DESCRIPTOR, it) }
input.multiModelConfig?.let { field(MULTIMODELCONFIG_DESCRIPTOR, it, ::serializeMultiModelConfigDocument) }
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy