commonMain.aws.sdk.kotlin.services.eventbridge.serde.ApiDestinationDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eventbridge-jvm Show documentation
Show all versions of eventbridge-jvm Show documentation
The AWS SDK for Kotlin client for EventBridge
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.eventbridge.serde
import aws.sdk.kotlin.services.eventbridge.model.ApiDestination
import aws.sdk.kotlin.services.eventbridge.model.ApiDestinationHttpMethod
import aws.sdk.kotlin.services.eventbridge.model.ApiDestinationState
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 deserializeApiDestinationDocument(deserializer: Deserializer): ApiDestination {
val builder = ApiDestination.Builder()
val APIDESTINATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ApiDestinationArn"))
val APIDESTINATIONSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ApiDestinationState"))
val CONNECTIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConnectionArn"))
val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreationTime"))
val HTTPMETHOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("HttpMethod"))
val INVOCATIONENDPOINT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InvocationEndpoint"))
val INVOCATIONRATELIMITPERSECOND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("InvocationRateLimitPerSecond"))
val LASTMODIFIEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("LastModifiedTime"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(APIDESTINATIONARN_DESCRIPTOR)
field(APIDESTINATIONSTATE_DESCRIPTOR)
field(CONNECTIONARN_DESCRIPTOR)
field(CREATIONTIME_DESCRIPTOR)
field(HTTPMETHOD_DESCRIPTOR)
field(INVOCATIONENDPOINT_DESCRIPTOR)
field(INVOCATIONRATELIMITPERSECOND_DESCRIPTOR)
field(LASTMODIFIEDTIME_DESCRIPTOR)
field(NAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
APIDESTINATIONARN_DESCRIPTOR.index -> builder.apiDestinationArn = deserializeString()
APIDESTINATIONSTATE_DESCRIPTOR.index -> builder.apiDestinationState = deserializeString().let { ApiDestinationState.fromValue(it) }
CONNECTIONARN_DESCRIPTOR.index -> builder.connectionArn = deserializeString()
CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
HTTPMETHOD_DESCRIPTOR.index -> builder.httpMethod = deserializeString().let { ApiDestinationHttpMethod.fromValue(it) }
INVOCATIONENDPOINT_DESCRIPTOR.index -> builder.invocationEndpoint = deserializeString()
INVOCATIONRATELIMITPERSECOND_DESCRIPTOR.index -> builder.invocationRateLimitPerSecond = deserializeInt()
LASTMODIFIEDTIME_DESCRIPTOR.index -> builder.lastModifiedTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}