commonMain.aws.sdk.kotlin.services.neptune.serde.ModifyDBClusterOperationSerializer.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.CloudwatchLogsExportConfiguration
import aws.sdk.kotlin.services.neptune.model.ModifyDbClusterRequest
import aws.sdk.kotlin.services.neptune.model.ServerlessV2ScalingConfiguration
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
internal class ModifyDBClusterOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: ModifyDbClusterRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeModifyDBClusterOperationBody(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 serializeModifyDBClusterOperationBody(context: ExecutionContext, input: ModifyDbClusterRequest): ByteArray {
val serializer = FormUrlSerializer()
val ALLOWMAJORVERSIONUPGRADE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("AllowMajorVersionUpgrade"))
val APPLYIMMEDIATELY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("ApplyImmediately"))
val BACKUPRETENTIONPERIOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("BackupRetentionPeriod"))
val CLOUDWATCHLOGSEXPORTCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, FormUrlSerialName("CloudwatchLogsExportConfiguration"))
val COPYTAGSTOSNAPSHOT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("CopyTagsToSnapshot"))
val DBCLUSTERIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBClusterIdentifier"))
val DBCLUSTERPARAMETERGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBClusterParameterGroupName"))
val DBINSTANCEPARAMETERGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBInstanceParameterGroupName"))
val DELETIONPROTECTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("DeletionProtection"))
val ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("EnableIAMDatabaseAuthentication"))
val ENGINEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("EngineVersion"))
val MASTERUSERPASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("MasterUserPassword"))
val NEWDBCLUSTERIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("NewDBClusterIdentifier"))
val OPTIONGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("OptionGroupName"))
val PORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("Port"))
val PREFERREDBACKUPWINDOW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("PreferredBackupWindow"))
val PREFERREDMAINTENANCEWINDOW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("PreferredMaintenanceWindow"))
val SERVERLESSV2SCALINGCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, FormUrlSerialName("ServerlessV2ScalingConfiguration"))
val STORAGETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("StorageType"))
val VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("VpcSecurityGroupIds"), FormUrlCollectionName("VpcSecurityGroupId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
trait(FormUrlSerialName("ModifyDBClusterMessage"))
trait(QueryLiteral("Action", "ModifyDBCluster"))
trait(QueryLiteral("Version", "2014-10-31"))
field(ALLOWMAJORVERSIONUPGRADE_DESCRIPTOR)
field(APPLYIMMEDIATELY_DESCRIPTOR)
field(BACKUPRETENTIONPERIOD_DESCRIPTOR)
field(CLOUDWATCHLOGSEXPORTCONFIGURATION_DESCRIPTOR)
field(COPYTAGSTOSNAPSHOT_DESCRIPTOR)
field(DBCLUSTERIDENTIFIER_DESCRIPTOR)
field(DBCLUSTERPARAMETERGROUPNAME_DESCRIPTOR)
field(DBINSTANCEPARAMETERGROUPNAME_DESCRIPTOR)
field(DELETIONPROTECTION_DESCRIPTOR)
field(ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR)
field(ENGINEVERSION_DESCRIPTOR)
field(MASTERUSERPASSWORD_DESCRIPTOR)
field(NEWDBCLUSTERIDENTIFIER_DESCRIPTOR)
field(OPTIONGROUPNAME_DESCRIPTOR)
field(PORT_DESCRIPTOR)
field(PREFERREDBACKUPWINDOW_DESCRIPTOR)
field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR)
field(SERVERLESSV2SCALINGCONFIGURATION_DESCRIPTOR)
field(STORAGETYPE_DESCRIPTOR)
field(VPCSECURITYGROUPIDS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.allowMajorVersionUpgrade?.let { field(ALLOWMAJORVERSIONUPGRADE_DESCRIPTOR, it) }
input.applyImmediately?.let { field(APPLYIMMEDIATELY_DESCRIPTOR, it) }
input.backupRetentionPeriod?.let { field(BACKUPRETENTIONPERIOD_DESCRIPTOR, it) }
input.cloudwatchLogsExportConfiguration?.let { field(CLOUDWATCHLOGSEXPORTCONFIGURATION_DESCRIPTOR, it, ::serializeCloudwatchLogsExportConfigurationDocument) }
input.copyTagsToSnapshot?.let { field(COPYTAGSTOSNAPSHOT_DESCRIPTOR, it) }
input.dbClusterIdentifier?.let { field(DBCLUSTERIDENTIFIER_DESCRIPTOR, it) }
input.dbClusterParameterGroupName?.let { field(DBCLUSTERPARAMETERGROUPNAME_DESCRIPTOR, it) }
input.dbInstanceParameterGroupName?.let { field(DBINSTANCEPARAMETERGROUPNAME_DESCRIPTOR, it) }
input.deletionProtection?.let { field(DELETIONPROTECTION_DESCRIPTOR, it) }
input.enableIamDatabaseAuthentication?.let { field(ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR, it) }
input.engineVersion?.let { field(ENGINEVERSION_DESCRIPTOR, it) }
input.masterUserPassword?.let { field(MASTERUSERPASSWORD_DESCRIPTOR, it) }
input.newDbClusterIdentifier?.let { field(NEWDBCLUSTERIDENTIFIER_DESCRIPTOR, it) }
input.optionGroupName?.let { field(OPTIONGROUPNAME_DESCRIPTOR, it) }
input.port?.let { field(PORT_DESCRIPTOR, it) }
input.preferredBackupWindow?.let { field(PREFERREDBACKUPWINDOW_DESCRIPTOR, it) }
input.preferredMaintenanceWindow?.let { field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR, it) }
input.serverlessV2ScalingConfiguration?.let { field(SERVERLESSV2SCALINGCONFIGURATION_DESCRIPTOR, it, ::serializeServerlessV2ScalingConfigurationDocument) }
input.storageType?.let { field(STORAGETYPE_DESCRIPTOR, it) }
if (input.vpcSecurityGroupIds != null) {
listField(VPCSECURITYGROUPIDS_DESCRIPTOR) {
for (el0 in input.vpcSecurityGroupIds) {
serializeString(el0)
}
}
}
}
return serializer.toByteArray()
}