Module genshin.models.starrail.chronicle.challenge

Starrail chronicle challenge.

Classes

class APCShadowBoss (**data: Any)
Expand source code
class APCShadowBoss(APIModel):
    """Boss in an apocalyptic shadow challenge."""

    id: int
    name: str = Aliased("name_mi18n")
    icon: str

Boss in an apocalyptic shadow challenge.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var icon : str
var id : int
var model_config : pydantic.config.ConfigDict
var name : str
class APCShadowFloor (**data: Any)
Expand source code
class APCShadowFloor(StarRailChallengeFloor):
    """Floor in an apocalyptic shadow challenge."""

    node_1: typing.Optional[APCShadowFloorNode] = Aliased(default=None)
    node_2: typing.Optional[APCShadowFloorNode] = Aliased(default=None)
    node_3: typing.Optional[APCShadowFloorNode] = Aliased(default=None)
    last_update_time: PartialTime

    @property
    def score(self) -> int:
        """Total score of the floor."""
        node_1_score = self.node_1.score if self.node_1 is not None else 0
        node_2_score = self.node_2.score if self.node_2 is not None else 0
        node_3_score = self.node_3.score if self.node_3 is not None else 0
        return node_1_score + node_2_score + node_3_score

Floor in an apocalyptic shadow challenge.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var last_update_time : PartialTime
var model_config : pydantic.config.ConfigDict
var node_1 : APCShadowFloorNode | None
var node_2 : APCShadowFloorNode | None
var node_3 : APCShadowFloorNode | None

Instance variables

prop score : int
Expand source code
@property
def score(self) -> int:
    """Total score of the floor."""
    node_1_score = self.node_1.score if self.node_1 is not None else 0
    node_2_score = self.node_2.score if self.node_2 is not None else 0
    node_3_score = self.node_3.score if self.node_3 is not None else 0
    return node_1_score + node_2_score + node_3_score

Total score of the floor.

Inherited members

class APCShadowFloorNode (**data: Any)
Expand source code
class APCShadowFloorNode(FloorNode):
    """Node for a apocalyptic shadow floor."""

    challenge_time: typing.Optional[PartialTime]  # type: ignore[assignment]
    buff: typing.Optional[ChallengeBuff]
    score: int
    boss_defeated: bool

    @property
    def has_data(self) -> bool:
        """Check if the node has data."""
        return bool(self.avatars)

Node for a apocalyptic shadow floor.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var boss_defeated : bool
var buff : ChallengeBuff | None
var challenge_time : PartialTime | None
var model_config : pydantic.config.ConfigDict
var score : int

Instance variables

prop has_data : bool
Expand source code
@property
def has_data(self) -> bool:
    """Check if the node has data."""
    return bool(self.avatars)

Check if the node has data.

class APCShadowSeason (**data: Any)
Expand source code
class APCShadowSeason(StarRailChallengeSeason):
    """Season of an apocalyptic shadow challenge."""

    upper_boss: typing.Optional[APCShadowBoss] = Aliased(default=None)
    lower_boss: typing.Optional[APCShadowBoss] = Aliased(default=None)
    starward_boss: typing.Optional[APCShadowBoss] = Aliased("tierce_boss", default=None)

Season of an apocalyptic shadow challenge.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var lower_boss : APCShadowBoss | None
var model_config : pydantic.config.ConfigDict
var starward_boss : APCShadowBoss | None
var upper_boss : APCShadowBoss | None
class AnomalyArbitration (**data: Any)
Expand source code
class AnomalyArbitration(APIModel):
    """HSR Anomaly Arbitration info."""

    records: list[AnomalyRecord] = Aliased("challenge_peak_records")
    summary: typing.Optional[AnomalySummary] = Aliased("challenge_peak_best_record_brief", default=None)
    player: AnomalyPlayer = Aliased("role")

HSR Anomaly Arbitration info.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config : pydantic.config.ConfigDict
var player : AnomalyPlayer
var records : list[AnomalyRecord]
var summary : AnomalySummary | None
class AnomalyBossInfo (**data: Any)
Expand source code
class AnomalyBossInfo(APIModel):
    """Anomaly Arbitration boss info."""

    id: int = Aliased("maze_id")
    name: str = Aliased("name_mi18n")
    game_mode_name: str = Aliased("hard_mode_name_mi18n")
    icon: str

Anomaly Arbitration boss info.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var game_mode_name : str
var icon : str
var id : int
var model_config : pydantic.config.ConfigDict
var name : str
class AnomalyBossRecord (**data: Any)
Expand source code
class AnomalyBossRecord(APIModel):
    """Anomaly Arbitration boss record."""

    id: int = Aliased("maze_id")
    has_data: bool = Aliased("has_challenge_record")
    time: PartialTime = Aliased("challenge_time")
    characters: list[FloorCharacter] = Aliased("avatars")
    buff: ChallengeBuff
    is_hard_mode: bool = Aliased("hard_mode")
    cycles_used: int = Aliased("round_num")
    stars: int = Aliased("star_num")
    has_color_medal: bool = Aliased("finish_color_medal")
    medal_type: str = Aliased("challenge_peak_rank_icon_type")
    medal_icon: str = Aliased("challenge_peak_rank_icon")
    record_unique_key: str

Anomaly Arbitration boss record.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var buff : ChallengeBuff
var characters : list[FloorCharacter]
var cycles_used : int
var has_color_medal : bool
var has_data : bool
var id : int
var is_hard_mode : bool
var medal_icon : str
var medal_type : str
var model_config : pydantic.config.ConfigDict
var record_unique_key : str
var stars : int
var time : PartialTime
class AnomalyMiniBossInfo (**data: Any)
Expand source code
class AnomalyMiniBossInfo(APIModel):
    """Anomaly Arbitration mini boss info."""

    id: int = Aliased("maze_id")
    level_name: str = Aliased("name")
    name: str = Aliased("monster_name")
    icon: str = Aliased("monster_icon")

Anomaly Arbitration mini boss info.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var icon : str
var id : int
var level_name : str
var model_config : pydantic.config.ConfigDict
var name : str
class AnomalyMiniBossRecord (**data: Any)
Expand source code
class AnomalyMiniBossRecord(APIModel):
    """Anomaly Arbitration mini boss record."""

    id: int = Aliased("maze_id")
    has_data: bool = Aliased("has_challenge_record")
    time: typing.Optional[PartialTime] = Aliased("challenge_time")
    characters: list[FloorCharacter] = Aliased("avatars")
    cycles_used: int = Aliased("round_num")
    stars: int = Aliased("star_num")
    is_quick_clear: bool = Aliased("is_fast")

Anomaly Arbitration mini boss record.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var characters : list[FloorCharacter]
var cycles_used : int
var has_data : bool
var id : int
var is_quick_clear : bool
var model_config : pydantic.config.ConfigDict
var stars : int
var time : PartialTime | None
class AnomalyPlayer (**data: Any)
Expand source code
class AnomalyPlayer(APIModel):
    """HSR Anomaly Arbitration player info."""

    server: str
    nickname: str
    level: int
    uid: str = Aliased("role_id")

HSR Anomaly Arbitration player info.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var level : int
var model_config : pydantic.config.ConfigDict
var nickname : str
var server : str
var uid : str
class AnomalyRecord (**data: Any)
Expand source code
class AnomalyRecord(APIModel):
    """HSR Anomaly Arbitration record."""

    season: AnomalySeason = Aliased("group")
    boss: AnomalyBossInfo = Aliased("boss_info")
    mini_bosses: list[AnomalyMiniBossInfo] = Aliased("mob_infos")
    has_data: bool = Aliased("has_challenge_record")
    cycles_used: int = Aliased("battle_num")

    boss_record: typing.Optional[AnomalyBossRecord] = Aliased("boss_record", default=None)
    mini_boss_records: list[AnomalyMiniBossRecord] = Aliased("mob_records")

    boss_stars: int
    mini_boss_stars: int = Aliased("mob_stars")

HSR Anomaly Arbitration record.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var boss : AnomalyBossInfo
var boss_record : AnomalyBossRecord | None
var boss_stars : int
var cycles_used : int
var has_data : bool
var mini_boss_records : list[AnomalyMiniBossRecord]
var mini_boss_stars : int
var mini_bosses : list[AnomalyMiniBossInfo]
var model_config : pydantic.config.ConfigDict
var season : AnomalySeason
class AnomalySeason (**data: Any)
Expand source code
class AnomalySeason(APIModel):
    """Anomaly Arbitration season."""

    id: int = Aliased("group_id")
    begin_time: PartialTime
    end_time: PartialTime
    status: str
    name: str = Aliased("name_mi18n")
    game_version: str
    icon: str = Aliased("theme_pic_path")

Anomaly Arbitration season.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var begin_time : PartialTime
var end_time : PartialTime
var game_version : str
var icon : str
var id : int
var model_config : pydantic.config.ConfigDict
var name : str
var status : str
class AnomalySummary (**data: Any)
Expand source code
class AnomalySummary(APIModel):
    """HSR Anomaly Arbitration summary."""

    challenge_attempts: int = Aliased("total_battle_num")
    mini_boss_stars: int = Aliased("mob_stars")
    boss_stars: int
    medal_type: str = Aliased("challenge_peak_rank_icon_type")
    medal_icon: str = Aliased("challenge_peak_rank_icon")

HSR Anomaly Arbitration summary.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var boss_stars : int
var challenge_attempts : int
var medal_icon : str
var medal_type : str
var mini_boss_stars : int
var model_config : pydantic.config.ConfigDict
class ChallengeBuff (**data: Any)
Expand source code
class ChallengeBuff(APIModel):
    """Buff used in a pure fiction or apocalyptic shadow node."""

    id: int
    name: str = Aliased("name_mi18n")
    description: str = Aliased("desc_mi18n")
    simple_description: typing.Optional[str] = Aliased("simple_desc_mi18m", default=None)  # only for PF
    icon: str

Buff used in a pure fiction or apocalyptic shadow node.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var description : str
var icon : str
var id : int
var model_config : pydantic.config.ConfigDict
var name : str
var simple_description : str | None
class FictionFloor (**data: Any)
Expand source code
class FictionFloor(StarRailChallengeFloor):
    """Floor in a Pure Fiction challenge."""

    round_num: int
    node_1: typing.Optional[FictionFloorNode] = Aliased(default=None)
    node_2: typing.Optional[FictionFloorNode] = Aliased(default=None)
    node_3: typing.Optional[FictionFloorNode] = Aliased(default=None)

    @property
    def score(self) -> int:
        """Total score of the floor."""
        node_1_score = self.node_1.score if self.node_1 is not None else 0
        node_2_score = self.node_2.score if self.node_2 is not None else 0
        node_3_score = self.node_3.score if self.node_3 is not None else 0
        return node_1_score + node_2_score + node_3_score

Floor in a Pure Fiction challenge.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config : pydantic.config.ConfigDict
var node_1 : FictionFloorNode | None
var node_2 : FictionFloorNode | None
var node_3 : FictionFloorNode | None
var round_num : int

Instance variables

prop score : int
Expand source code
@property
def score(self) -> int:
    """Total score of the floor."""
    node_1_score = self.node_1.score if self.node_1 is not None else 0
    node_2_score = self.node_2.score if self.node_2 is not None else 0
    node_3_score = self.node_3.score if self.node_3 is not None else 0
    return node_1_score + node_2_score + node_3_score

Total score of the floor.

Inherited members

class FictionFloorNode (**data: Any)
Expand source code
class FictionFloorNode(FloorNode):
    """Node for a Pure Fiction floor."""

    buff: typing.Optional[ChallengeBuff]
    score: int

Node for a Pure Fiction floor.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var buff : ChallengeBuff | None
var model_config : pydantic.config.ConfigDict
var score : int
class FloorNode (**data: Any)
Expand source code
class FloorNode(APIModel):
    """Node for a memory of chaos floor."""

    challenge_time: PartialTime
    avatars: list[FloorCharacter]

Node for a memory of chaos floor.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var avatars : list[FloorCharacter]
var challenge_time : PartialTime
var model_config : pydantic.config.ConfigDict
class StarRailAPCShadow (**data: Any)
Expand source code
class StarRailAPCShadow(APIModel):
    """Apocalyptic shadow challenge in a season."""

    total_stars: int = Aliased("star_num")
    starward_stars: int = Aliased("extra_star_num", default=0)
    max_floor: str
    total_battles: int = Aliased("battle_num")
    has_data: bool

    floors: list[APCShadowFloor] = Aliased("all_floor_detail")
    seasons: list[APCShadowSeason] = Aliased("groups")
    max_floor_id: int

Apocalyptic shadow challenge in a season.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var floors : list[APCShadowFloor]
var has_data : bool
var max_floor : str
var max_floor_id : int
var model_config : pydantic.config.ConfigDict
var seasons : list[APCShadowSeason]
var starward_stars : int
var total_battles : int
var total_stars : int
class StarRailChallenge (**data: Any)
Expand source code
class StarRailChallenge(APIModel):
    """Memory of chaos challenge in a season."""

    name: str
    season: int = Aliased("schedule_id")
    begin_time: typing.Optional[PartialTime]
    end_time: typing.Optional[PartialTime]

    total_stars: int = Aliased("star_num")
    starward_stars: int = Aliased("extra_star_num", default=0)
    max_floor: str
    max_floor_id: int
    total_battles: int = Aliased("battle_num")
    has_data: bool

    floors: typing.Sequence[StarRailFloor] = Aliased("all_floor_detail")
    seasons: typing.Sequence[StarRailChallengeSeason] = Aliased("groups")

    @pydantic.model_validator(mode="before")
    def __extract_name(cls, values: dict[str, typing.Any]) -> dict[str, typing.Any]:
        if "groups" in values and isinstance(values["groups"], list):
            seasons = typing.cast(list[dict[str, typing.Any]], values["groups"])
            if len(seasons) > 0:
                values["name"] = seasons[0]["name_mi18n"]
            else:
                values["name"] = ""

        return values

Memory of chaos challenge in a season.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var begin_time : PartialTime | None
var end_time : PartialTime | None
var floors : Sequence[StarRailFloor]
var has_data : bool
var max_floor : str
var max_floor_id : int
var model_config : pydantic.config.ConfigDict
var name : str
var season : int
var seasons : Sequence[StarRailChallengeSeason]
var starward_stars : int
var total_battles : int
var total_stars : int
class StarRailChallengeFloor (**data: Any)
Expand source code
class StarRailChallengeFloor(APIModel):
    """Base model for star rail challenge floors."""

    id: int = Aliased("maze_id")
    name: str
    star_num: int
    is_quick_clear: bool = Aliased("is_fast")
    has_starward_mode: bool = Aliased("is_tierce", default=False)
    starward_stars: int = Aliased("extra_star_num", default=0)

    @pydantic.computed_field  # type: ignore[prop-decorator]
    @property
    def stars(self) -> int:
        """Number of stars earned on the floor."""
        return self.star_num + self.starward_stars

Base model for star rail challenge floors.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var has_starward_mode : bool
var id : int
var is_quick_clear : bool
var model_config : pydantic.config.ConfigDict
var name : str
var star_num : int
var starward_stars : int

Instance variables

prop stars : int
Expand source code
@pydantic.computed_field  # type: ignore[prop-decorator]
@property
def stars(self) -> int:
    """Number of stars earned on the floor."""
    return self.star_num + self.starward_stars

Number of stars earned on the floor.

class StarRailChallengeSeason (**data: Any)
Expand source code
class StarRailChallengeSeason(APIModel):
    """A season of a challenge."""

    id: int = Aliased("schedule_id")
    name: str = Aliased("name_mi18n")
    status: str
    begin_time: PartialTime
    end_time: PartialTime

A season of a challenge.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Subclasses

Class variables

var begin_time : PartialTime
var end_time : PartialTime
var id : int
var model_config : pydantic.config.ConfigDict
var name : str
var status : str
class StarRailFloor (**data: Any)
Expand source code
class StarRailFloor(StarRailChallengeFloor):
    """Floor in a memory of chaos challenge."""

    round_num: int
    is_chaos: bool
    node_1: typing.Optional[FloorNode] = Aliased(default=None)
    node_2: typing.Optional[FloorNode] = Aliased(default=None)
    node_3: typing.Optional[FloorNode] = Aliased(default=None)

Floor in a memory of chaos challenge.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var is_chaos : bool
var model_config : pydantic.config.ConfigDict
var node_1 : FloorNode | None
var node_2 : FloorNode | None
var node_3 : FloorNode | None
var round_num : int

Inherited members

class StarRailPureFiction (**data: Any)
Expand source code
class StarRailPureFiction(APIModel):
    """Pure Fiction challenge in a season."""

    name: str = pydantic.Field(deprecated="Use `season_id` together with `seasons instead`.")
    season_id: int = pydantic.Field(deprecated="Use `season_id` together with `seasons instead`.")
    begin_time: PartialTime = pydantic.Field(deprecated="Use `season_id` together with `seasons instead`.")
    end_time: PartialTime = pydantic.Field(deprecated="Use `season_id` together with `seasons instead`.")

    total_stars: int = Aliased("star_num")
    starward_stars: int = Aliased("extra_star_num", default=0)
    max_floor: str
    total_battles: int = Aliased("battle_num")
    has_data: bool

    floors: list[FictionFloor] = Aliased("all_floor_detail")
    seasons: list[StarRailChallengeSeason] = Aliased("groups")
    max_floor_id: int

    @pydantic.model_validator(mode="before")
    def __unnest_groups(cls, values: dict[str, typing.Any]) -> dict[str, typing.Any]:
        if "groups" in values and isinstance(values["groups"], list):
            seasons = typing.cast(list[dict[str, typing.Any]], values["groups"])
            if len(seasons) > 0:
                values["name"] = seasons[0]["name_mi18n"]
                values["season_id"] = seasons[0]["schedule_id"]
                values["begin_time"] = seasons[0]["begin_time"]
                values["end_time"] = seasons[0]["end_time"]

        return values

Pure Fiction challenge in a season.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var floors : list[FictionFloor]
var has_data : bool
var max_floor : str
var max_floor_id : int
var model_config : pydantic.config.ConfigDict
var seasons : list[StarRailChallengeSeason]
var starward_stars : int
var total_battles : int
var total_stars : int

Instance variables

var begin_time : PartialTime
Expand source code
def __get__(self, obj: BaseModel | None, obj_type: type[BaseModel] | None = None) -> Any:
    if obj is None:
        if self.wrapped_property is not None:
            return self.wrapped_property.__get__(None, obj_type)
        raise AttributeError(self.field_name)

    warnings.warn(self.msg, DeprecationWarning, stacklevel=2)

    if self.wrapped_property is not None:
        return self.wrapped_property.__get__(obj, obj_type)
    return obj.__dict__[self.field_name]

Read-only data descriptor used to emit a runtime deprecation warning before accessing a deprecated field.

Attributes

msg
The deprecation message to be emitted.
wrapped_property
The property instance if the deprecated field is a computed field, or None.
field_name
The name of the field being deprecated.
var end_time : PartialTime
Expand source code
def __get__(self, obj: BaseModel | None, obj_type: type[BaseModel] | None = None) -> Any:
    if obj is None:
        if self.wrapped_property is not None:
            return self.wrapped_property.__get__(None, obj_type)
        raise AttributeError(self.field_name)

    warnings.warn(self.msg, DeprecationWarning, stacklevel=2)

    if self.wrapped_property is not None:
        return self.wrapped_property.__get__(obj, obj_type)
    return obj.__dict__[self.field_name]

Read-only data descriptor used to emit a runtime deprecation warning before accessing a deprecated field.

Attributes

msg
The deprecation message to be emitted.
wrapped_property
The property instance if the deprecated field is a computed field, or None.
field_name
The name of the field being deprecated.
var name : str
Expand source code
def __get__(self, obj: BaseModel | None, obj_type: type[BaseModel] | None = None) -> Any:
    if obj is None:
        if self.wrapped_property is not None:
            return self.wrapped_property.__get__(None, obj_type)
        raise AttributeError(self.field_name)

    warnings.warn(self.msg, DeprecationWarning, stacklevel=2)

    if self.wrapped_property is not None:
        return self.wrapped_property.__get__(obj, obj_type)
    return obj.__dict__[self.field_name]

Read-only data descriptor used to emit a runtime deprecation warning before accessing a deprecated field.

Attributes

msg
The deprecation message to be emitted.
wrapped_property
The property instance if the deprecated field is a computed field, or None.
field_name
The name of the field being deprecated.
var season_id : int
Expand source code
def __get__(self, obj: BaseModel | None, obj_type: type[BaseModel] | None = None) -> Any:
    if obj is None:
        if self.wrapped_property is not None:
            return self.wrapped_property.__get__(None, obj_type)
        raise AttributeError(self.field_name)

    warnings.warn(self.msg, DeprecationWarning, stacklevel=2)

    if self.wrapped_property is not None:
        return self.wrapped_property.__get__(obj, obj_type)
    return obj.__dict__[self.field_name]

Read-only data descriptor used to emit a runtime deprecation warning before accessing a deprecated field.

Attributes

msg
The deprecation message to be emitted.
wrapped_property
The property instance if the deprecated field is a computed field, or None.
field_name
The name of the field being deprecated.