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

com.cloudinary.config.CloudConfig.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.config

import com.cloudinary.AuthToken

const val CLOUD_NAME = "cloud_name"
const val API_KEY = "api_key"
const val API_SECRET = "api_secret"
const val AUTH_TOKEN = "auth_token"

interface ICloudConfig {
    val cloudName: String
    val apiKey: String?
    val apiSecret: String?
    val authToken: AuthToken?
}

data class CloudConfig(
    override val cloudName: String,
    override val apiKey: String? = null,
    override val apiSecret: String? = null,
    override val authToken: AuthToken? = null
) : ICloudConfig {
    constructor(params: Map) : this(
        cloudName = params[CLOUD_NAME] as String,
        apiKey = params[API_KEY]?.toString(),
        apiSecret = params[API_SECRET]?.toString(),
        authToken = (params[AUTH_TOKEN] as? Map<*, *>)?.let { AuthToken(it) }
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy