""" Module for collection of dataclasses that map Szurubooru objects to python classes """ from dataclasses import dataclass, field from typing import List @dataclass class Tag: """A single tag. Tags are used to let users search for posts. The Szurubooru structure: .. code-block:: JSON { "version": , "names": , "category": , "implications": , "suggestions": , "creationTime": , "lastEditTime": , "usages": , "description": } **Field meaning** - ``: resource version. - ``: a list of tag names (aliases). Tagging a post with any name will automatically assign the first name from this list. - ``: the name of the category the given tag belongs to. - ``: a list of implied tags, serialized as micro tag resource. - ``: a list of suggested tags, serialized as micro tag resource. - ``: time the tag was created, formatted as per RFC 3339. - ``: time the tag was edited, formatted as per RFC 3339. - ``: the number of posts the tag was used in. - ``: the tag description (instructions how to use, history etc.) """ name: str version: int = -1 description: str = "" category: str = "General" implications: List[str] = field(default_factory=list) suggestions: List[str] = field(default_factory=list)