commonMain.aws.sdk.kotlin.services.snowball.serde.JobMetadataDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snowball-jvm Show documentation
Show all versions of snowball-jvm Show documentation
The AWS SDK for Kotlin client for Snowball
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.snowball.serde
import aws.sdk.kotlin.services.snowball.model.ImpactLevel
import aws.sdk.kotlin.services.snowball.model.JobMetadata
import aws.sdk.kotlin.services.snowball.model.JobState
import aws.sdk.kotlin.services.snowball.model.JobType
import aws.sdk.kotlin.services.snowball.model.RemoteManagement
import aws.sdk.kotlin.services.snowball.model.SnowballCapacity
import aws.sdk.kotlin.services.snowball.model.SnowballType
import aws.smithy.kotlin.runtime.serde.Deserializer
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.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
internal fun deserializeJobMetadataDocument(deserializer: Deserializer): JobMetadata {
val builder = JobMetadata.Builder()
val ADDRESSID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AddressId"))
val CLUSTERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ClusterId"))
val CREATIONDATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationDate"))
val DATATRANSFERPROGRESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DataTransferProgress"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val DEVICECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DeviceConfiguration"))
val FORWARDINGADDRESSID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ForwardingAddressId"))
val IMPACTLEVEL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ImpactLevel"))
val JOBID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("JobId"))
val JOBLOGINFO_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("JobLogInfo"))
val JOBSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("JobState"))
val JOBTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("JobType"))
val KMSKEYARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("KmsKeyARN"))
val LONGTERMPRICINGID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LongTermPricingId"))
val NOTIFICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Notification"))
val ONDEVICESERVICECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("OnDeviceServiceConfiguration"))
val PICKUPDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("PickupDetails"))
val REMOTEMANAGEMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("RemoteManagement"))
val RESOURCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Resources"))
val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RoleARN"))
val SHIPPINGDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ShippingDetails"))
val SNOWBALLCAPACITYPREFERENCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SnowballCapacityPreference"))
val SNOWBALLID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SnowballId"))
val SNOWBALLTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SnowballType"))
val TAXDOCUMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("TaxDocuments"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ADDRESSID_DESCRIPTOR)
field(CLUSTERID_DESCRIPTOR)
field(CREATIONDATE_DESCRIPTOR)
field(DATATRANSFERPROGRESS_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DEVICECONFIGURATION_DESCRIPTOR)
field(FORWARDINGADDRESSID_DESCRIPTOR)
field(IMPACTLEVEL_DESCRIPTOR)
field(JOBID_DESCRIPTOR)
field(JOBLOGINFO_DESCRIPTOR)
field(JOBSTATE_DESCRIPTOR)
field(JOBTYPE_DESCRIPTOR)
field(KMSKEYARN_DESCRIPTOR)
field(LONGTERMPRICINGID_DESCRIPTOR)
field(NOTIFICATION_DESCRIPTOR)
field(ONDEVICESERVICECONFIGURATION_DESCRIPTOR)
field(PICKUPDETAILS_DESCRIPTOR)
field(REMOTEMANAGEMENT_DESCRIPTOR)
field(RESOURCES_DESCRIPTOR)
field(ROLEARN_DESCRIPTOR)
field(SHIPPINGDETAILS_DESCRIPTOR)
field(SNOWBALLCAPACITYPREFERENCE_DESCRIPTOR)
field(SNOWBALLID_DESCRIPTOR)
field(SNOWBALLTYPE_DESCRIPTOR)
field(TAXDOCUMENTS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ADDRESSID_DESCRIPTOR.index -> builder.addressId = deserializeString()
CLUSTERID_DESCRIPTOR.index -> builder.clusterId = deserializeString()
CREATIONDATE_DESCRIPTOR.index -> builder.creationDate = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DATATRANSFERPROGRESS_DESCRIPTOR.index -> builder.dataTransferProgress = deserializeDataTransferDocument(deserializer)
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
DEVICECONFIGURATION_DESCRIPTOR.index -> builder.deviceConfiguration = deserializeDeviceConfigurationDocument(deserializer)
FORWARDINGADDRESSID_DESCRIPTOR.index -> builder.forwardingAddressId = deserializeString()
IMPACTLEVEL_DESCRIPTOR.index -> builder.impactLevel = deserializeString().let { ImpactLevel.fromValue(it) }
JOBID_DESCRIPTOR.index -> builder.jobId = deserializeString()
JOBLOGINFO_DESCRIPTOR.index -> builder.jobLogInfo = deserializeJobLogsDocument(deserializer)
JOBSTATE_DESCRIPTOR.index -> builder.jobState = deserializeString().let { JobState.fromValue(it) }
JOBTYPE_DESCRIPTOR.index -> builder.jobType = deserializeString().let { JobType.fromValue(it) }
KMSKEYARN_DESCRIPTOR.index -> builder.kmsKeyArn = deserializeString()
LONGTERMPRICINGID_DESCRIPTOR.index -> builder.longTermPricingId = deserializeString()
NOTIFICATION_DESCRIPTOR.index -> builder.notification = deserializeNotificationDocument(deserializer)
ONDEVICESERVICECONFIGURATION_DESCRIPTOR.index -> builder.onDeviceServiceConfiguration = deserializeOnDeviceServiceConfigurationDocument(deserializer)
PICKUPDETAILS_DESCRIPTOR.index -> builder.pickupDetails = deserializePickupDetailsDocument(deserializer)
REMOTEMANAGEMENT_DESCRIPTOR.index -> builder.remoteManagement = deserializeString().let { RemoteManagement.fromValue(it) }
RESOURCES_DESCRIPTOR.index -> builder.resources = deserializeJobResourceDocument(deserializer)
ROLEARN_DESCRIPTOR.index -> builder.roleArn = deserializeString()
SHIPPINGDETAILS_DESCRIPTOR.index -> builder.shippingDetails = deserializeShippingDetailsDocument(deserializer)
SNOWBALLCAPACITYPREFERENCE_DESCRIPTOR.index -> builder.snowballCapacityPreference = deserializeString().let { SnowballCapacity.fromValue(it) }
SNOWBALLID_DESCRIPTOR.index -> builder.snowballId = deserializeString()
SNOWBALLTYPE_DESCRIPTOR.index -> builder.snowballType = deserializeString().let { SnowballType.fromValue(it) }
TAXDOCUMENTS_DESCRIPTOR.index -> builder.taxDocuments = deserializeTaxDocumentsDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}