Module genshin.models.model

Modified pydantic model.

Functions

def Aliased(alias: typing.Optional[str] = None, default: typing.Any = None, **kwargs: typing.Any) ‑> Any

Create an aliased field.

Classes

class APIModel (**data: Any)

Modified pydantic model.

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.

Expand source code
class APIModel(pydantic.BaseModel):
    """Modified pydantic model."""

    model_config: pydantic.ConfigDict = pydantic.ConfigDict(arbitrary_types_allowed=True)  # type: ignore

Ancestors

  • pydantic.main.BaseModel

Subclasses

Class variables

var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
class Unique

A hashable model with an id.

Expand source code
class Unique(abc.ABC):
    """A hashable model with an id."""

    id: int

    def __int__(self) -> int:
        return hash(self.id)

    def __hash__(self) -> int:
        return hash(self.id)

Ancestors

  • abc.ABC

Subclasses

Class variables

var id : int