|
10 | 10 |
|
11 | 11 |
|
12 | 12 | class UserRewardTrigger(UniversalBaseModel): |
| 13 | + """ |
| 14 | + The trigger that awarded the reward, as it is configured now. Only the fields for the trigger's current type are included. |
| 15 | + """ |
| 16 | + |
13 | 17 | id: str |
14 | 18 | type: UserRewardTriggerType |
15 | 19 | metric_id: typing_extensions.Annotated[ |
16 | | - typing.Optional[str], FieldMetadata(alias="metricId"), pydantic.Field(alias="metricId") |
| 20 | + typing.Optional[str], |
| 21 | + FieldMetadata(alias="metricId"), |
| 22 | + pydantic.Field(alias="metricId", description="For metric triggers, the ID of the metric."), |
| 23 | + ] = None |
| 24 | + metric_threshold: typing_extensions.Annotated[ |
| 25 | + typing.Optional[int], |
| 26 | + FieldMetadata(alias="metricThreshold"), |
| 27 | + pydantic.Field( |
| 28 | + alias="metricThreshold", |
| 29 | + description="For metric triggers, the reward is awarded each time the user's total for the metric increases by this amount.", |
| 30 | + ), |
17 | 31 | ] = None |
18 | | - threshold: typing.Optional[int] = None |
19 | 32 | achievement_id: typing_extensions.Annotated[ |
20 | | - typing.Optional[str], FieldMetadata(alias="achievementId"), pydantic.Field(alias="achievementId") |
| 33 | + typing.Optional[str], |
| 34 | + FieldMetadata(alias="achievementId"), |
| 35 | + pydantic.Field(alias="achievementId", description="For achievement triggers, the ID of the achievement."), |
21 | 36 | ] = None |
22 | | - streak_length: typing_extensions.Annotated[ |
23 | | - typing.Optional[int], FieldMetadata(alias="streakLength"), pydantic.Field(alias="streakLength") |
| 37 | + streak_length_threshold: typing_extensions.Annotated[ |
| 38 | + typing.Optional[int], |
| 39 | + FieldMetadata(alias="streakLengthThreshold"), |
| 40 | + pydantic.Field( |
| 41 | + alias="streakLengthThreshold", |
| 42 | + description="For streak triggers, the reward is awarded every this many periods of the user's streak.", |
| 43 | + ), |
24 | 44 | ] = None |
25 | 45 | leaderboard_id: typing_extensions.Annotated[ |
26 | | - typing.Optional[str], FieldMetadata(alias="leaderboardId"), pydantic.Field(alias="leaderboardId") |
| 46 | + typing.Optional[str], |
| 47 | + FieldMetadata(alias="leaderboardId"), |
| 48 | + pydantic.Field(alias="leaderboardId", description="For leaderboard triggers, the ID of the leaderboard."), |
27 | 49 | ] = None |
28 | | - rank: typing.Optional[int] = None |
| 50 | + rank: typing.Optional[int] = pydantic.Field(default=None) |
| 51 | + """ |
| 52 | + For leaderboard triggers, the rank a user must finish a leaderboard run at. |
| 53 | + """ |
29 | 54 |
|
30 | 55 | if IS_PYDANTIC_V2: |
31 | 56 | model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 |
|
0 commit comments