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

commonMain.aws.sdk.kotlin.hll.dynamodbmapper.pipeline.internal.HReqContextImpl.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99-beta
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */
package aws.sdk.kotlin.hll.dynamodbmapper.pipeline.internal

import aws.sdk.kotlin.hll.dynamodbmapper.items.ItemSchema
import aws.sdk.kotlin.hll.dynamodbmapper.pipeline.HReqContext
import aws.sdk.kotlin.hll.dynamodbmapper.pipeline.MapperContext
import aws.sdk.kotlin.hll.dynamodbmapper.pipeline.SerializeInput

internal data class HReqContextImpl(
    override val highLevelRequest: HReq,
    override val serializeSchema: ItemSchema,
    override val mapperContext: MapperContext,
    override val error: Throwable? = null,
) : HReqContext,
    ErrorCombinable>,
    Combinable, SerializeInput> {

    override fun plus(e: Throwable?) = copy(error = e.suppressing(error))

    override fun plus(value: SerializeInput) = copy(
        highLevelRequest = value.highLevelRequest,
        serializeSchema = value.serializeSchema,
    )
}

internal operator fun  HReqContext.plus(lowLevelRequest: LReq) =
    LReqContextImpl(highLevelRequest, serializeSchema, mapperContext, lowLevelRequest, error)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy