commonMain.aws.sdk.kotlin.services.neptune.serde.RestoreDBClusterToPointInTimeOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neptune-jvm Show documentation
Show all versions of neptune-jvm Show documentation
The AWS SDK for Kotlin client for Neptune
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.neptune.serde
import aws.sdk.kotlin.services.neptune.model.RestoreDbClusterToPointInTimeRequest
import aws.sdk.kotlin.services.neptune.model.ServerlessV2ScalingConfiguration
import aws.sdk.kotlin.services.neptune.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.formurl.FormUrlCollectionName
import aws.smithy.kotlin.runtime.serde.formurl.FormUrlSerialName
import aws.smithy.kotlin.runtime.serde.formurl.FormUrlSerializer
import aws.smithy.kotlin.runtime.serde.formurl.QueryLiteral
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.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
internal class RestoreDBClusterToPointInTimeOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: RestoreDbClusterToPointInTimeRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeRestoreDBClusterToPointInTimeOperationBody(context, input)
builder.body = HttpBody.fromBytes(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/x-www-form-urlencoded")
}
return builder
}
}
private fun serializeRestoreDBClusterToPointInTimeOperationBody(context: ExecutionContext, input: RestoreDbClusterToPointInTimeRequest): ByteArray {
val serializer = FormUrlSerializer()
val DBCLUSTERIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBClusterIdentifier"))
val DBCLUSTERPARAMETERGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBClusterParameterGroupName"))
val DBSUBNETGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBSubnetGroupName"))
val DELETIONPROTECTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("DeletionProtection"))
val ENABLECLOUDWATCHLOGSEXPORTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("EnableCloudwatchLogsExports"))
val ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("EnableIAMDatabaseAuthentication"))
val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("KmsKeyId"))
val OPTIONGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("OptionGroupName"))
val PORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("Port"))
val RESTORETOTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, FormUrlSerialName("RestoreToTime"))
val RESTORETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("RestoreType"))
val SERVERLESSV2SCALINGCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, FormUrlSerialName("ServerlessV2ScalingConfiguration"))
val SOURCEDBCLUSTERIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("SourceDBClusterIdentifier"))
val STORAGETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("StorageType"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("Tags"), FormUrlCollectionName("Tag"))
val USELATESTRESTORABLETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("UseLatestRestorableTime"))
val VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("VpcSecurityGroupIds"), FormUrlCollectionName("VpcSecurityGroupId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
trait(FormUrlSerialName("RestoreDBClusterToPointInTimeMessage"))
trait(QueryLiteral("Action", "RestoreDBClusterToPointInTime"))
trait(QueryLiteral("Version", "2014-10-31"))
field(DBCLUSTERIDENTIFIER_DESCRIPTOR)
field(DBCLUSTERPARAMETERGROUPNAME_DESCRIPTOR)
field(DBSUBNETGROUPNAME_DESCRIPTOR)
field(DELETIONPROTECTION_DESCRIPTOR)
field(ENABLECLOUDWATCHLOGSEXPORTS_DESCRIPTOR)
field(ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR)
field(KMSKEYID_DESCRIPTOR)
field(OPTIONGROUPNAME_DESCRIPTOR)
field(PORT_DESCRIPTOR)
field(RESTORETOTIME_DESCRIPTOR)
field(RESTORETYPE_DESCRIPTOR)
field(SERVERLESSV2SCALINGCONFIGURATION_DESCRIPTOR)
field(SOURCEDBCLUSTERIDENTIFIER_DESCRIPTOR)
field(STORAGETYPE_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(USELATESTRESTORABLETIME_DESCRIPTOR)
field(VPCSECURITYGROUPIDS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.dbClusterIdentifier?.let { field(DBCLUSTERIDENTIFIER_DESCRIPTOR, it) }
input.dbClusterParameterGroupName?.let { field(DBCLUSTERPARAMETERGROUPNAME_DESCRIPTOR, it) }
input.dbSubnetGroupName?.let { field(DBSUBNETGROUPNAME_DESCRIPTOR, it) }
input.deletionProtection?.let { field(DELETIONPROTECTION_DESCRIPTOR, it) }
if (input.enableCloudwatchLogsExports != null) {
listField(ENABLECLOUDWATCHLOGSEXPORTS_DESCRIPTOR) {
for (el0 in input.enableCloudwatchLogsExports) {
serializeString(el0)
}
}
}
input.enableIamDatabaseAuthentication?.let { field(ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR, it) }
input.kmsKeyId?.let { field(KMSKEYID_DESCRIPTOR, it) }
input.optionGroupName?.let { field(OPTIONGROUPNAME_DESCRIPTOR, it) }
input.port?.let { field(PORT_DESCRIPTOR, it) }
input.restoreToTime?.let { field(RESTORETOTIME_DESCRIPTOR, it, TimestampFormat.ISO_8601) }
input.restoreType?.let { field(RESTORETYPE_DESCRIPTOR, it) }
input.serverlessV2ScalingConfiguration?.let { field(SERVERLESSV2SCALINGCONFIGURATION_DESCRIPTOR, it, ::serializeServerlessV2ScalingConfigurationDocument) }
input.sourceDbClusterIdentifier?.let { field(SOURCEDBCLUSTERIDENTIFIER_DESCRIPTOR, it) }
input.storageType?.let { field(STORAGETYPE_DESCRIPTOR, it) }
if (input.tags != null) {
listField(TAGS_DESCRIPTOR) {
for (el0 in input.tags) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeTagDocument))
}
}
}
input.useLatestRestorableTime?.let { field(USELATESTRESTORABLETIME_DESCRIPTOR, it) }
if (input.vpcSecurityGroupIds != null) {
listField(VPCSECURITYGROUPIDS_DESCRIPTOR) {
for (el0 in input.vpcSecurityGroupIds) {
serializeString(el0)
}
}
}
}
return serializer.toByteArray()
}