Skip to content

Resources

pokelance.models.common.resources ⚓︎

NamedResource ⚓︎

Bases: BaseModel

Model for a named resource object

Attributes:

Name Type Description
name str

The name of the referenced resource.

url str

The URL of the referenced resource.

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
    -------
    typing.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(self)

Resource ⚓︎

Bases: BaseModel

Model for a resource object

Attributes:

Name Type Description
url str

The URL of the referenced resource.

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
    -------
    typing.Dict[str, Any]
        The model as a dict.
    """
    return attrs.asdict(self)