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

commonMain.com.algolia.search.model.analytics.ABTestID.kt Maven / Gradle / Ivy

Go to download

"Algolia is a powerful search-as-a-service solution, made easy to use with API clients, UI libraries, and pre-built integrations. Algolia API Client for Kotlin lets you easily use the Algolia Search REST API from your JVM project, such as Android or backend implementations."

There is a newer version: 3.12.2
Show newest version
package com.algolia.search.model.analytics

import com.algolia.search.helper.toABTestID
import com.algolia.search.model.internal.Raw
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.builtins.serializer
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
 * ID of an [ABTest].
 */
@Serializable(ABTestID.Companion::class)
public data class ABTestID(override val raw: Long) : Raw {

    override fun toString(): String {
        return raw.toString()
    }

    public companion object : KSerializer {

        private val serializer = Long.serializer()

        override val descriptor: SerialDescriptor = serializer.descriptor

        override fun serialize(encoder: Encoder, value: ABTestID) {
            serializer.serialize(encoder, value.raw)
        }

        override fun deserialize(decoder: Decoder): ABTestID {
            val long = serializer.deserialize(decoder)

            return long.toABTestID()
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy