commonMain.aws.sdk.kotlin.services.neptune.serde.ModifyDBInstanceOperationSerializer.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.ModifyDbInstanceRequest
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 ModifyDBInstanceOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: ModifyDbInstanceRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeModifyDBInstanceOperationBody(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 serializeModifyDBInstanceOperationBody(context: ExecutionContext, input: ModifyDbInstanceRequest): ByteArray {
val serializer = FormUrlSerializer()
val ALLOCATEDSTORAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("AllocatedStorage"))
val ALLOWMAJORVERSIONUPGRADE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("AllowMajorVersionUpgrade"))
val APPLYIMMEDIATELY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("ApplyImmediately"))
val AUTOMINORVERSIONUPGRADE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("AutoMinorVersionUpgrade"))
val BACKUPRETENTIONPERIOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("BackupRetentionPeriod"))
val CACERTIFICATEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("CACertificateIdentifier"))
val CLOUDWATCHLOGSEXPORTCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, FormUrlSerialName("CloudwatchLogsExportConfiguration"))
val COPYTAGSTOSNAPSHOT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("CopyTagsToSnapshot"))
val DBINSTANCECLASS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBInstanceClass"))
val DBINSTANCEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBInstanceIdentifier"))
val DBPARAMETERGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBParameterGroupName"))
val DBPORTNUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("DBPortNumber"))
val DBSECURITYGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("DBSecurityGroups"), FormUrlCollectionName("DBSecurityGroupName"))
val DBSUBNETGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBSubnetGroupName"))
val DELETIONPROTECTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("DeletionProtection"))
val DOMAIN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("Domain"))
val DOMAINIAMROLENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DomainIAMRoleName"))
val ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("EnableIAMDatabaseAuthentication"))
val ENABLEPERFORMANCEINSIGHTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("EnablePerformanceInsights"))
val ENGINEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("EngineVersion"))
val IOPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("Iops"))
val LICENSEMODEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("LicenseModel"))
val MASTERUSERPASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("MasterUserPassword"))
val MONITORINGINTERVAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("MonitoringInterval"))
val MONITORINGROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("MonitoringRoleArn"))
val MULTIAZ_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("MultiAZ"))
val NEWDBINSTANCEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("NewDBInstanceIdentifier"))
val OPTIONGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("OptionGroupName"))
val PERFORMANCEINSIGHTSKMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("PerformanceInsightsKMSKeyId"))
val PREFERREDBACKUPWINDOW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("PreferredBackupWindow"))
val PREFERREDMAINTENANCEWINDOW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("PreferredMaintenanceWindow"))
val PROMOTIONTIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("PromotionTier"))
val PUBLICLYACCESSIBLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("PubliclyAccessible"))
val STORAGETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("StorageType"))
val TDECREDENTIALARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("TdeCredentialArn"))
val TDECREDENTIALPASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("TdeCredentialPassword"))
val VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("VpcSecurityGroupIds"), FormUrlCollectionName("VpcSecurityGroupId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
trait(FormUrlSerialName("ModifyDBInstanceMessage"))
trait(QueryLiteral("Action", "ModifyDBInstance"))
trait(QueryLiteral("Version", "2014-10-31"))
field(ALLOCATEDSTORAGE_DESCRIPTOR)
field(ALLOWMAJORVERSIONUPGRADE_DESCRIPTOR)
field(APPLYIMMEDIATELY_DESCRIPTOR)
field(AUTOMINORVERSIONUPGRADE_DESCRIPTOR)
field(BACKUPRETENTIONPERIOD_DESCRIPTOR)
field(CACERTIFICATEIDENTIFIER_DESCRIPTOR)
field(CLOUDWATCHLOGSEXPORTCONFIGURATION_DESCRIPTOR)
field(COPYTAGSTOSNAPSHOT_DESCRIPTOR)
field(DBINSTANCECLASS_DESCRIPTOR)
field(DBINSTANCEIDENTIFIER_DESCRIPTOR)
field(DBPARAMETERGROUPNAME_DESCRIPTOR)
field(DBPORTNUMBER_DESCRIPTOR)
field(DBSECURITYGROUPS_DESCRIPTOR)
field(DBSUBNETGROUPNAME_DESCRIPTOR)
field(DELETIONPROTECTION_DESCRIPTOR)
field(DOMAIN_DESCRIPTOR)
field(DOMAINIAMROLENAME_DESCRIPTOR)
field(ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR)
field(ENABLEPERFORMANCEINSIGHTS_DESCRIPTOR)
field(ENGINEVERSION_DESCRIPTOR)
field(IOPS_DESCRIPTOR)
field(LICENSEMODEL_DESCRIPTOR)
field(MASTERUSERPASSWORD_DESCRIPTOR)
field(MONITORINGINTERVAL_DESCRIPTOR)
field(MONITORINGROLEARN_DESCRIPTOR)
field(MULTIAZ_DESCRIPTOR)
field(NEWDBINSTANCEIDENTIFIER_DESCRIPTOR)
field(OPTIONGROUPNAME_DESCRIPTOR)
field(PERFORMANCEINSIGHTSKMSKEYID_DESCRIPTOR)
field(PREFERREDBACKUPWINDOW_DESCRIPTOR)
field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR)
field(PROMOTIONTIER_DESCRIPTOR)
field(PUBLICLYACCESSIBLE_DESCRIPTOR)
field(STORAGETYPE_DESCRIPTOR)
field(TDECREDENTIALARN_DESCRIPTOR)
field(TDECREDENTIALPASSWORD_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.backupRetentionPeriod?.let { field(BACKUPRETENTIONPERIOD_DESCRIPTOR, it) }
input.caCertificateIdentifier?.let { field(CACERTIFICATEIDENTIFIER_DESCRIPTOR, it) }
input.cloudwatchLogsExportConfiguration?.let { field(CLOUDWATCHLOGSEXPORTCONFIGURATION_DESCRIPTOR, it, ::serializeCloudwatchLogsExportConfigurationDocument) }
input.copyTagsToSnapshot?.let { field(COPYTAGSTOSNAPSHOT_DESCRIPTOR, it) }
input.dbInstanceClass?.let { field(DBINSTANCECLASS_DESCRIPTOR, it) }
input.dbInstanceIdentifier?.let { field(DBINSTANCEIDENTIFIER_DESCRIPTOR, it) }
input.dbParameterGroupName?.let { field(DBPARAMETERGROUPNAME_DESCRIPTOR, it) }
input.dbPortNumber?.let { field(DBPORTNUMBER_DESCRIPTOR, it) }
if (input.dbSecurityGroups != null) {
listField(DBSECURITYGROUPS_DESCRIPTOR) {
for (el0 in input.dbSecurityGroups) {
serializeString(el0)
}
}
}
input.dbSubnetGroupName?.let { field(DBSUBNETGROUPNAME_DESCRIPTOR, it) }
input.deletionProtection?.let { field(DELETIONPROTECTION_DESCRIPTOR, it) }
input.domain?.let { field(DOMAIN_DESCRIPTOR, it) }
input.domainIamRoleName?.let { field(DOMAINIAMROLENAME_DESCRIPTOR, it) }
input.enableIamDatabaseAuthentication?.let { field(ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR, it) }
input.enablePerformanceInsights?.let { field(ENABLEPERFORMANCEINSIGHTS_DESCRIPTOR, it) }
input.engineVersion?.let { field(ENGINEVERSION_DESCRIPTOR, it) }
input.iops?.let { field(IOPS_DESCRIPTOR, it) }
input.licenseModel?.let { field(LICENSEMODEL_DESCRIPTOR, it) }
input.masterUserPassword?.let { field(MASTERUSERPASSWORD_DESCRIPTOR, it) }
input.monitoringInterval?.let { field(MONITORINGINTERVAL_DESCRIPTOR, it) }
input.monitoringRoleArn?.let { field(MONITORINGROLEARN_DESCRIPTOR, it) }
input.multiAz?.let { field(MULTIAZ_DESCRIPTOR, it) }
input.newDbInstanceIdentifier?.let { field(NEWDBINSTANCEIDENTIFIER_DESCRIPTOR, it) }
input.optionGroupName?.let { field(OPTIONGROUPNAME_DESCRIPTOR, it) }
input.performanceInsightsKmsKeyId?.let { field(PERFORMANCEINSIGHTSKMSKEYID_DESCRIPTOR, it) }
input.preferredBackupWindow?.let { field(PREFERREDBACKUPWINDOW_DESCRIPTOR, it) }
input.preferredMaintenanceWindow?.let { field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR, it) }
input.promotionTier?.let { field(PROMOTIONTIER_DESCRIPTOR, it) }
input.publiclyAccessible?.let { field(PUBLICLYACCESSIBLE_DESCRIPTOR, it) }
input.storageType?.let { field(STORAGETYPE_DESCRIPTOR, it) }
input.tdeCredentialArn?.let { field(TDECREDENTIALARN_DESCRIPTOR, it) }
input.tdeCredentialPassword?.let { field(TDECREDENTIALPASSWORD_DESCRIPTOR, it) }
if (input.vpcSecurityGroupIds != null) {
listField(VPCSECURITYGROUPIDS_DESCRIPTOR) {
for (el0 in input.vpcSecurityGroupIds) {
serializeString(el0)
}
}
}
}
return serializer.toByteArray()
}