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

com.cloudinary.upload.request.ArchiveRequest.kt Maven / Gradle / Ivy

Go to download

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)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy