commonMain.aws.sdk.kotlin.services.codegurureviewer.serde.CodeReviewSummaryDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codegurureviewer-jvm Show documentation
Show all versions of codegurureviewer-jvm Show documentation
The AWS SDK for Kotlin client for CodeGuru Reviewer
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codegurureviewer.serde
import aws.sdk.kotlin.services.codegurureviewer.model.CodeReviewSummary
import aws.sdk.kotlin.services.codegurureviewer.model.JobState
import aws.sdk.kotlin.services.codegurureviewer.model.ProviderType
import aws.sdk.kotlin.services.codegurureviewer.model.Type
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 deserializeCodeReviewSummaryDocument(deserializer: Deserializer): CodeReviewSummary {
val builder = CodeReviewSummary.Builder()
val CODEREVIEWARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CodeReviewArn"))
val CREATEDTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedTimeStamp"))
val LASTUPDATEDTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdatedTimeStamp"))
val METRICSSUMMARY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("MetricsSummary"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val OWNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Owner"))
val PROVIDERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ProviderType"))
val PULLREQUESTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("PullRequestId"))
val REPOSITORYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RepositoryName"))
val SOURCECODETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SourceCodeType"))
val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Type"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CODEREVIEWARN_DESCRIPTOR)
field(CREATEDTIMESTAMP_DESCRIPTOR)
field(LASTUPDATEDTIMESTAMP_DESCRIPTOR)
field(METRICSSUMMARY_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(OWNER_DESCRIPTOR)
field(PROVIDERTYPE_DESCRIPTOR)
field(PULLREQUESTID_DESCRIPTOR)
field(REPOSITORYNAME_DESCRIPTOR)
field(SOURCECODETYPE_DESCRIPTOR)
field(STATE_DESCRIPTOR)
field(TYPE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CODEREVIEWARN_DESCRIPTOR.index -> builder.codeReviewArn = deserializeString()
CREATEDTIMESTAMP_DESCRIPTOR.index -> builder.createdTimeStamp = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
LASTUPDATEDTIMESTAMP_DESCRIPTOR.index -> builder.lastUpdatedTimeStamp = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
METRICSSUMMARY_DESCRIPTOR.index -> builder.metricsSummary = deserializeMetricsSummaryDocument(deserializer)
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
OWNER_DESCRIPTOR.index -> builder.owner = deserializeString()
PROVIDERTYPE_DESCRIPTOR.index -> builder.providerType = deserializeString().let { ProviderType.fromValue(it) }
PULLREQUESTID_DESCRIPTOR.index -> builder.pullRequestId = deserializeString()
REPOSITORYNAME_DESCRIPTOR.index -> builder.repositoryName = deserializeString()
SOURCECODETYPE_DESCRIPTOR.index -> builder.sourceCodeType = deserializeSourceCodeTypeDocument(deserializer)
STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { JobState.fromValue(it) }
TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { Type.fromValue(it) }
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}