com.cloudinary.upload.request.ArchiveRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-uploader Show documentation
Show all versions of kotlin-uploader Show documentation
Cloudinary is a cloud service that offers a solution to a web application's entire image management pipeline. Upload images to the cloud. Automatically perform smart image resizing, cropping and conversion without installing any complex software. Integrate Facebook or Twitter profile image extraction in a snap, in any dimension and style to match your websiteâs graphics requirements. Images are seamlessly delivered through a fast CDN, and much much more. This Java library allows to easily integrate with Cloudinary in Kotlin applications.
The newest version!
package com.cloudinary.upload.request
import com.cloudinary.config.CloudinaryConfig
import com.cloudinary.upload.Uploader
import com.cloudinary.upload.request.params.ArchiveParams
import com.cloudinary.upload.response.ArchiveResult
import com.cloudinary.util.toArchiveResult
import com.cloudinary.util.toMap
class ArchiveRequest internal constructor(
uploader: Uploader,
options: UploaderOptions,
cloudinaryConfig: CloudinaryConfig,
internal val params: ArchiveParams
) : AbstractUploaderRequest(uploader, options, cloudinaryConfig) {
override fun buildParams() = params.toMap()
override fun execute() = uploader.callApi(this, "generate_archive", ::toArchiveResult)
class Builder internal constructor(uploader: Uploader) :
UploaderRequestsBuilder(uploader) {
var params = ArchiveParams.Builder().build()
fun params(params: ArchiveParams.Builder.() -> Unit) {
val builder = ArchiveParams.Builder()
builder.params()
this.params = builder.build()
}
override fun build() = ArchiveRequest(uploader, options, cloudinaryConfig, params)
}
}