SauceNaoAPI/src/commonMain/kotlin/dev/inmo/saucenaoapi/SauceRequestSubject.kt
2020-12-02 14:39:54 +06:00

17 lines
526 B
Kotlin

package dev.inmo.saucenaoapi
import io.ktor.http.ContentType
import io.ktor.utils.io.core.Input
internal sealed class SauceRequestSubject
internal data class UrlSauceRequestSubject(val url: String) : SauceRequestSubject()
internal data class InputRequestSubject(val input: Input, val mimeType: ContentType) : SauceRequestSubject()
internal val String.asSauceRequestSubject
get() = UrlSauceRequestSubject(this)
internal fun Input.asSauceRequestSubject(mimeType: ContentType)
= InputRequestSubject(this, mimeType)