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

commonMain.aws.sdk.kotlin.services.medicalimaging.serde.SearchByAttributeValueDocumentSerializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.medicalimaging.serde

import aws.sdk.kotlin.services.medicalimaging.model.SearchByAttributeValue
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
import aws.smithy.kotlin.runtime.time.TimestampFormat

internal fun serializeSearchByAttributeValueDocument(serializer: Serializer, input: SearchByAttributeValue) {
    val DICOMACCESSIONNUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DICOMAccessionNumber"))
    val DICOMPATIENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DICOMPatientId"))
    val DICOMSERIESINSTANCEUID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DICOMSeriesInstanceUID"))
    val DICOMSTUDYDATEANDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DICOMStudyDateAndTime"))
    val DICOMSTUDYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DICOMStudyId"))
    val DICOMSTUDYINSTANCEUID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DICOMStudyInstanceUID"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdAt"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("updatedAt"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(DICOMACCESSIONNUMBER_DESCRIPTOR)
        field(DICOMPATIENTID_DESCRIPTOR)
        field(DICOMSERIESINSTANCEUID_DESCRIPTOR)
        field(DICOMSTUDYDATEANDTIME_DESCRIPTOR)
        field(DICOMSTUDYID_DESCRIPTOR)
        field(DICOMSTUDYINSTANCEUID_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(UPDATEDAT_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        when (input) {
            is SearchByAttributeValue.DicomPatientId -> field(DICOMPATIENTID_DESCRIPTOR, input.value)
            is SearchByAttributeValue.DicomAccessionNumber -> field(DICOMACCESSIONNUMBER_DESCRIPTOR, input.value)
            is SearchByAttributeValue.DicomStudyId -> field(DICOMSTUDYID_DESCRIPTOR, input.value)
            is SearchByAttributeValue.DicomStudyInstanceUid -> field(DICOMSTUDYINSTANCEUID_DESCRIPTOR, input.value)
            is SearchByAttributeValue.DicomSeriesInstanceUid -> field(DICOMSERIESINSTANCEUID_DESCRIPTOR, input.value)
            is SearchByAttributeValue.CreatedAt -> field(CREATEDAT_DESCRIPTOR, input.value, TimestampFormat.EPOCH_SECONDS)
            is SearchByAttributeValue.UpdatedAt -> field(UPDATEDAT_DESCRIPTOR, input.value, TimestampFormat.EPOCH_SECONDS)
            is SearchByAttributeValue.DicomStudyDateAndTime -> field(DICOMSTUDYDATEANDTIME_DESCRIPTOR, input.value, ::serializeDicomStudyDateAndTimeDocument)
            is SearchByAttributeValue.SdkUnknown -> throw SerializationException("Cannot serialize SdkUnknown")
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy