commonMain.aws.sdk.kotlin.services.codeartifact.serde.RepositoryDescriptionDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codeartifact-jvm Show documentation
Show all versions of codeartifact-jvm Show documentation
The AWS SDK for Kotlin client for codeartifact
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codeartifact.serde
import aws.sdk.kotlin.services.codeartifact.model.RepositoryDescription
import aws.sdk.kotlin.services.codeartifact.model.RepositoryExternalConnectionInfo
import aws.sdk.kotlin.services.codeartifact.model.UpstreamRepositoryInfo
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
import kotlin.collections.mutableListOf
internal fun deserializeRepositoryDescriptionDocument(deserializer: Deserializer): RepositoryDescription {
val builder = RepositoryDescription.Builder()
val ADMINISTRATORACCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("administratorAccount"))
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
val CREATEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createdTime"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
val DOMAINNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("domainName"))
val DOMAINOWNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("domainOwner"))
val EXTERNALCONNECTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("externalConnections"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
val UPSTREAMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("upstreams"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ADMINISTRATORACCOUNT_DESCRIPTOR)
field(ARN_DESCRIPTOR)
field(CREATEDTIME_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DOMAINNAME_DESCRIPTOR)
field(DOMAINOWNER_DESCRIPTOR)
field(EXTERNALCONNECTIONS_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(UPSTREAMS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ADMINISTRATORACCOUNT_DESCRIPTOR.index -> builder.administratorAccount = deserializeString()
ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
CREATEDTIME_DESCRIPTOR.index -> builder.createdTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
DOMAINNAME_DESCRIPTOR.index -> builder.domainName = deserializeString()
DOMAINOWNER_DESCRIPTOR.index -> builder.domainOwner = deserializeString()
EXTERNALCONNECTIONS_DESCRIPTOR.index -> builder.externalConnections =
deserializer.deserializeList(EXTERNALCONNECTIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeRepositoryExternalConnectionInfoDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
UPSTREAMS_DESCRIPTOR.index -> builder.upstreams =
deserializer.deserializeList(UPSTREAMS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeUpstreamRepositoryInfoDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}