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

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

There is a newer version: 1.3.73-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

import aws.sdk.kotlin.hll.dynamodbmapper.model.PersistenceSpec
import aws.sdk.kotlin.hll.dynamodbmapper.pipeline.internal.MapperContextImpl
import aws.smithy.kotlin.runtime.ExperimentalApi

/**
 * Holds generalized context which may be useful to interceptors
 * @param T The type of objects being converted to/from DynamoDB items
 */
@ExperimentalApi
public interface MapperContext {
    // TODO what other fields would be useful in here?

    /**
     * The metadata about an operation invocation
     */
    public val persistenceSpec: PersistenceSpec

    /**
     * The name of the high-level operation being invoked
     */
    public val operation: String
}

/**
 * Create a new [MapperContext]
 * @param T The type of objects being converted to/from DynamoDB items
 * @param persistenceSpec The metadata about an operation invocation
 * @param operation The name of the high-level operation being invoked
 */
@ExperimentalApi
public fun  MapperContext(persistenceSpec: PersistenceSpec, operation: String): MapperContext =
    MapperContextImpl(persistenceSpec, operation)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy