commonMain.aws.sdk.kotlin.services.redshift.serde.ModifyClusterOperationSerializer.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
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.redshift.serde
import aws.sdk.kotlin.services.redshift.model.ModifyClusterRequest
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 ModifyClusterOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: ModifyClusterRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeModifyClusterOperationBody(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 serializeModifyClusterOperationBody(context: ExecutionContext, input: ModifyClusterRequest): ByteArray {
val serializer = FormUrlSerializer()
val ALLOWVERSIONUPGRADE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("AllowVersionUpgrade"))
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 CLUSTERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("ClusterType"))
val CLUSTERVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("ClusterVersion"))
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 IPADDRESSTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("IpAddressType"))
val KMSKEYID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("KmsKeyId"))
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 MULTIAZ_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("MultiAZ"))
val NEWCLUSTERIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("NewClusterIdentifier"))
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 VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("VpcSecurityGroupIds"), FormUrlCollectionName("VpcSecurityGroupId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
trait(FormUrlSerialName("ModifyClusterMessage"))
trait(QueryLiteral("Action", "ModifyCluster"))
trait(QueryLiteral("Version", "2012-12-01"))
field(ALLOWVERSIONUPGRADE_DESCRIPTOR)
field(AUTOMATEDSNAPSHOTRETENTIONPERIOD_DESCRIPTOR)
field(AVAILABILITYZONE_DESCRIPTOR)
field(AVAILABILITYZONERELOCATION_DESCRIPTOR)
field(CLUSTERIDENTIFIER_DESCRIPTOR)
field(CLUSTERPARAMETERGROUPNAME_DESCRIPTOR)
field(CLUSTERSECURITYGROUPS_DESCRIPTOR)
field(CLUSTERTYPE_DESCRIPTOR)
field(CLUSTERVERSION_DESCRIPTOR)
field(ELASTICIP_DESCRIPTOR)
field(ENCRYPTED_DESCRIPTOR)
field(ENHANCEDVPCROUTING_DESCRIPTOR)
field(HSMCLIENTCERTIFICATEIDENTIFIER_DESCRIPTOR)
field(HSMCONFIGURATIONIDENTIFIER_DESCRIPTOR)
field(IPADDRESSTYPE_DESCRIPTOR)
field(KMSKEYID_DESCRIPTOR)
field(MAINTENANCETRACKNAME_DESCRIPTOR)
field(MANAGEMASTERPASSWORD_DESCRIPTOR)
field(MANUALSNAPSHOTRETENTIONPERIOD_DESCRIPTOR)
field(MASTERPASSWORDSECRETKMSKEYID_DESCRIPTOR)
field(MASTERUSERPASSWORD_DESCRIPTOR)
field(MULTIAZ_DESCRIPTOR)
field(NEWCLUSTERIDENTIFIER_DESCRIPTOR)
field(NODETYPE_DESCRIPTOR)
field(NUMBEROFNODES_DESCRIPTOR)
field(PORT_DESCRIPTOR)
field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR)
field(PUBLICLYACCESSIBLE_DESCRIPTOR)
field(VPCSECURITYGROUPIDS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.allowVersionUpgrade?.let { field(ALLOWVERSIONUPGRADE_DESCRIPTOR, it) }
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.clusterType?.let { field(CLUSTERTYPE_DESCRIPTOR, it) }
input.clusterVersion?.let { field(CLUSTERVERSION_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) }
input.ipAddressType?.let { field(IPADDRESSTYPE_DESCRIPTOR, it) }
input.kmsKeyId?.let { field(KMSKEYID_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.multiAz?.let { field(MULTIAZ_DESCRIPTOR, it) }
input.newClusterIdentifier?.let { field(NEWCLUSTERIDENTIFIER_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) }
if (input.vpcSecurityGroupIds != null) {
listField(VPCSECURITYGROUPIDS_DESCRIPTOR) {
for (el0 in input.vpcSecurityGroupIds) {
serializeString(el0)
}
}
}
}
return serializer.toByteArray()
}