diff --git a/kotlin/lib/src/main/java/im/vector/app/features/analytics/plan/SuperProperties.kt b/kotlin/lib/src/main/java/im/vector/app/features/analytics/plan/SuperProperties.kt index d3736b0..7af74a1 100644 --- a/kotlin/lib/src/main/java/im/vector/app/features/analytics/plan/SuperProperties.kt +++ b/kotlin/lib/src/main/java/im/vector/app/features/analytics/plan/SuperProperties.kt @@ -26,10 +26,9 @@ package im.vector.app.features.analytics.plan */ data class SuperProperties( /** - * Used by web to identify the platform (Web Platform/Electron - * Platform). + * Used as a discriminant to breakdown usage per client. */ - val appPlatform: String? = null, + val appPlatform: AppPlatform? = null, /** * Which crypto backend is the client currently using. */ @@ -38,10 +37,6 @@ data class SuperProperties( * Version of the crypto backend. */ val cryptoSDKVersion: String? = null, - /** - * Used as a discriminant to breakdown usage per client. - */ - val platformCodeName: PlatformCodeName? = null, ) { enum class CryptoSDK(val rawValue: String) { @@ -56,50 +51,49 @@ data class SuperProperties( Rust("Rust"), } - enum class PlatformCodeName(val rawValue: String) { - - /** - * Element Desktop platform code. - */ - Desktop("Desktop"), + enum class AppPlatform(val rawValue: String) { /** - * Element Android platform code. + * Element Android platform. */ EA("EA"), /** - * Element iOS platform code. + * Element iOS platform. */ EI("EI"), /** - * Element-X Android platform code. + * Element-X Android platform. */ EXA("EXA"), /** - * Element-X iOS platform code. + * Element-X iOS platform. */ EXI("EXI"), /** - * Other Platform code. + * Element Desktop platform. + */ + ElectronPlatform("Electron Platform"), + + /** + * Other Platform. */ Other("Other"), /** - * Element Web platform code. + * Element Web platform. */ - Web("Web"), + WebPlatform("Web Platform"), } fun getProperties(): Map? { return mutableMapOf().apply { - appPlatform?.let { put("appPlatform", it) } + appPlatform?.let { put("appPlatform", it.rawValue) } cryptoSDK?.let { put("cryptoSDK", it.rawValue) } cryptoSDKVersion?.let { put("cryptoSDKVersion", it) } - platformCodeName?.let { put("platformCodeName", it.rawValue) } }.takeIf { it.isNotEmpty() } } } diff --git a/types/swift/SuperProperties.swift b/types/swift/SuperProperties.swift index 12ef46c..afa8b97 100644 --- a/types/swift/SuperProperties.swift +++ b/types/swift/SuperProperties.swift @@ -23,20 +23,17 @@ import Foundation extension AnalyticsEvent { public struct SuperProperties { - /// Used by web to identify the platform (Web Platform/Electron Platform). - public let appPlatform: String? + /// Used as a discriminant to breakdown usage per client. + public let appPlatform: AppPlatform? /// Which crypto backend is the client currently using. public let cryptoSDK: CryptoSDK? /// Version of the crypto backend. public let cryptoSDKVersion: String? - /// Used as a discriminant to breakdown usage per client. - public let platformCodeName: PlatformCodeName? - public init(appPlatform: String?, cryptoSDK: CryptoSDK?, cryptoSDKVersion: String?, platformCodeName: PlatformCodeName?) { + public init(appPlatform: AppPlatform?, cryptoSDK: CryptoSDK?, cryptoSDKVersion: String?) { self.appPlatform = appPlatform self.cryptoSDK = cryptoSDK self.cryptoSDKVersion = cryptoSDKVersion - self.platformCodeName = platformCodeName } public enum CryptoSDK: String { @@ -46,29 +43,28 @@ extension AnalyticsEvent { case Rust = "Rust" } - public enum PlatformCodeName: String { - /// Element Desktop platform code. - case Desktop = "Desktop" - /// Element Android platform code. + public enum AppPlatform: String { + /// Element Android platform. case EA = "EA" - /// Element iOS platform code. + /// Element iOS platform. case EI = "EI" - /// Element-X Android platform code. + /// Element-X Android platform. case EXA = "EXA" - /// Element-X iOS platform code. + /// Element-X iOS platform. case EXI = "EXI" - /// Other Platform code. + /// Element Desktop platform. + case ElectronPlatform = "Electron Platform" + /// Other Platform. case Other = "Other" - /// Element Web platform code. - case Web = "Web" + /// Element Web platform. + case WebPlatform = "Web Platform" } public var properties: [String: Any?] { return [ - "appPlatform": appPlatform, + "appPlatform": appPlatform?.rawValue, "cryptoSDK": cryptoSDK?.rawValue, - "cryptoSDKVersion": cryptoSDKVersion, - "platformCodeName": platformCodeName?.rawValue + "cryptoSDKVersion": cryptoSDKVersion ] } }