Skip to content

Commit dd70e0e

Browse files
committed
chore: lint and api dump
1 parent e10886d commit dd70e0e

File tree

2 files changed

+354
-0
lines changed

2 files changed

+354
-0
lines changed

posthog/api/posthog.api

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,85 @@ public final class com/posthog/internal/FeatureFlagMetadata {
453453
public fun toString ()Ljava/lang/String;
454454
}
455455

456+
public final class com/posthog/internal/FlagConditionGroup {
457+
public fun <init> (Ljava/util/List;Ljava/lang/Integer;Ljava/lang/String;)V
458+
public final fun getProperties ()Ljava/util/List;
459+
public final fun getRolloutPercentage ()Ljava/lang/Integer;
460+
public final fun getVariant ()Ljava/lang/String;
461+
}
462+
463+
public final class com/posthog/internal/FlagDefinition {
464+
public fun <init> (ILjava/lang/String;Ljava/lang/String;ZLcom/posthog/internal/FlagFilters;I)V
465+
public final fun getActive ()Z
466+
public final fun getFilters ()Lcom/posthog/internal/FlagFilters;
467+
public final fun getId ()I
468+
public final fun getKey ()Ljava/lang/String;
469+
public final fun getName ()Ljava/lang/String;
470+
public final fun getVersion ()I
471+
}
472+
473+
public final class com/posthog/internal/FlagFilters {
474+
public fun <init> (Ljava/util/List;Lcom/posthog/internal/MultiVariateConfig;Ljava/util/Map;Ljava/lang/Integer;)V
475+
public final fun getAggregationGroupTypeIndex ()Ljava/lang/Integer;
476+
public final fun getGroups ()Ljava/util/List;
477+
public final fun getMultivariate ()Lcom/posthog/internal/MultiVariateConfig;
478+
public final fun getPayloads ()Ljava/util/Map;
479+
}
480+
481+
public final class com/posthog/internal/FlagProperty {
482+
public fun <init> (Ljava/lang/String;Ljava/lang/Object;Lcom/posthog/internal/PropertyOperator;Lcom/posthog/internal/PropertyType;Ljava/lang/Boolean;Ljava/util/List;)V
483+
public final fun component1 ()Ljava/lang/String;
484+
public final fun component2 ()Ljava/lang/Object;
485+
public final fun component3 ()Lcom/posthog/internal/PropertyOperator;
486+
public final fun component4 ()Lcom/posthog/internal/PropertyType;
487+
public final fun component5 ()Ljava/lang/Boolean;
488+
public final fun component6 ()Ljava/util/List;
489+
public final fun copy (Ljava/lang/String;Ljava/lang/Object;Lcom/posthog/internal/PropertyOperator;Lcom/posthog/internal/PropertyType;Ljava/lang/Boolean;Ljava/util/List;)Lcom/posthog/internal/FlagProperty;
490+
public static synthetic fun copy$default (Lcom/posthog/internal/FlagProperty;Ljava/lang/String;Ljava/lang/Object;Lcom/posthog/internal/PropertyOperator;Lcom/posthog/internal/PropertyType;Ljava/lang/Boolean;Ljava/util/List;ILjava/lang/Object;)Lcom/posthog/internal/FlagProperty;
491+
public fun equals (Ljava/lang/Object;)Z
492+
public final fun getDependencyChain ()Ljava/util/List;
493+
public final fun getKey ()Ljava/lang/String;
494+
public final fun getNegation ()Ljava/lang/Boolean;
495+
public final fun getPropertyOperator ()Lcom/posthog/internal/PropertyOperator;
496+
public final fun getPropertyValue ()Ljava/lang/Object;
497+
public final fun getType ()Lcom/posthog/internal/PropertyType;
498+
public fun hashCode ()I
499+
public fun toString ()Ljava/lang/String;
500+
}
501+
502+
public final class com/posthog/internal/LocalEvaluationResponse {
503+
public fun <init> (Ljava/util/List;Ljava/util/Map;Ljava/util/Map;)V
504+
public final fun component1 ()Ljava/util/List;
505+
public final fun component2 ()Ljava/util/Map;
506+
public final fun component3 ()Ljava/util/Map;
507+
public final fun copy (Ljava/util/List;Ljava/util/Map;Ljava/util/Map;)Lcom/posthog/internal/LocalEvaluationResponse;
508+
public static synthetic fun copy$default (Lcom/posthog/internal/LocalEvaluationResponse;Ljava/util/List;Ljava/util/Map;Ljava/util/Map;ILjava/lang/Object;)Lcom/posthog/internal/LocalEvaluationResponse;
509+
public fun equals (Ljava/lang/Object;)Z
510+
public final fun getCohorts ()Ljava/util/Map;
511+
public final fun getFlags ()Ljava/util/List;
512+
public final fun getGroupTypeMapping ()Ljava/util/Map;
513+
public fun hashCode ()I
514+
public fun toString ()Ljava/lang/String;
515+
}
516+
517+
public final class com/posthog/internal/LogicalOperator : java/lang/Enum {
518+
public static final field AND Lcom/posthog/internal/LogicalOperator;
519+
public static final field OR Lcom/posthog/internal/LogicalOperator;
520+
public static fun valueOf (Ljava/lang/String;)Lcom/posthog/internal/LogicalOperator;
521+
public static fun values ()[Lcom/posthog/internal/LogicalOperator;
522+
}
523+
524+
public final class com/posthog/internal/MultiVariateConfig {
525+
public fun <init> (Ljava/util/List;)V
526+
public final fun component1 ()Ljava/util/List;
527+
public final fun copy (Ljava/util/List;)Lcom/posthog/internal/MultiVariateConfig;
528+
public static synthetic fun copy$default (Lcom/posthog/internal/MultiVariateConfig;Ljava/util/List;ILjava/lang/Object;)Lcom/posthog/internal/MultiVariateConfig;
529+
public fun equals (Ljava/lang/Object;)Z
530+
public final fun getVariants ()Ljava/util/List;
531+
public fun hashCode ()I
532+
public fun toString ()Ljava/lang/String;
533+
}
534+
456535
public final class com/posthog/internal/PostHogApi {
457536
public fun <init> (Lcom/posthog/PostHogConfig;)V
458537
public final fun batch (Ljava/util/List;)V
@@ -658,6 +737,95 @@ public final class com/posthog/internal/PostHogUtilsKt {
658737
public static final fun submitSyncSafely (Ljava/util/concurrent/ExecutorService;Ljava/lang/Runnable;)V
659738
}
660739

740+
public final class com/posthog/internal/PropertyGroup {
741+
public fun <init> (Lcom/posthog/internal/LogicalOperator;Lcom/posthog/internal/PropertyValue;)V
742+
public final fun component1 ()Lcom/posthog/internal/LogicalOperator;
743+
public final fun component2 ()Lcom/posthog/internal/PropertyValue;
744+
public final fun copy (Lcom/posthog/internal/LogicalOperator;Lcom/posthog/internal/PropertyValue;)Lcom/posthog/internal/PropertyGroup;
745+
public static synthetic fun copy$default (Lcom/posthog/internal/PropertyGroup;Lcom/posthog/internal/LogicalOperator;Lcom/posthog/internal/PropertyValue;ILjava/lang/Object;)Lcom/posthog/internal/PropertyGroup;
746+
public fun equals (Ljava/lang/Object;)Z
747+
public final fun getType ()Lcom/posthog/internal/LogicalOperator;
748+
public final fun getValues ()Lcom/posthog/internal/PropertyValue;
749+
public fun hashCode ()I
750+
public fun toString ()Ljava/lang/String;
751+
}
752+
753+
public final class com/posthog/internal/PropertyOperator : java/lang/Enum {
754+
public static final field Companion Lcom/posthog/internal/PropertyOperator$Companion;
755+
public static final field EXACT Lcom/posthog/internal/PropertyOperator;
756+
public static final field FLAG_EVALUATES_TO Lcom/posthog/internal/PropertyOperator;
757+
public static final field GT Lcom/posthog/internal/PropertyOperator;
758+
public static final field GTE Lcom/posthog/internal/PropertyOperator;
759+
public static final field ICONTAINS Lcom/posthog/internal/PropertyOperator;
760+
public static final field IN Lcom/posthog/internal/PropertyOperator;
761+
public static final field IS_DATE_AFTER Lcom/posthog/internal/PropertyOperator;
762+
public static final field IS_DATE_BEFORE Lcom/posthog/internal/PropertyOperator;
763+
public static final field IS_NOT Lcom/posthog/internal/PropertyOperator;
764+
public static final field IS_NOT_SET Lcom/posthog/internal/PropertyOperator;
765+
public static final field IS_SET Lcom/posthog/internal/PropertyOperator;
766+
public static final field LT Lcom/posthog/internal/PropertyOperator;
767+
public static final field LTE Lcom/posthog/internal/PropertyOperator;
768+
public static final field NOT_ICONTAINS Lcom/posthog/internal/PropertyOperator;
769+
public static final field NOT_REGEX Lcom/posthog/internal/PropertyOperator;
770+
public static final field REGEX Lcom/posthog/internal/PropertyOperator;
771+
public static final field UNKNOWN Lcom/posthog/internal/PropertyOperator;
772+
public static fun valueOf (Ljava/lang/String;)Lcom/posthog/internal/PropertyOperator;
773+
public static fun values ()[Lcom/posthog/internal/PropertyOperator;
774+
}
775+
776+
public final class com/posthog/internal/PropertyOperator$Companion {
777+
public final fun fromString (Ljava/lang/String;)Lcom/posthog/internal/PropertyOperator;
778+
public final fun fromStringOrNull (Ljava/lang/String;)Lcom/posthog/internal/PropertyOperator;
779+
}
780+
781+
public final class com/posthog/internal/PropertyType : java/lang/Enum {
782+
public static final field COHORT Lcom/posthog/internal/PropertyType;
783+
public static final field Companion Lcom/posthog/internal/PropertyType$Companion;
784+
public static final field FLAG Lcom/posthog/internal/PropertyType;
785+
public static final field PERSON Lcom/posthog/internal/PropertyType;
786+
public static fun valueOf (Ljava/lang/String;)Lcom/posthog/internal/PropertyType;
787+
public static fun values ()[Lcom/posthog/internal/PropertyType;
788+
}
789+
790+
public final class com/posthog/internal/PropertyType$Companion {
791+
public final fun fromString (Ljava/lang/String;)Lcom/posthog/internal/PropertyType;
792+
public final fun fromStringOrNull (Ljava/lang/String;)Lcom/posthog/internal/PropertyType;
793+
}
794+
795+
public abstract interface class com/posthog/internal/PropertyValue {
796+
public abstract fun isEmpty ()Z
797+
}
798+
799+
public final class com/posthog/internal/PropertyValue$FlagProperties : com/posthog/internal/PropertyValue {
800+
public fun <init> (Ljava/util/List;)V
801+
public final fun component1 ()Ljava/util/List;
802+
public final fun copy (Ljava/util/List;)Lcom/posthog/internal/PropertyValue$FlagProperties;
803+
public static synthetic fun copy$default (Lcom/posthog/internal/PropertyValue$FlagProperties;Ljava/util/List;ILjava/lang/Object;)Lcom/posthog/internal/PropertyValue$FlagProperties;
804+
public fun equals (Ljava/lang/Object;)Z
805+
public final fun getValues ()Ljava/util/List;
806+
public fun hashCode ()I
807+
public fun isEmpty ()Z
808+
public fun toString ()Ljava/lang/String;
809+
}
810+
811+
public final class com/posthog/internal/PropertyValue$PropertyGroups : com/posthog/internal/PropertyValue {
812+
public fun <init> (Ljava/util/List;)V
813+
public final fun component1 ()Ljava/util/List;
814+
public final fun copy (Ljava/util/List;)Lcom/posthog/internal/PropertyValue$PropertyGroups;
815+
public static synthetic fun copy$default (Lcom/posthog/internal/PropertyValue$PropertyGroups;Ljava/util/List;ILjava/lang/Object;)Lcom/posthog/internal/PropertyValue$PropertyGroups;
816+
public fun equals (Ljava/lang/Object;)Z
817+
public final fun getValues ()Ljava/util/List;
818+
public fun hashCode ()I
819+
public fun isEmpty ()Z
820+
public fun toString ()Ljava/lang/String;
821+
}
822+
823+
public final class com/posthog/internal/VariantDefinition {
824+
public fun <init> (Ljava/lang/String;D)V
825+
public final fun getKey ()Ljava/lang/String;
826+
public final fun getRolloutPercentage ()D
827+
}
828+
661829
public abstract interface class com/posthog/internal/replay/PostHogSessionReplayHandler {
662830
public abstract fun isActive ()Z
663831
public abstract fun start (Z)V
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
package com.posthog.internal
2+
3+
import com.google.gson.annotations.SerializedName
4+
import com.posthog.PostHogInternal
5+
6+
/**
7+
* Response from /api/feature_flag/local_evaluation/
8+
*/
9+
@PostHogInternal
10+
public data class LocalEvaluationResponse(
11+
val flags: List<FlagDefinition>?,
12+
@SerializedName("group_type_mapping")
13+
val groupTypeMapping: Map<String, String>?,
14+
val cohorts: Map<String, PropertyGroup>?,
15+
)
16+
17+
/**
18+
* Complete feature flag definition for local evaluation
19+
*/
20+
@PostHogInternal
21+
public class FlagDefinition(
22+
public val id: Int,
23+
public val name: String,
24+
public val key: String,
25+
public val active: Boolean,
26+
public val filters: FlagFilters,
27+
public val version: Int,
28+
)
29+
30+
/**
31+
* Flag filters containing groups and multivariate config
32+
*/
33+
@PostHogInternal
34+
public class FlagFilters(
35+
public val groups: List<FlagConditionGroup>?,
36+
public val multivariate: MultiVariateConfig?,
37+
public val payloads: Map<String, Any?>?,
38+
@SerializedName("aggregation_group_type_index")
39+
public val aggregationGroupTypeIndex: Int?,
40+
)
41+
42+
/**
43+
* A condition group with properties and rollout percentage
44+
*/
45+
@PostHogInternal
46+
public class FlagConditionGroup(
47+
public val properties: List<FlagProperty>?,
48+
@SerializedName("rollout_percentage")
49+
public val rolloutPercentage: Int?,
50+
public val variant: String?,
51+
)
52+
53+
/**
54+
* A property condition for flag evaluation
55+
*/
56+
@PostHogInternal
57+
public data class FlagProperty(
58+
val key: String,
59+
@SerializedName("value")
60+
val propertyValue: Any?,
61+
@SerializedName("operator")
62+
val propertyOperator: PropertyOperator?,
63+
val type: PropertyType?,
64+
val negation: Boolean?,
65+
@SerializedName("dependency_chain")
66+
val dependencyChain: List<String>?,
67+
)
68+
69+
/**
70+
* Multivariate configuration for A/B testing
71+
*/
72+
@PostHogInternal
73+
public data class MultiVariateConfig(
74+
val variants: List<VariantDefinition>?,
75+
)
76+
77+
/**
78+
* A variant definition with key and rollout percentage
79+
*/
80+
@PostHogInternal
81+
public class VariantDefinition(
82+
public val key: String,
83+
@SerializedName("rollout_percentage")
84+
public val rolloutPercentage: Double,
85+
)
86+
87+
@PostHogInternal
88+
public enum class LogicalOperator {
89+
AND,
90+
OR,
91+
}
92+
93+
@PostHogInternal
94+
public sealed interface PropertyValue {
95+
public fun isEmpty(): Boolean
96+
97+
public data class PropertyGroups(val values: List<PropertyGroup>) : PropertyValue {
98+
override fun isEmpty(): Boolean = values.isEmpty()
99+
}
100+
101+
public data class FlagProperties(val values: List<FlagProperty>) : PropertyValue {
102+
override fun isEmpty(): Boolean = values.isEmpty()
103+
}
104+
}
105+
106+
/**
107+
* Property group definition for matching property values
108+
*/
109+
@PostHogInternal
110+
public data class PropertyGroup(
111+
val type: LogicalOperator?,
112+
val values: PropertyValue?,
113+
)
114+
115+
@PostHogInternal
116+
public enum class PropertyOperator {
117+
UNKNOWN,
118+
EXACT,
119+
IS_NOT,
120+
IS_SET,
121+
IS_NOT_SET,
122+
ICONTAINS,
123+
NOT_ICONTAINS,
124+
REGEX,
125+
NOT_REGEX,
126+
IN,
127+
GT,
128+
GTE,
129+
LT,
130+
LTE,
131+
IS_DATE_BEFORE,
132+
IS_DATE_AFTER,
133+
FLAG_EVALUATES_TO,
134+
;
135+
136+
public companion object {
137+
public fun fromString(value: String): PropertyOperator {
138+
return when (value) {
139+
"exact" -> EXACT
140+
"is_not" -> IS_NOT
141+
"is_set" -> IS_SET
142+
"is_not_set" -> IS_NOT_SET
143+
"icontains" -> ICONTAINS
144+
"not_icontains" -> NOT_ICONTAINS
145+
"regex" -> REGEX
146+
"not_regex" -> NOT_REGEX
147+
"in" -> IN
148+
"gt" -> GT
149+
"gte" -> GTE
150+
"lt" -> LT
151+
"lte" -> LTE
152+
"is_date_before" -> IS_DATE_BEFORE
153+
"is_date_after" -> IS_DATE_AFTER
154+
"flag_evaluates_to" -> FLAG_EVALUATES_TO
155+
else -> UNKNOWN
156+
}
157+
}
158+
159+
public fun fromStringOrNull(str: String?): PropertyOperator? {
160+
return str?.let { fromString(it) }
161+
}
162+
}
163+
}
164+
165+
@PostHogInternal
166+
public enum class PropertyType {
167+
COHORT,
168+
FLAG,
169+
PERSON,
170+
;
171+
172+
public companion object {
173+
public fun fromString(value: String): PropertyType {
174+
return when (value) {
175+
"cohort" -> COHORT
176+
"flag" -> FLAG
177+
"person" -> PERSON
178+
else -> PERSON
179+
}
180+
}
181+
182+
public fun fromStringOrNull(str: String?): PropertyType? {
183+
return str?.let { fromString(it) }
184+
}
185+
}
186+
}

0 commit comments

Comments
 (0)