All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.redshift.serde.RestoreFromClusterSnapshotOperationSerializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show 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.RestoreFromClusterSnapshotRequest
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 RestoreFromClusterSnapshotOperationSerializer: HttpSerializer.NonStreaming {
    override fun serialize(context: ExecutionContext, input: RestoreFromClusterSnapshotRequest): HttpRequestBuilder {
        val builder = HttpRequestBuilder()
        builder.method = HttpMethod.POST

        builder.url {
            path.encoded = "/"
        }

        val payload = serializeRestoreFromClusterSnapshotOperationBody(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 serializeRestoreFromClusterSnapshotOperationBody(context: ExecutionContext, input: RestoreFromClusterSnapshotRequest): 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 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 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 MULTIAZ_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, FormUrlSerialName("MultiAZ"))
    val NODETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("NodeType"))
    val NUMBEROFNODES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, FormUrlSerialName("NumberOfNodes"))
    val OWNERACCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("OwnerAccount"))
    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 RESERVEDNODEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("ReservedNodeId"))
    val SNAPSHOTARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("SnapshotArn"))
    val SNAPSHOTCLUSTERIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("SnapshotClusterIdentifier"))
    val SNAPSHOTIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("SnapshotIdentifier"))
    val SNAPSHOTSCHEDULEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("SnapshotScheduleIdentifier"))
    val TARGETRESERVEDNODEOFFERINGID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, FormUrlSerialName("TargetReservedNodeOfferingId"))
    val VPCSECURITYGROUPIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, FormUrlSerialName("VpcSecurityGroupIds"), FormUrlCollectionName("VpcSecurityGroupId"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        trait(FormUrlSerialName("RestoreFromClusterSnapshotMessage"))
        trait(QueryLiteral("Action", "RestoreFromClusterSnapshot"))
        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(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(MAINTENANCETRACKNAME_DESCRIPTOR)
        field(MANAGEMASTERPASSWORD_DESCRIPTOR)
        field(MANUALSNAPSHOTRETENTIONPERIOD_DESCRIPTOR)
        field(MASTERPASSWORDSECRETKMSKEYID_DESCRIPTOR)
        field(MULTIAZ_DESCRIPTOR)
        field(NODETYPE_DESCRIPTOR)
        field(NUMBEROFNODES_DESCRIPTOR)
        field(OWNERACCOUNT_DESCRIPTOR)
        field(PORT_DESCRIPTOR)
        field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR)
        field(PUBLICLYACCESSIBLE_DESCRIPTOR)
        field(RESERVEDNODEID_DESCRIPTOR)
        field(SNAPSHOTARN_DESCRIPTOR)
        field(SNAPSHOTCLUSTERIDENTIFIER_DESCRIPTOR)
        field(SNAPSHOTIDENTIFIER_DESCRIPTOR)
        field(SNAPSHOTSCHEDULEIDENTIFIER_DESCRIPTOR)
        field(TARGETRESERVEDNODEOFFERINGID_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.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.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.multiAz?.let { field(MULTIAZ_DESCRIPTOR, it) }
        input.nodeType?.let { field(NODETYPE_DESCRIPTOR, it) }
        input.numberOfNodes?.let { field(NUMBEROFNODES_DESCRIPTOR, it) }
        input.ownerAccount?.let { field(OWNERACCOUNT_DESCRIPTOR, it) }
        input.port?.let { field(PORT_DESCRIPTOR, it) }
        input.preferredMaintenanceWindow?.let { field(PREFERREDMAINTENANCEWINDOW_DESCRIPTOR, it) }
        input.publiclyAccessible?.let { field(PUBLICLYACCESSIBLE_DESCRIPTOR, it) }
        input.reservedNodeId?.let { field(RESERVEDNODEID_DESCRIPTOR, it) }
        input.snapshotArn?.let { field(SNAPSHOTARN_DESCRIPTOR, it) }
        input.snapshotClusterIdentifier?.let { field(SNAPSHOTCLUSTERIDENTIFIER_DESCRIPTOR, it) }
        input.snapshotIdentifier?.let { field(SNAPSHOTIDENTIFIER_DESCRIPTOR, it) }
        input.snapshotScheduleIdentifier?.let { field(SNAPSHOTSCHEDULEIDENTIFIER_DESCRIPTOR, it) }
        input.targetReservedNodeOfferingId?.let { field(TARGETRESERVEDNODEOFFERINGID_DESCRIPTOR, it) }
        if (input.vpcSecurityGroupIds != null) {
            listField(VPCSECURITYGROUPIDS_DESCRIPTOR) {
                for (el0 in input.vpcSecurityGroupIds) {
                    serializeString(el0)
                }
            }
        }
    }
    return serializer.toByteArray()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy