commonMain.aws.sdk.kotlin.services.codegurureviewer.serde.RepositoryAssociationDocumentDeserializer.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.ProviderType
import aws.sdk.kotlin.services.codegurureviewer.model.RepositoryAssociation
import aws.sdk.kotlin.services.codegurureviewer.model.RepositoryAssociationState
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 deserializeRepositoryAssociationDocument(deserializer: Deserializer): RepositoryAssociation {
val builder = RepositoryAssociation.Builder()
val ASSOCIATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AssociationArn"))
val ASSOCIATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AssociationId"))
val CONNECTIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConnectionArn"))
val CREATEDTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedTimeStamp"))
val KMSKEYDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("KMSKeyDetails"))
val LASTUPDATEDTIMESTAMP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastUpdatedTimeStamp"))
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 S3REPOSITORYDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("S3RepositoryDetails"))
val STATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("State"))
val STATEREASON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("StateReason"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ASSOCIATIONARN_DESCRIPTOR)
field(ASSOCIATIONID_DESCRIPTOR)
field(CONNECTIONARN_DESCRIPTOR)
field(CREATEDTIMESTAMP_DESCRIPTOR)
field(KMSKEYDETAILS_DESCRIPTOR)
field(LASTUPDATEDTIMESTAMP_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(OWNER_DESCRIPTOR)
field(PROVIDERTYPE_DESCRIPTOR)
field(S3REPOSITORYDETAILS_DESCRIPTOR)
field(STATE_DESCRIPTOR)
field(STATEREASON_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ASSOCIATIONARN_DESCRIPTOR.index -> builder.associationArn = deserializeString()
ASSOCIATIONID_DESCRIPTOR.index -> builder.associationId = deserializeString()
CONNECTIONARN_DESCRIPTOR.index -> builder.connectionArn = deserializeString()
CREATEDTIMESTAMP_DESCRIPTOR.index -> builder.createdTimeStamp = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
KMSKEYDETAILS_DESCRIPTOR.index -> builder.kmsKeyDetails = deserializeKmsKeyDetailsDocument(deserializer)
LASTUPDATEDTIMESTAMP_DESCRIPTOR.index -> builder.lastUpdatedTimeStamp = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
OWNER_DESCRIPTOR.index -> builder.owner = deserializeString()
PROVIDERTYPE_DESCRIPTOR.index -> builder.providerType = deserializeString().let { ProviderType.fromValue(it) }
S3REPOSITORYDETAILS_DESCRIPTOR.index -> builder.s3RepositoryDetails = deserializeS3RepositoryDetailsDocument(deserializer)
STATE_DESCRIPTOR.index -> builder.state = deserializeString().let { RepositoryAssociationState.fromValue(it) }
STATEREASON_DESCRIPTOR.index -> builder.stateReason = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}