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

org.http4k.connect.amazon.s3.S3.kt Maven / Gradle / Ivy

There is a newer version: 5.41.0.0
Show newest version
package org.http4k.connect.amazon.s3

import dev.forkhandles.result4k.Result
import org.http4k.connect.Http4kConnectAdapter
import org.http4k.connect.RemoteFailure
import org.http4k.connect.amazon.AwsServiceCompanion
import org.http4k.connect.amazon.model.BucketKey
import org.http4k.connect.amazon.s3.action.GetKey
import org.http4k.connect.amazon.s3.action.PutKey
import org.http4k.connect.amazon.s3.action.S3Action
import org.http4k.connect.amazon.s3.action.S3BucketAction
import java.io.InputStream

/**
 * Docs: https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html
 */
@Http4kConnectAdapter
interface S3 {
    operator fun  invoke(action: S3Action): Result

    companion object : AwsServiceCompanion("s3")
}

/**
 * Interface for bucket-specific S3 operations
 */
@Http4kConnectAdapter
interface S3Bucket {
    operator fun  invoke(action: S3BucketAction): Result

    operator fun get(key: BucketKey): Result = this(GetKey(key))
    operator fun set(key: BucketKey, content: InputStream): Result = this(PutKey(key, content))

    companion object : AwsServiceCompanion("s3")
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy