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

commonMain.com.revenuecat.purchases.kmp.models.EntitlementInfos.kt Maven / Gradle / Ivy

There is a newer version: 1.3.7+13.15.0
Show newest version
package com.revenuecat.purchases.kmp.models

import com.revenuecat.purchases.kmp.models.VerificationResult

/**
 * This class contains all the entitlements associated to the user.
 */
public class EntitlementInfos(

    /**
     * Map of all EntitlementInfo [EntitlementInfo] objects (active and inactive) keyed by entitlement
     * identifier.
     */
    public val all: Map,

    /**
     * If entitlement verification was enabled, the result of that verification. If not,
     * [VerificationResult.NOT_REQUESTED].
     */
    public val verification: VerificationResult
) {
    /**
     * Dictionary of active [EntitlementInfo] objects keyed by entitlement identifier.
     */
    public val active: Map
        get() = all.filter { it.value.isActive }

    /**
     * Dictionary of active [EntitlementInfo] objects keyed by entitlement identifier.
     */
    public operator fun get(s: String): EntitlementInfo? = all[s]
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy