commonMain.aws.sdk.kotlin.services.redshift.serde.CreateClusterOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshift-jvm Show documentation
Show all versions of redshift-jvm Show documentation
The AWS SDK for Kotlin client for Redshift
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.redshift.serde
import aws.sdk.kotlin.services.redshift.model.AquaConfigurationStatus
import aws.sdk.kotlin.services.redshift.model.CreateClusterRequest
import aws.sdk.kotlin.services.redshift.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 CreateClusterOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: CreateClusterRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeCreateClusterOperationBody(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 serializeCreateClusterOperationBody(context: ExecutionContext, input: CreateClusterRequest): ByteArray {
val serializer = FormUrlSerializer()
val ADDITIONALINFO_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("AdditionalInfo"))
val ALLOWVERSIONUPGRADE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("AllowVersionUpgrade"))
val AQUACONFIGURATIONSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, FormUrlSerialName("AquaConfigurationStatus"))
val AUTOMATEDSNAPSHOTRETENTIONPERIOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("AutomatedSnapshotRetentionPeriod"))
val AVAILABILITYZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("AvailabilityZone"))
val AVAILABILITYZONERELOCATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("AvailabilityZoneRelocation"))
val CLUSTERIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("ClusterIdentifier"))
val CLUSTERPARAMETERGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("ClusterParameterGroupName"))
val CLUSTERSECURITYGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("ClusterSecurityGroups"), FormUrlCollectionName("ClusterSecurityGroupName"))
val CLUSTERSUBNETGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("ClusterSubnetGroupName"))
val CLUSTERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("ClusterType"))
val CLUSTERVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("ClusterVersion"))
val DBNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DBName"))
val DEFAULTIAMROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("DefaultIamRoleArn"))
val ELASTICIP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("ElasticIp"))
val ENCRYPTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("Encrypted"))
val ENHANCEDVPCROUTING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("EnhancedVpcRouting"))
val HSMCLIENTCERTIFICATEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("HsmClientCertificateIdentifier"))
val HSMCONFIGURATIONIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("HsmConfigurationIdentifier"))
val IAMROLES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("IamRoles"), FormUrlCollectionName("IamRoleArn"))
val IPADDRESSTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("IpAddressType"))
val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("KmsKeyId"))
val LOADSAMPLEDATA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("LoadSampleData"))
val MAINTENANCETRACKNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("MaintenanceTrackName"))
val MANAGEMASTERPASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("ManageMasterPassword"))
val MANUALSNAPSHOTRETENTIONPERIOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("ManualSnapshotRetentionPeriod"))
val MASTERPASSWORDSECRETKMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("MasterPasswordSecretKmsKeyId"))
val MASTERUSERPASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("MasterUserPassword"))
val MASTERUSERNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("MasterUsername"))
val MULTIAZ_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("MultiAZ"))
val NODETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("NodeType"))
val NUMBEROFNODES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("NumberOfNodes"))
val PORT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("Port"))
val PREFERREDMAINTENANCEWINDOW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("PreferredMaintenanceWindow"))
val PUBLICLYACCESSIBLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("PubliclyAccessible"))
val REDSHIFTIDCAPPLICATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("RedshiftIdcApplicationArn"))
val SNAPSHOTSCHEDULEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("SnapshotScheduleIdentifier"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("Tags"), FormUrlCollectionName("Tag"))
val VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("VpcSecurityGroupIds"), FormUrlCollectionName("VpcSecurityGroupId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
trait(FormUrlSerialName("CreateClusterMessage"))
trait(QueryLiteral("Action", "CreateCluster"))
trait(QueryLiteral("Version", "2012-12-01"))
field(ADDITIONALINFO_DESCRIPTOR)
field(ALLOWVERSIONUPGRADE_DESCRIPTOR)
field(AQUACONFIGURATIONSTATUS_DESCRIPTOR)
field(AUTOMATEDSNAPSHOTRETENTIONPERIOD_DESCRIPTOR)
field(AVAILABILITYZONE_DESCRIPTOR)
field(AVAILABILITYZONERELOCATION_DESCRIPTOR)
field(CLUSTERIDENTIFIER_DESCRIPTOR)
field(CLUSTERPARAMETERGROUPNAME_DESCRIPTOR)
field(CLUSTERSECURITYGROUPS_DESCRIPTOR)
field(CLUSTERSUBNETGROUPNAME_DESCRIPTOR)
field(CLUSTERTYPE_DESCRIPTOR)
field(CLUSTERVERSION_DESCRIPTOR)
field(DBNAME_DESCRIPTOR)
field(DEFAULTIAMROLEARN_DESCRIPTOR)
field(ELASTICIP_DESCRIPTOR)
field(ENCRYPTED_DESCRIPTOR)
field(ENHANCEDVPCROUTING_DESCRIPTOR)
field(HSMCLIENTCERTIFICATEIDENTIFIER_DESCRIPTOR)
field(HSMCONFIGURATIONIDENTIFIER_DESCRIPTOR)
field(IAMROLES_DESCRIPTOR)
field(IPADDRESSTYPE_DESCRIPTOR)
field(KMSKEYID_DESCRIPTOR)
field(LOADSAMPLEDATA_DESCRIPTOR)
field(MAINTENANCETRACKNAME_DESCRIPTOR)
field(MANAGEMASTERPASSWORD_DESCRIPTOR)
field(MANUALSNAPSHOTRETENTIONPERIOD_DESCRIPTOR)
field(MASTERPASSWORDSECRETKMSKEYID_DESCRIPTOR)
field(MASTERUSERPASSWORD_DESCRIPTOR)
field(MASTERUSERNAME_DESCRIPTOR)
field(MULTIAZ_DESCRIPTOR)
field(NODETYPE_DESCRIPTOR)
field(NUMBEROFNODES_DESCRIPTOR)
field(PORT_DESCRIPTOR)
field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR)
field(PUBLICLYACCESSIBLE_DESCRIPTOR)
field(REDSHIFTIDCAPPLICATIONARN_DESCRIPTOR)
field(SNAPSHOTSCHEDULEIDENTIFIER_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(VPCSECURITYGROUPIDS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.additionalInfo?.let { field(ADDITIONALINFO_DESCRIPTOR, it) }
input.allowVersionUpgrade?.let { field(ALLOWVERSIONUPGRADE_DESCRIPTOR, it) }
input.aquaConfigurationStatus?.let { field(AQUACONFIGURATIONSTATUS_DESCRIPTOR, it.value) }
input.automatedSnapshotRetentionPeriod?.let { field(AUTOMATEDSNAPSHOTRETENTIONPERIOD_DESCRIPTOR, it) }
input.availabilityZone?.let { field(AVAILABILITYZONE_DESCRIPTOR, it) }
input.availabilityZoneRelocation?.let { field(AVAILABILITYZONERELOCATION_DESCRIPTOR, it) }
input.clusterIdentifier?.let { field(CLUSTERIDENTIFIER_DESCRIPTOR, it) }
input.clusterParameterGroupName?.let { field(CLUSTERPARAMETERGROUPNAME_DESCRIPTOR, it) }
if (input.clusterSecurityGroups != null) {
listField(CLUSTERSECURITYGROUPS_DESCRIPTOR) {
for (el0 in input.clusterSecurityGroups) {
serializeString(el0)
}
}
}
input.clusterSubnetGroupName?.let { field(CLUSTERSUBNETGROUPNAME_DESCRIPTOR, it) }
input.clusterType?.let { field(CLUSTERTYPE_DESCRIPTOR, it) }
input.clusterVersion?.let { field(CLUSTERVERSION_DESCRIPTOR, it) }
input.dbName?.let { field(DBNAME_DESCRIPTOR, it) }
input.defaultIamRoleArn?.let { field(DEFAULTIAMROLEARN_DESCRIPTOR, it) }
input.elasticIp?.let { field(ELASTICIP_DESCRIPTOR, it) }
input.encrypted?.let { field(ENCRYPTED_DESCRIPTOR, it) }
input.enhancedVpcRouting?.let { field(ENHANCEDVPCROUTING_DESCRIPTOR, it) }
input.hsmClientCertificateIdentifier?.let { field(HSMCLIENTCERTIFICATEIDENTIFIER_DESCRIPTOR, it) }
input.hsmConfigurationIdentifier?.let { field(HSMCONFIGURATIONIDENTIFIER_DESCRIPTOR, it) }
if (input.iamRoles != null) {
listField(IAMROLES_DESCRIPTOR) {
for (el0 in input.iamRoles) {
serializeString(el0)
}
}
}
input.ipAddressType?.let { field(IPADDRESSTYPE_DESCRIPTOR, it) }
input.kmsKeyId?.let { field(KMSKEYID_DESCRIPTOR, it) }
input.loadSampleData?.let { field(LOADSAMPLEDATA_DESCRIPTOR, it) }
input.maintenanceTrackName?.let { field(MAINTENANCETRACKNAME_DESCRIPTOR, it) }
input.manageMasterPassword?.let { field(MANAGEMASTERPASSWORD_DESCRIPTOR, it) }
input.manualSnapshotRetentionPeriod?.let { field(MANUALSNAPSHOTRETENTIONPERIOD_DESCRIPTOR, it) }
input.masterPasswordSecretKmsKeyId?.let { field(MASTERPASSWORDSECRETKMSKEYID_DESCRIPTOR, it) }
input.masterUserPassword?.let { field(MASTERUSERPASSWORD_DESCRIPTOR, it) }
input.masterUsername?.let { field(MASTERUSERNAME_DESCRIPTOR, it) }
input.multiAz?.let { field(MULTIAZ_DESCRIPTOR, it) }
input.nodeType?.let { field(NODETYPE_DESCRIPTOR, it) }
input.numberOfNodes?.let { field(NUMBEROFNODES_DESCRIPTOR, it) }
input.port?.let { field(PORT_DESCRIPTOR, it) }
input.preferredMaintenanceWindow?.let { field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR, it) }
input.publiclyAccessible?.let { field(PUBLICLYACCESSIBLE_DESCRIPTOR, it) }
input.redshiftIdcApplicationArn?.let { field(REDSHIFTIDCAPPLICATIONARN_DESCRIPTOR, it) }
input.snapshotScheduleIdentifier?.let { field(SNAPSHOTSCHEDULEIDENTIFIER_DESCRIPTOR, it) }
if (input.tags != null) {
listField(TAGS_DESCRIPTOR) {
for (el0 in input.tags) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeTagDocument))
}
}
}
if (input.vpcSecurityGroupIds != null) {
listField(VPCSECURITYGROUPIDS_DESCRIPTOR) {
for (el0 in input.vpcSecurityGroupIds) {
serializeString(el0)
}
}
}
}
return serializer.toByteArray()
}