Skip to content

Commit

Permalink
Remove expect/actual from enums without extra properties (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayShortway authored Aug 8, 2024
1 parent d0d6fa6 commit 1fb4e8d
Show file tree
Hide file tree
Showing 37 changed files with 284 additions and 251 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.models.DiscountPaymentMode

@Suppress("unused")
private class DiscountPaymentModeAPI {

fun check(mode: DiscountPaymentMode) {
when (mode) {
DiscountPaymentMode.FREE_TRIAL,
DiscountPaymentMode.PAY_AS_YOU_GO,
DiscountPaymentMode.PAY_UP_FRONT,
-> {
}
}.exhaustive
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.models.DiscountType

@Suppress("unused")
private class DiscountTypeAPI {

fun check(type: DiscountType) {
when (type) {
DiscountType.INTRODUCTORY,
DiscountType.PROMOTIONAL,
-> {
}
}.exhaustive
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.EntitlementInfo
import com.revenuecat.purchases.kmp.OwnershipType
import com.revenuecat.purchases.kmp.PeriodType
import com.revenuecat.purchases.kmp.Store
import com.revenuecat.purchases.kmp.VerificationResult
import com.revenuecat.purchases.kmp.billingIssueDetectedAtMillis
import com.revenuecat.purchases.kmp.datetime.billingIssueDetectedAtInstant
Expand All @@ -17,11 +14,8 @@ import com.revenuecat.purchases.kmp.isActive
import com.revenuecat.purchases.kmp.isSandbox
import com.revenuecat.purchases.kmp.latestPurchaseDateMillis
import com.revenuecat.purchases.kmp.originalPurchaseDateMillis
import com.revenuecat.purchases.kmp.ownershipType
import com.revenuecat.purchases.kmp.periodType
import com.revenuecat.purchases.kmp.productIdentifier
import com.revenuecat.purchases.kmp.productPlanIdentifier
import com.revenuecat.purchases.kmp.store
import com.revenuecat.purchases.kmp.unsubscribeDetectedAtMillis
import com.revenuecat.purchases.kmp.verification
import com.revenuecat.purchases.kmp.willRenew
Expand All @@ -34,22 +28,25 @@ private class EntitlementInfoAPI {
val identifier: String = identifier
val active: Boolean = isActive
val willRenew: Boolean = willRenew
val periodType: PeriodType = periodType
// FIXME re-enable in SDK-3530
// val periodType: PeriodType = periodType
val latestPurchaseDate: Long? = latestPurchaseDateMillis
val latestPurchaseInstant: Instant? = latestPurchaseInstant
val originalPurchaseDate: Long? = originalPurchaseDateMillis
val originalPurchaseInstant: Instant? = originalPurchaseInstant
val expirationDate: Long? = expirationDateMillis
val expirationInstant: Instant? = expirationInstant
val store: Store = store
// FIXME re-enable in SDK-3530
// val store: Store = store
val productIdentifier: String = productIdentifier
val productPlanIdentifier: String? = productPlanIdentifier
val sandbox: Boolean = isSandbox
val unsubscribeDetectedAt: Long? = unsubscribeDetectedAtMillis
val unsubscribeDetectedAtInstant: Instant? = unsubscribeDetectedAtInstant
val billingIssueDetectedAt: Long? = billingIssueDetectedAtMillis
val billingIssueDetectedAtInstant: Instant? = billingIssueDetectedAtInstant
val ownershipType: OwnershipType = ownershipType
// FIXME re-enable in SDK-3530
// val ownershipType: OwnershipType = ownershipType
val verification: VerificationResult = verification
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.LogLevel

@Suppress("unused")
private class LogLevelAPI {
fun check(logLevel: LogLevel) {
when (logLevel) {
LogLevel.VERBOSE,
LogLevel.DEBUG,
LogLevel.INFO,
LogLevel.WARN,
LogLevel.ERROR,
-> {
}
}.exhaustive
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1fb4e8d

Please sign in to comment.