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

commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.CreateEndpointOperationSerializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.databasemigrationservice.serde

import aws.sdk.kotlin.services.databasemigrationservice.model.CreateEndpointRequest
import aws.sdk.kotlin.services.databasemigrationservice.model.DmsSslModeValue
import aws.sdk.kotlin.services.databasemigrationservice.model.DmsTransferSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.DocDbSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.DynamoDbSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.ElasticsearchSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.GcpMySqlSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.IbmDb2Settings
import aws.sdk.kotlin.services.databasemigrationservice.model.KafkaSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.KinesisSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.MicrosoftSqlServerSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.MongoDbSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.MySqlSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.NeptuneSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.OracleSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.PostgreSqlSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.RedisSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.RedshiftSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.ReplicationEndpointTypeValue
import aws.sdk.kotlin.services.databasemigrationservice.model.S3Settings
import aws.sdk.kotlin.services.databasemigrationservice.model.SybaseSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.Tag
import aws.sdk.kotlin.services.databasemigrationservice.model.TimestreamSettings
import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.operation.HttpSerializer
import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder
import aws.smithy.kotlin.runtime.http.request.url
import aws.smithy.kotlin.runtime.operation.ExecutionContext
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.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.json.JsonSerializer
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct


internal class CreateEndpointOperationSerializer: HttpSerializer.NonStreaming {
    override fun serialize(context: ExecutionContext, input: CreateEndpointRequest): HttpRequestBuilder {
        val builder = HttpRequestBuilder()
        builder.method = HttpMethod.POST

        builder.url {
            path.encoded = "/"
        }

        val payload = serializeCreateEndpointOperationBody(context, input)
        builder.body = HttpBody.fromBytes(payload)
        if (builder.body !is HttpBody.Empty) {
            builder.headers.setMissing("Content-Type", "application/x-amz-json-1.1")
        }
        return builder
    }
}

private fun serializeCreateEndpointOperationBody(context: ExecutionContext, input: CreateEndpointRequest): ByteArray {
    val serializer = JsonSerializer()
    val CERTIFICATEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CertificateArn"))
    val DATABASENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DatabaseName"))
    val DMSTRANSFERSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DmsTransferSettings"))
    val DOCDBSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DocDbSettings"))
    val DYNAMODBSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DynamoDbSettings"))
    val ELASTICSEARCHSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ElasticsearchSettings"))
    val ENDPOINTIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EndpointIdentifier"))
    val ENDPOINTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("EndpointType"))
    val ENGINENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EngineName"))
    val EXTERNALTABLEDEFINITION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ExternalTableDefinition"))
    val EXTRACONNECTIONATTRIBUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ExtraConnectionAttributes"))
    val GCPMYSQLSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("GcpMySQLSettings"))
    val IBMDB2SETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("IBMDb2Settings"))
    val KAFKASETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("KafkaSettings"))
    val KINESISSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("KinesisSettings"))
    val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KmsKeyId"))
    val MICROSOFTSQLSERVERSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MicrosoftSQLServerSettings"))
    val MONGODBSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MongoDbSettings"))
    val MYSQLSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MySQLSettings"))
    val NEPTUNESETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("NeptuneSettings"))
    val ORACLESETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("OracleSettings"))
    val PASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Password"))
    val PORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Port"))
    val POSTGRESQLSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("PostgreSQLSettings"))
    val REDISSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RedisSettings"))
    val REDSHIFTSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("RedshiftSettings"))
    val RESOURCEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceIdentifier"))
    val S3SETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("S3Settings"))
    val SERVERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServerName"))
    val SERVICEACCESSROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServiceAccessRoleArn"))
    val SSLMODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SslMode"))
    val SYBASESETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SybaseSettings"))
    val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
    val TIMESTREAMSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TimestreamSettings"))
    val USERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Username"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CERTIFICATEARN_DESCRIPTOR)
        field(DATABASENAME_DESCRIPTOR)
        field(DMSTRANSFERSETTINGS_DESCRIPTOR)
        field(DOCDBSETTINGS_DESCRIPTOR)
        field(DYNAMODBSETTINGS_DESCRIPTOR)
        field(ELASTICSEARCHSETTINGS_DESCRIPTOR)
        field(ENDPOINTIDENTIFIER_DESCRIPTOR)
        field(ENDPOINTTYPE_DESCRIPTOR)
        field(ENGINENAME_DESCRIPTOR)
        field(EXTERNALTABLEDEFINITION_DESCRIPTOR)
        field(EXTRACONNECTIONATTRIBUTES_DESCRIPTOR)
        field(GCPMYSQLSETTINGS_DESCRIPTOR)
        field(IBMDB2SETTINGS_DESCRIPTOR)
        field(KAFKASETTINGS_DESCRIPTOR)
        field(KINESISSETTINGS_DESCRIPTOR)
        field(KMSKEYID_DESCRIPTOR)
        field(MICROSOFTSQLSERVERSETTINGS_DESCRIPTOR)
        field(MONGODBSETTINGS_DESCRIPTOR)
        field(MYSQLSETTINGS_DESCRIPTOR)
        field(NEPTUNESETTINGS_DESCRIPTOR)
        field(ORACLESETTINGS_DESCRIPTOR)
        field(PASSWORD_DESCRIPTOR)
        field(PORT_DESCRIPTOR)
        field(POSTGRESQLSETTINGS_DESCRIPTOR)
        field(REDISSETTINGS_DESCRIPTOR)
        field(REDSHIFTSETTINGS_DESCRIPTOR)
        field(RESOURCEIDENTIFIER_DESCRIPTOR)
        field(S3SETTINGS_DESCRIPTOR)
        field(SERVERNAME_DESCRIPTOR)
        field(SERVICEACCESSROLEARN_DESCRIPTOR)
        field(SSLMODE_DESCRIPTOR)
        field(SYBASESETTINGS_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(TIMESTREAMSETTINGS_DESCRIPTOR)
        field(USERNAME_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.certificateArn?.let { field(CERTIFICATEARN_DESCRIPTOR, it) }
        input.databaseName?.let { field(DATABASENAME_DESCRIPTOR, it) }
        input.dmsTransferSettings?.let { field(DMSTRANSFERSETTINGS_DESCRIPTOR, it, ::serializeDmsTransferSettingsDocument) }
        input.docDbSettings?.let { field(DOCDBSETTINGS_DESCRIPTOR, it, ::serializeDocDbSettingsDocument) }
        input.dynamoDbSettings?.let { field(DYNAMODBSETTINGS_DESCRIPTOR, it, ::serializeDynamoDbSettingsDocument) }
        input.elasticsearchSettings?.let { field(ELASTICSEARCHSETTINGS_DESCRIPTOR, it, ::serializeElasticsearchSettingsDocument) }
        input.endpointIdentifier?.let { field(ENDPOINTIDENTIFIER_DESCRIPTOR, it) }
        input.endpointType?.let { field(ENDPOINTTYPE_DESCRIPTOR, it.value) }
        input.engineName?.let { field(ENGINENAME_DESCRIPTOR, it) }
        input.externalTableDefinition?.let { field(EXTERNALTABLEDEFINITION_DESCRIPTOR, it) }
        input.extraConnectionAttributes?.let { field(EXTRACONNECTIONATTRIBUTES_DESCRIPTOR, it) }
        input.gcpMySqlSettings?.let { field(GCPMYSQLSETTINGS_DESCRIPTOR, it, ::serializeGcpMySqlSettingsDocument) }
        input.ibmDb2Settings?.let { field(IBMDB2SETTINGS_DESCRIPTOR, it, ::serializeIbmDb2SettingsDocument) }
        input.kafkaSettings?.let { field(KAFKASETTINGS_DESCRIPTOR, it, ::serializeKafkaSettingsDocument) }
        input.kinesisSettings?.let { field(KINESISSETTINGS_DESCRIPTOR, it, ::serializeKinesisSettingsDocument) }
        input.kmsKeyId?.let { field(KMSKEYID_DESCRIPTOR, it) }
        input.microsoftSqlServerSettings?.let { field(MICROSOFTSQLSERVERSETTINGS_DESCRIPTOR, it, ::serializeMicrosoftSqlServerSettingsDocument) }
        input.mongoDbSettings?.let { field(MONGODBSETTINGS_DESCRIPTOR, it, ::serializeMongoDbSettingsDocument) }
        input.mySqlSettings?.let { field(MYSQLSETTINGS_DESCRIPTOR, it, ::serializeMySqlSettingsDocument) }
        input.neptuneSettings?.let { field(NEPTUNESETTINGS_DESCRIPTOR, it, ::serializeNeptuneSettingsDocument) }
        input.oracleSettings?.let { field(ORACLESETTINGS_DESCRIPTOR, it, ::serializeOracleSettingsDocument) }
        input.password?.let { field(PASSWORD_DESCRIPTOR, it) }
        input.port?.let { field(PORT_DESCRIPTOR, it) }
        input.postgreSqlSettings?.let { field(POSTGRESQLSETTINGS_DESCRIPTOR, it, ::serializePostgreSqlSettingsDocument) }
        input.redisSettings?.let { field(REDISSETTINGS_DESCRIPTOR, it, ::serializeRedisSettingsDocument) }
        input.redshiftSettings?.let { field(REDSHIFTSETTINGS_DESCRIPTOR, it, ::serializeRedshiftSettingsDocument) }
        input.resourceIdentifier?.let { field(RESOURCEIDENTIFIER_DESCRIPTOR, it) }
        input.s3Settings?.let { field(S3SETTINGS_DESCRIPTOR, it, ::serializeS3SettingsDocument) }
        input.serverName?.let { field(SERVERNAME_DESCRIPTOR, it) }
        input.serviceAccessRoleArn?.let { field(SERVICEACCESSROLEARN_DESCRIPTOR, it) }
        input.sslMode?.let { field(SSLMODE_DESCRIPTOR, it.value) }
        input.sybaseSettings?.let { field(SYBASESETTINGS_DESCRIPTOR, it, ::serializeSybaseSettingsDocument) }
        if (input.tags != null) {
            listField(TAGS_DESCRIPTOR) {
                for (el0 in input.tags) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeTagDocument))
                }
            }
        }
        input.timestreamSettings?.let { field(TIMESTREAMSETTINGS_DESCRIPTOR, it, ::serializeTimestreamSettingsDocument) }
        input.username?.let { field(USERNAME_DESCRIPTOR, it) }
    }
    return serializer.toByteArray()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy