commonMain.aws.sdk.kotlin.services.neptune.serde.CreateDBInstanceOperationSerializer.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.CreateDbInstanceRequest
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
internal class CreateDBInstanceOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: CreateDbInstanceRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeCreateDBInstanceOperationBody(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 serializeCreateDBInstanceOperationBody(context: ExecutionContext, input: CreateDbInstanceRequest): ByteArray {
val serializer = FormUrlSerializer()
val ALLOCATEDSTORAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("AllocatedStorage"))
val AUTOMINORVERSIONUPGRADE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("AutoMinorVersionUpgrade"))
val AVAILABILITYZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("AvailabilityZone"))
val BACKUPRETENTIONPERIOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("BackupRetentionPeriod"))
val CHARACTERSETNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("CharacterSetName"))
val COPYTAGSTOSNAPSHOT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("CopyTagsToSnapshot"))
val DBCLUSTERIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBClusterIdentifier"))
val DBINSTANCECLASS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBInstanceClass"))
val DBINSTANCEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBInstanceIdentifier"))
val DBNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBName"))
val DBPARAMETERGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBParameterGroupName"))
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 ENABLECLOUDWATCHLOGSEXPORTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("EnableCloudwatchLogsExports"))
val ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("EnableIAMDatabaseAuthentication"))
val ENABLEPERFORMANCEINSIGHTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("EnablePerformanceInsights"))
val ENGINE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("Engine"))
val ENGINEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("EngineVersion"))
val IOPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("Iops"))
val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("KmsKeyId"))
val LICENSEMODEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("LicenseModel"))
val MASTERUSERPASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("MasterUserPassword"))
val MASTERUSERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("MasterUsername"))
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 OPTIONGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("OptionGroupName"))
val PERFORMANCEINSIGHTSKMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("PerformanceInsightsKMSKeyId"))
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 PROMOTIONTIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("PromotionTier"))
val PUBLICLYACCESSIBLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("PubliclyAccessible"))
val STORAGEENCRYPTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("StorageEncrypted"))
val STORAGETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("StorageType"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("Tags"), FormUrlCollectionName("Tag"))
val TDECREDENTIALARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("TdeCredentialArn"))
val TDECREDENTIALPASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("TdeCredentialPassword"))
val TIMEZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("Timezone"))
val VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("VpcSecurityGroupIds"), FormUrlCollectionName("VpcSecurityGroupId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
trait(FormUrlSerialName("CreateDBInstanceMessage"))
trait(QueryLiteral("Action", "CreateDBInstance"))
trait(QueryLiteral("Version", "2014-10-31"))
field(ALLOCATEDSTORAGE_DESCRIPTOR)
field(AUTOMINORVERSIONUPGRADE_DESCRIPTOR)
field(AVAILABILITYZONE_DESCRIPTOR)
field(BACKUPRETENTIONPERIOD_DESCRIPTOR)
field(CHARACTERSETNAME_DESCRIPTOR)
field(COPYTAGSTOSNAPSHOT_DESCRIPTOR)
field(DBCLUSTERIDENTIFIER_DESCRIPTOR)
field(DBINSTANCECLASS_DESCRIPTOR)
field(DBINSTANCEIDENTIFIER_DESCRIPTOR)
field(DBNAME_DESCRIPTOR)
field(DBPARAMETERGROUPNAME_DESCRIPTOR)
field(DBSECURITYGROUPS_DESCRIPTOR)
field(DBSUBNETGROUPNAME_DESCRIPTOR)
field(DELETIONPROTECTION_DESCRIPTOR)
field(DOMAIN_DESCRIPTOR)
field(DOMAINIAMROLENAME_DESCRIPTOR)
field(ENABLECLOUDWATCHLOGSEXPORTS_DESCRIPTOR)
field(ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR)
field(ENABLEPERFORMANCEINSIGHTS_DESCRIPTOR)
field(ENGINE_DESCRIPTOR)
field(ENGINEVERSION_DESCRIPTOR)
field(IOPS_DESCRIPTOR)
field(KMSKEYID_DESCRIPTOR)
field(LICENSEMODEL_DESCRIPTOR)
field(MASTERUSERPASSWORD_DESCRIPTOR)
field(MASTERUSERNAME_DESCRIPTOR)
field(MONITORINGINTERVAL_DESCRIPTOR)
field(MONITORINGROLEARN_DESCRIPTOR)
field(MULTIAZ_DESCRIPTOR)
field(OPTIONGROUPNAME_DESCRIPTOR)
field(PERFORMANCEINSIGHTSKMSKEYID_DESCRIPTOR)
field(PORT_DESCRIPTOR)
field(PREFERREDBACKUPWINDOW_DESCRIPTOR)
field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR)
field(PROMOTIONTIER_DESCRIPTOR)
field(PUBLICLYACCESSIBLE_DESCRIPTOR)
field(STORAGEENCRYPTED_DESCRIPTOR)
field(STORAGETYPE_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(TDECREDENTIALARN_DESCRIPTOR)
field(TDECREDENTIALPASSWORD_DESCRIPTOR)
field(TIMEZONE_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.backupRetentionPeriod?.let { field(BACKUPRETENTIONPERIOD_DESCRIPTOR, it) }
input.characterSetName?.let { field(CHARACTERSETNAME_DESCRIPTOR, it) }
input.copyTagsToSnapshot?.let { field(COPYTAGSTOSNAPSHOT_DESCRIPTOR, it) }
input.dbClusterIdentifier?.let { field(DBCLUSTERIDENTIFIER_DESCRIPTOR, it) }
input.dbInstanceClass?.let { field(DBINSTANCECLASS_DESCRIPTOR, it) }
input.dbInstanceIdentifier?.let { field(DBINSTANCEIDENTIFIER_DESCRIPTOR, it) }
input.dbName?.let { field(DBNAME_DESCRIPTOR, it) }
input.dbParameterGroupName?.let { field(DBPARAMETERGROUPNAME_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) }
if (input.enableCloudwatchLogsExports != null) {
listField(ENABLECLOUDWATCHLOGSEXPORTS_DESCRIPTOR) {
for (el0 in input.enableCloudwatchLogsExports) {
serializeString(el0)
}
}
}
input.enableIamDatabaseAuthentication?.let { field(ENABLEIAMDATABASEAUTHENTICATION_DESCRIPTOR, it) }
input.enablePerformanceInsights?.let { field(ENABLEPERFORMANCEINSIGHTS_DESCRIPTOR, it) }
input.engine?.let { field(ENGINE_DESCRIPTOR, it) }
input.engineVersion?.let { field(ENGINEVERSION_DESCRIPTOR, it) }
input.iops?.let { field(IOPS_DESCRIPTOR, it) }
input.kmsKeyId?.let { field(KMSKEYID_DESCRIPTOR, it) }
input.licenseModel?.let { field(LICENSEMODEL_DESCRIPTOR, it) }
input.masterUserPassword?.let { field(MASTERUSERPASSWORD_DESCRIPTOR, it) }
input.masterUsername?.let { field(MASTERUSERNAME_DESCRIPTOR, it) }
input.monitoringInterval?.let { field(MONITORINGINTERVAL_DESCRIPTOR, it) }
input.monitoringRoleArn?.let { field(MONITORINGROLEARN_DESCRIPTOR, it) }
input.multiAz?.let { field(MULTIAZ_DESCRIPTOR, it) }
input.optionGroupName?.let { field(OPTIONGROUPNAME_DESCRIPTOR, it) }
input.performanceInsightsKmsKeyId?.let { field(PERFORMANCEINSIGHTSKMSKEYID_DESCRIPTOR, it) }
input.port?.let { field(PORT_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.storageEncrypted?.let { field(STORAGEENCRYPTED_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.tdeCredentialArn?.let { field(TDECREDENTIALARN_DESCRIPTOR, it) }
input.tdeCredentialPassword?.let { field(TDECREDENTIALPASSWORD_DESCRIPTOR, it) }
input.timezone?.let { field(TIMEZONE_DESCRIPTOR, it) }
if (input.vpcSecurityGroupIds != null) {
listField(VPCSECURITYGROUPIDS_DESCRIPTOR) {
for (el0 in input.vpcSecurityGroupIds) {
serializeString(el0)
}
}
}
}
return serializer.toByteArray()
}