Skip to content

Items

pokelance.models.abstract.utils.items ⚓︎

ItemHolderPokemon ⚓︎

Bases: BaseModel

An item holder pokemon resource.

Attributes:

Name Type Description
pokemon NamedResource

The Pokémon that holds this item.

version_details List[ItemHolderPokemonVersionDetail]

The details for the version that this item is held in by the Pokémon.

to_dict() ⚓︎

Convert the model to a dict

Returns:

Type Description
Dict[str, Any]

The model as a dict.

Source code in pokelance/models/_base.py
Python
def to_dict(self) -> t.Dict[str, t.Any]:
    """Convert the model to a dict

    Returns
    -------
    t.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(
        self, filter=attrs.filters.exclude(attrs.fields(BaseModel).raw), value_serializer=_serializer
    )

ItemHolderPokemonVersionDetail ⚓︎

Bases: BaseModel

An item holder pokemon version detail resource.

Attributes:

Name Type Description
rarity int

The chance of this Pokémon holding this item in this version.

version NamedResource

The version that this item is held in by the Pokémon.

to_dict() ⚓︎

Convert the model to a dict

Returns:

Type Description
Dict[str, Any]

The model as a dict.

Source code in pokelance/models/_base.py
Python
def to_dict(self) -> t.Dict[str, t.Any]:
    """Convert the model to a dict

    Returns
    -------
    t.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(
        self, filter=attrs.filters.exclude(attrs.fields(BaseModel).raw), value_serializer=_serializer
    )

ItemPrice ⚓︎

Bases: BaseModel

An item price resource.

Attributes:

Name Type Description
currency NamedResource

The currency used for this price.

purchase_price Optional[int]

The purchase price of this item in this version group. Null if the item cannot be purchased.

sell_price Optional[int]

The sell price of this item in this version group. Null if the item cannot be sold.

version_group NamedResource

The version group these prices apply to.

to_dict() ⚓︎

Convert the model to a dict

Returns:

Type Description
Dict[str, Any]

The model as a dict.

Source code in pokelance/models/_base.py
Python
def to_dict(self) -> t.Dict[str, t.Any]:
    """Convert the model to a dict

    Returns
    -------
    t.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(
        self, filter=attrs.filters.exclude(attrs.fields(BaseModel).raw), value_serializer=_serializer
    )

ItemSprites ⚓︎

Bases: BaseModel

An item sprites resource.

Attributes:

Name Type Description
default Optional[str]

The default depiction of this item.

to_dict() ⚓︎

Convert the model to a dict

Returns:

Type Description
Dict[str, Any]

The model as a dict.

Source code in pokelance/models/_base.py
Python
def to_dict(self) -> t.Dict[str, t.Any]:
    """Convert the model to a dict

    Returns
    -------
    t.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(
        self, filter=attrs.filters.exclude(attrs.fields(BaseModel).raw), value_serializer=_serializer
    )

Comments