commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.CreateReplicationInstanceOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of databasemigrationservice-jvm Show documentation
Show all versions of databasemigrationservice-jvm Show documentation
The AWS SDK for Kotlin client for Database Migration Service
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.CreateReplicationInstanceRequest
import aws.sdk.kotlin.services.databasemigrationservice.model.KerberosAuthenticationSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.Tag
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 CreateReplicationInstanceOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: CreateReplicationInstanceRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeCreateReplicationInstanceOperationBody(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 serializeCreateReplicationInstanceOperationBody(context: ExecutionContext, input: CreateReplicationInstanceRequest): ByteArray {
val serializer = JsonSerializer()
val ALLOCATEDSTORAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("AllocatedStorage"))
val AUTOMINORVERSIONUPGRADE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("AutoMinorVersionUpgrade"))
val AVAILABILITYZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AvailabilityZone"))
val DNSNAMESERVERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DnsNameServers"))
val ENGINEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EngineVersion"))
val KERBEROSAUTHENTICATIONSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("KerberosAuthenticationSettings"))
val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KmsKeyId"))
val MULTIAZ_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("MultiAZ"))
val NETWORKTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("NetworkType"))
val PREFERREDMAINTENANCEWINDOW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PreferredMaintenanceWindow"))
val PUBLICLYACCESSIBLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("PubliclyAccessible"))
val REPLICATIONINSTANCECLASS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationInstanceClass"))
val REPLICATIONINSTANCEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationInstanceIdentifier"))
val REPLICATIONSUBNETGROUPIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationSubnetGroupIdentifier"))
val RESOURCEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceIdentifier"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
val VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("VpcSecurityGroupIds"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ALLOCATEDSTORAGE_DESCRIPTOR)
field(AUTOMINORVERSIONUPGRADE_DESCRIPTOR)
field(AVAILABILITYZONE_DESCRIPTOR)
field(DNSNAMESERVERS_DESCRIPTOR)
field(ENGINEVERSION_DESCRIPTOR)
field(KERBEROSAUTHENTICATIONSETTINGS_DESCRIPTOR)
field(KMSKEYID_DESCRIPTOR)
field(MULTIAZ_DESCRIPTOR)
field(NETWORKTYPE_DESCRIPTOR)
field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR)
field(PUBLICLYACCESSIBLE_DESCRIPTOR)
field(REPLICATIONINSTANCECLASS_DESCRIPTOR)
field(REPLICATIONINSTANCEIDENTIFIER_DESCRIPTOR)
field(REPLICATIONSUBNETGROUPIDENTIFIER_DESCRIPTOR)
field(RESOURCEIDENTIFIER_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(VPCSECURITYGROUPIDS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.allocatedStorage?.let { field(ALLOCATEDSTORAGE_DESCRIPTOR, it) }
input.autoMinorVersionUpgrade?.let { field(AUTOMINORVERSIONUPGRADE_DESCRIPTOR, it) }
input.availabilityZone?.let { field(AVAILABILITYZONE_DESCRIPTOR, it) }
input.dnsNameServers?.let { field(DNSNAMESERVERS_DESCRIPTOR, it) }
input.engineVersion?.let { field(ENGINEVERSION_DESCRIPTOR, it) }
input.kerberosAuthenticationSettings?.let { field(KERBEROSAUTHENTICATIONSETTINGS_DESCRIPTOR, it, ::serializeKerberosAuthenticationSettingsDocument) }
input.kmsKeyId?.let { field(KMSKEYID_DESCRIPTOR, it) }
input.multiAz?.let { field(MULTIAZ_DESCRIPTOR, it) }
input.networkType?.let { field(NETWORKTYPE_DESCRIPTOR, it) }
input.preferredMaintenanceWindow?.let { field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR, it) }
input.publiclyAccessible?.let { field(PUBLICLYACCESSIBLE_DESCRIPTOR, it) }
input.replicationInstanceClass?.let { field(REPLICATIONINSTANCECLASS_DESCRIPTOR, it) }
input.replicationInstanceIdentifier?.let { field(REPLICATIONINSTANCEIDENTIFIER_DESCRIPTOR, it) }
input.replicationSubnetGroupIdentifier?.let { field(REPLICATIONSUBNETGROUPIDENTIFIER_DESCRIPTOR, it) }
input.resourceIdentifier?.let { field(RESOURCEIDENTIFIER_DESCRIPTOR, it) }
if (input.tags != null) {
listField(TAGS_DESCRIPTOR) {
for (el0 in input.tags) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeTagDocument))
}
}
}
if (input.vpcSecurityGroupIds != null) {
listField(VPCSECURITYGROUPIDS_DESCRIPTOR) {
for (el0 in input.vpcSecurityGroupIds) {
serializeString(el0)
}
}
}
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy