All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.bedrock.serde.ProvisionedModelSummaryDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.4.1
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.bedrock.serde

import aws.sdk.kotlin.services.bedrock.model.CommitmentDuration
import aws.sdk.kotlin.services.bedrock.model.ProvisionedModelStatus
import aws.sdk.kotlin.services.bedrock.model.ProvisionedModelSummary
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

internal fun deserializeProvisionedModelSummaryDocument(deserializer: Deserializer): ProvisionedModelSummary {
    val builder = ProvisionedModelSummary.Builder()
    val COMMITMENTDURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("commitmentDuration"))
    val COMMITMENTEXPIRATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("commitmentExpirationTime"))
    val CREATIONTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("creationTime"))
    val DESIREDMODELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("desiredModelArn"))
    val DESIREDMODELUNITS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("desiredModelUnits"))
    val FOUNDATIONMODELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("foundationModelArn"))
    val LASTMODIFIEDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastModifiedTime"))
    val MODELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("modelArn"))
    val MODELUNITS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("modelUnits"))
    val PROVISIONEDMODELARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("provisionedModelArn"))
    val PROVISIONEDMODELNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("provisionedModelName"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("status"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(COMMITMENTDURATION_DESCRIPTOR)
        field(COMMITMENTEXPIRATIONTIME_DESCRIPTOR)
        field(CREATIONTIME_DESCRIPTOR)
        field(DESIREDMODELARN_DESCRIPTOR)
        field(DESIREDMODELUNITS_DESCRIPTOR)
        field(FOUNDATIONMODELARN_DESCRIPTOR)
        field(LASTMODIFIEDTIME_DESCRIPTOR)
        field(MODELARN_DESCRIPTOR)
        field(MODELUNITS_DESCRIPTOR)
        field(PROVISIONEDMODELARN_DESCRIPTOR)
        field(PROVISIONEDMODELNAME_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                COMMITMENTDURATION_DESCRIPTOR.index -> builder.commitmentDuration = deserializeString().let { CommitmentDuration.fromValue(it) }
                COMMITMENTEXPIRATIONTIME_DESCRIPTOR.index -> builder.commitmentExpirationTime = deserializeString().let { Instant.fromIso8601(it) }
                CREATIONTIME_DESCRIPTOR.index -> builder.creationTime = deserializeString().let { Instant.fromIso8601(it) }
                DESIREDMODELARN_DESCRIPTOR.index -> builder.desiredModelArn = deserializeString()
                DESIREDMODELUNITS_DESCRIPTOR.index -> builder.desiredModelUnits = deserializeInt()
                FOUNDATIONMODELARN_DESCRIPTOR.index -> builder.foundationModelArn = deserializeString()
                LASTMODIFIEDTIME_DESCRIPTOR.index -> builder.lastModifiedTime = deserializeString().let { Instant.fromIso8601(it) }
                MODELARN_DESCRIPTOR.index -> builder.modelArn = deserializeString()
                MODELUNITS_DESCRIPTOR.index -> builder.modelUnits = deserializeInt()
                PROVISIONEDMODELARN_DESCRIPTOR.index -> builder.provisionedModelArn = deserializeString()
                PROVISIONEDMODELNAME_DESCRIPTOR.index -> builder.provisionedModelName = deserializeString()
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ProvisionedModelStatus.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy