commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.ModifyReplicationInstanceOperationSerializer.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.KerberosAuthenticationSettings
import aws.sdk.kotlin.services.databasemigrationservice.model.ModifyReplicationInstanceRequest
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 ModifyReplicationInstanceOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: ModifyReplicationInstanceRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeModifyReplicationInstanceOperationBody(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 serializeModifyReplicationInstanceOperationBody(context: ExecutionContext, input: ModifyReplicationInstanceRequest): ByteArray {
val serializer = JsonSerializer()
val ALLOCATEDSTORAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("AllocatedStorage"))
val ALLOWMAJORVERSIONUPGRADE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("AllowMajorVersionUpgrade"))
val APPLYIMMEDIATELY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("ApplyImmediately"))
val AUTOMINORVERSIONUPGRADE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("AutoMinorVersionUpgrade"))
val ENGINEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EngineVersion"))
val KERBEROSAUTHENTICATIONSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("KerberosAuthenticationSettings"))
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 REPLICATIONINSTANCEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationInstanceArn"))
val REPLICATIONINSTANCECLASS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationInstanceClass"))
val REPLICATIONINSTANCEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ReplicationInstanceIdentifier"))
val VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("VpcSecurityGroupIds"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ALLOCATEDSTORAGE_DESCRIPTOR)
field(ALLOWMAJORVERSIONUPGRADE_DESCRIPTOR)
field(APPLYIMMEDIATELY_DESCRIPTOR)
field(AUTOMINORVERSIONUPGRADE_DESCRIPTOR)
field(ENGINEVERSION_DESCRIPTOR)
field(KERBEROSAUTHENTICATIONSETTINGS_DESCRIPTOR)
field(MULTIAZ_DESCRIPTOR)
field(NETWORKTYPE_DESCRIPTOR)
field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR)
field(REPLICATIONINSTANCEARN_DESCRIPTOR)
field(REPLICATIONINSTANCECLASS_DESCRIPTOR)
field(REPLICATIONINSTANCEIDENTIFIER_DESCRIPTOR)
field(VPCSECURITYGROUPIDS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.allocatedStorage?.let { field(ALLOCATEDSTORAGE_DESCRIPTOR, it) }
input.allowMajorVersionUpgrade?.let { field(ALLOWMAJORVERSIONUPGRADE_DESCRIPTOR, it) }
input.applyImmediately?.let { field(APPLYIMMEDIATELY_DESCRIPTOR, it) }
input.autoMinorVersionUpgrade?.let { field(AUTOMINORVERSIONUPGRADE_DESCRIPTOR, it) }
input.engineVersion?.let { field(ENGINEVERSION_DESCRIPTOR, it) }
input.kerberosAuthenticationSettings?.let { field(KERBEROSAUTHENTICATIONSETTINGS_DESCRIPTOR, it, ::serializeKerberosAuthenticationSettingsDocument) }
input.multiAz?.let { field(MULTIAZ_DESCRIPTOR, it) }
input.networkType?.let { field(NETWORKTYPE_DESCRIPTOR, it) }
input.preferredMaintenanceWindow?.let { field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR, it) }
input.replicationInstanceArn?.let { field(REPLICATIONINSTANCEARN_DESCRIPTOR, it) }
input.replicationInstanceClass?.let { field(REPLICATIONINSTANCECLASS_DESCRIPTOR, it) }
input.replicationInstanceIdentifier?.let { field(REPLICATIONINSTANCEIDENTIFIER_DESCRIPTOR, it) }
if (input.vpcSecurityGroupIds != null) {
listField(VPCSECURITYGROUPIDS_DESCRIPTOR) {
for (el0 in input.vpcSecurityGroupIds) {
serializeString(el0)
}
}
}
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy