|
| 1 | +# This file was auto-generated by Fern from our API Definition. |
| 2 | + |
| 3 | +from ..core.pydantic_utilities import UniversalBaseModel |
| 4 | +import pydantic |
| 5 | +from .streak_frequency import StreakFrequency |
| 6 | +import typing |
| 7 | +import typing_extensions |
| 8 | +from ..core.serialization import FieldMetadata |
| 9 | +from ..core.pydantic_utilities import IS_PYDANTIC_V2 |
| 10 | + |
| 11 | + |
| 12 | +class BaseStreakResponse(UniversalBaseModel): |
| 13 | + length: int = pydantic.Field() |
| 14 | + """ |
| 15 | + The length of the user's current streak. |
| 16 | + """ |
| 17 | + |
| 18 | + frequency: StreakFrequency = pydantic.Field() |
| 19 | + """ |
| 20 | + The frequency of the streak. |
| 21 | + """ |
| 22 | + |
| 23 | + started: typing.Optional[str] = pydantic.Field(default=None) |
| 24 | + """ |
| 25 | + The date the streak started. |
| 26 | + """ |
| 27 | + |
| 28 | + period_start: typing_extensions.Annotated[ |
| 29 | + typing.Optional[str], FieldMetadata(alias="periodStart") |
| 30 | + ] = pydantic.Field(default=None) |
| 31 | + """ |
| 32 | + The start date of the current streak period. |
| 33 | + """ |
| 34 | + |
| 35 | + period_end: typing_extensions.Annotated[ |
| 36 | + typing.Optional[str], FieldMetadata(alias="periodEnd") |
| 37 | + ] = pydantic.Field(default=None) |
| 38 | + """ |
| 39 | + The end date of the current streak period. |
| 40 | + """ |
| 41 | + |
| 42 | + expires: typing.Optional[str] = pydantic.Field(default=None) |
| 43 | + """ |
| 44 | + The date the streak will expire if the user does not increment a metric. |
| 45 | + """ |
| 46 | + |
| 47 | + if IS_PYDANTIC_V2: |
| 48 | + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( |
| 49 | + extra="allow", frozen=True |
| 50 | + ) # type: ignore # Pydantic v2 |
| 51 | + else: |
| 52 | + |
| 53 | + class Config: |
| 54 | + frozen = True |
| 55 | + smart_union = True |
| 56 | + extra = pydantic.Extra.allow |
0 commit comments