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

commonMain.aws.sdk.kotlin.services.route53domains.serde.ContactDetailDocumentSerializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.route53domains.serde

import aws.sdk.kotlin.services.route53domains.model.ContactDetail
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 serializeContactDetailDocument(serializer: Serializer, input: ContactDetail) {
    val ADDRESSLINE1_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AddressLine1"))
    val ADDRESSLINE2_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AddressLine2"))
    val CITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("City"))
    val CONTACTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ContactType"))
    val COUNTRYCODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("CountryCode"))
    val EMAIL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Email"))
    val EXTRAPARAMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ExtraParams"))
    val FAX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Fax"))
    val FIRSTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FirstName"))
    val LASTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LastName"))
    val ORGANIZATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OrganizationName"))
    val PHONENUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PhoneNumber"))
    val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("State"))
    val ZIPCODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ZipCode"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ADDRESSLINE1_DESCRIPTOR)
        field(ADDRESSLINE2_DESCRIPTOR)
        field(CITY_DESCRIPTOR)
        field(CONTACTTYPE_DESCRIPTOR)
        field(COUNTRYCODE_DESCRIPTOR)
        field(EMAIL_DESCRIPTOR)
        field(EXTRAPARAMS_DESCRIPTOR)
        field(FAX_DESCRIPTOR)
        field(FIRSTNAME_DESCRIPTOR)
        field(LASTNAME_DESCRIPTOR)
        field(ORGANIZATIONNAME_DESCRIPTOR)
        field(PHONENUMBER_DESCRIPTOR)
        field(STATE_DESCRIPTOR)
        field(ZIPCODE_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.firstName?.let { field(FIRSTNAME_DESCRIPTOR, it) }
        input.lastName?.let { field(LASTNAME_DESCRIPTOR, it) }
        input.contactType?.let { field(CONTACTTYPE_DESCRIPTOR, it.value) }
        input.organizationName?.let { field(ORGANIZATIONNAME_DESCRIPTOR, it) }
        input.addressLine1?.let { field(ADDRESSLINE1_DESCRIPTOR, it) }
        input.addressLine2?.let { field(ADDRESSLINE2_DESCRIPTOR, it) }
        input.city?.let { field(CITY_DESCRIPTOR, it) }
        input.state?.let { field(STATE_DESCRIPTOR, it) }
        input.countryCode?.let { field(COUNTRYCODE_DESCRIPTOR, it.value) }
        input.zipCode?.let { field(ZIPCODE_DESCRIPTOR, it) }
        input.phoneNumber?.let { field(PHONENUMBER_DESCRIPTOR, it) }
        input.email?.let { field(EMAIL_DESCRIPTOR, it) }
        input.fax?.let { field(FAX_DESCRIPTOR, it) }
        if (input.extraParams != null) {
            listField(EXTRAPARAMS_DESCRIPTOR) {
                for (el0 in input.extraParams) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeExtraParamDocument))
                }
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy