com.cloudinary.upload.request.params.ArchiveParams.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.params
import com.cloudinary.upload.EagerTransformation
import com.cloudinary.upload.request.UploaderDsl
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
@UploaderDsl
class ArchiveParams(
internal val type: String?,
internal val mode: ArchiveMode,
@Json(name = "target_format")
internal val targetFormat: String?,
@Json(name = "target_public_id")
internal val targetPublicId: String?,
@Json(name = "flatten_folders")
internal val flattenFolders: Boolean,
@Json(name = "flatten_transformations")
internal val flattenTransformations: Boolean,
@Json(name = "use_original_filename")
internal val useOriginalFilename: Boolean,
internal val async: Boolean,
@Json(name = "keep_derived")
internal val keepDerived: Boolean,
@Json(name = "skip_transformation_name")
internal val skipTransformationName: Boolean,
@Json(name = "allow_missing")
internal val allowMissing: Boolean,
@Json(name = "notification_url")
internal val notificationUrl: String?,
@Json(name = "target_tags")
internal val targetTags: List?,
internal val tags: List?,
@Json(name = "public_ids")
internal val publicIds: List?,
@Json(name = "fully_qualified_public_ids")
internal val fullyQualifiedPublicIds: List?,
internal val prefixes: List?,
internal val transformations: List?,
@Json(name = "expires_at")
internal val expiresAt: Long?,
internal val timestamp: Long
) {
class Builder {
var type: String? = null
var mode: ArchiveMode = ArchiveMode.Create
var targetFormat: String? = null
var targetPublicId: String? = null
var flattenFolders = false
var flattenTransformations = false
var useOriginalFilename = false
var async = false
var keepDerived = false
var skipTransformationName = false
var allowMissing = false
var notificationUrl: String? = null
var targetTags: List? = null
var tags: List? = null
var publicIds: List? = null
var fullyQualifiedPublicIds: List? = null
var prefixes: List? = null
var transformations: List? = null
var expiresAt: Long? = null
var timestamp = System.currentTimeMillis() / 1000
fun build() = ArchiveParams(
type,
mode,
targetFormat,
targetPublicId,
flattenFolders,
flattenTransformations,
useOriginalFilename,
async,
keepDerived,
skipTransformationName,
allowMissing,
notificationUrl,
targetTags,
tags,
publicIds,
fullyQualifiedPublicIds,
prefixes,
transformations,
expiresAt,
timestamp
)
}
}
@Suppress("unused")
enum class ArchiveMode(internal val value: String) {
FormatZip("zip"),
Download("download"),
Create("create");
override fun toString() = value
}