models ====== .. py:module:: wow.models .. autoapi-nested-parse:: Typed models for Battle.net documents. Models skip fields they do not declare, so new fields from Blizzard never break parsing. .. toctree:: :hidden: /reference/_generated/python/wow/models/account/index /reference/_generated/python/wow/models/achievement/index /reference/_generated/python/wow/models/auction/index /reference/_generated/python/wow/models/character/index /reference/_generated/python/wow/models/creature/index /reference/_generated/python/wow/models/guild/index /reference/_generated/python/wow/models/guild_crest/index /reference/_generated/python/wow/models/item/index /reference/_generated/python/wow/models/item_appearance/index /reference/_generated/python/wow/models/media/index /reference/_generated/python/wow/models/mount/index /reference/_generated/python/wow/models/pet/index /reference/_generated/python/wow/models/playable_class/index /reference/_generated/python/wow/models/playable_race/index /reference/_generated/python/wow/models/playable_specialization/index /reference/_generated/python/wow/models/power_type/index /reference/_generated/python/wow/models/profession/index /reference/_generated/python/wow/models/quest/index /reference/_generated/python/wow/models/realm/index /reference/_generated/python/wow/models/recipe/index /reference/_generated/python/wow/models/region/index /reference/_generated/python/wow/models/reputation/index /reference/_generated/python/wow/models/ruleset/index /reference/_generated/python/wow/models/spell/index /reference/_generated/python/wow/models/talent/index /reference/_generated/python/wow/models/title/index /reference/_generated/python/wow/models/toy/index - :doc:`account `: Models for the Account Profile API. - :doc:`achievement `: Models for the Achievement API. - :doc:`auction `: Models for the Auction House API. - :doc:`character `: Models for the Character Profile API. - :doc:`creature `: Models for the Creature, Creature Family and Creature Type APIs. - :doc:`guild `: Models for the Guild API. - :doc:`guild_crest `: Models for the Guild Crest API. - :doc:`item `: Models for the Item, Item Class and Item Set APIs. - :doc:`item_appearance `: Models for the Item Appearance API. - :doc:`media `: Models for the Media Search API. - :doc:`mount `: Models for the Mount API. - :doc:`pet `: Models for the Pet API. - :doc:`playable_class `: Models for the Playable Class API. - :doc:`playable_race `: Models for the Playable Race API. - :doc:`playable_specialization `: Models for the Playable Specialization API. - :doc:`power_type `: Models for the Power Type API. - :doc:`profession `: Models for the Profession API. - :doc:`quest `: Models for the Quest API. - :doc:`realm `: Models for the Realm API. - :doc:`recipe `: Models for the Recipe API. - :doc:`region `: Models for the Region API. - :doc:`reputation `: Models for the Reputation API. - :doc:`ruleset `: Models for the Ruleset API. - :doc:`spell `: Models for the Spell API. - :doc:`talent `: Models for the Talent and Talent Tree APIs. - :doc:`title `: Models for the Title API. - :doc:`toy `: Models for the Toy API. .. py:class:: Document Bases: :py:obj:`Model` A top-level API document. .. py:attribute:: links :type: Links .. py:class:: GenderedName Bases: :py:obj:`Model` A name with a male and a female form. .. py:attribute:: male :type: str .. py:attribute:: female :type: str .. py:class:: IdName Bases: :py:obj:`Model` An id and a localized name. .. py:attribute:: id :type: int .. py:attribute:: name :type: str .. py:class:: IdRef Bases: :py:obj:`Model` A reference that carries no name, such as a media or appearance link. .. py:attribute:: id :type: int .. py:attribute:: key :type: Link .. py:class:: Link Bases: :py:obj:`Model` A link to another API document. .. py:attribute:: href :type: str .. py:class:: Links Bases: :py:obj:`Model` The ``_links`` block every document carries. .. py:attribute:: self_ :type: Link .. py:type:: LocalizedString :canonical: dict[str, str] Text in every locale, keyed like ``{"en_US": "Sword", "de_DE": "Schwert"}``. Search results always come back this way, whatever ``locale`` the client uses. .. py:class:: Media Bases: :py:obj:`Document` A media document: the rendered assets for one item, class, or other entity. .. py:attribute:: id :type: int .. py:attribute:: assets :type: tuple[MediaAsset, ...] .. py:class:: MediaAsset Bases: :py:obj:`Model` One rendered asset. :ivar key: The asset kind, such as ``icon``. :ivar value: Its URL on ``render.worldofwarcraft.com``. Forever assets live under ``/forever-{region}/``. :ivar file_data_id: The game client's file id. Guild crest media has none. .. py:attribute:: key :type: str .. py:attribute:: value :type: str .. py:attribute:: file_data_id :type: int | None :value: None .. py:class:: Model Bases: :py:obj:`msgspec.Struct` Base for every response model. Models are immutable. Fields they do not declare are skipped, so a field Blizzard adds tomorrow is never fatal; read it from the raw document with :meth:`wow.Client.get` until a release models it. .. py:class:: NamedLink Bases: :py:obj:`Model` A reference that carries no id, such as a talent tree link. .. py:attribute:: key :type: Link .. py:attribute:: name :type: str .. py:class:: Ref Bases: :py:obj:`IdName` A reference to another document: its id, name and link, as in every index. .. py:attribute:: key :type: Link .. py:class:: SearchPage[DataT: Model] Bases: :py:obj:`Model` One page of search results. Battle.net stops at 1,000 results per query however many pages that spans, and sets ``result_count_capped`` when it cut the results short. .. py:attribute:: page :type: int .. py:attribute:: page_size :type: int .. py:attribute:: max_page_size :type: int .. py:attribute:: page_count :type: int .. py:attribute:: results :type: tuple[SearchResult[DataT], ...] .. py:attribute:: result_count_capped :type: bool .. py:class:: SearchResult[DataT: Model] Bases: :py:obj:`Model` One search hit: the link to the full document plus its indexed, all-locale data. .. py:attribute:: key :type: Link .. py:attribute:: data :type: DataT .. py:class:: TypedName Bases: :py:obj:`Model` A constant plus its localized label, such as ``{"type": "HORDE", "name": "Horde"}``. ``type`` is kept as a plain string so values Blizzard adds later still validate. .. py:attribute:: type :type: str .. py:attribute:: name :type: str