A model response from ravyapi.api.endpoints.guilds.Guilds.get_guild
.
Attributes
data: dict[str, Any]
The raw data returned from the Ravy API.
trust: Trust
The guild's ravyapi.api.models.generic.trust.Trust
trust model.
bans: list[BanEntryResponse]
A list of the guild's ravyapi.api.models.generic.ban_entry.BanEntryResponse
ban models.
Source code in ravyapi/api/models/guilds.py
| class GetGuildResponse:
"""A model response from `ravyapi.api.endpoints.guilds.Guilds.get_guild`.
Attributes
----------
data: dict[str, Any]
The raw data returned from the Ravy API.
trust: Trust
The guild's `ravyapi.api.models.generic.trust.Trust` trust model.
bans: list[BanEntryResponse]
A list of the guild's `ravyapi.api.models.generic.ban_entry.BanEntryResponse` ban models.
"""
__slots__: tuple[str, ...] = ("_data", "_trust", "_bans")
def __init__(self, data: dict[str, Any]) -> None:
self._data: dict[str, Any] = data
self._trust: Trust = data["trust"]
self._bans: list[BanEntryResponse] = [
BanEntryResponse(ban) for ban in data["bans"]
]
def __repr__(self) -> str:
return (
f"{self.__class__.__module__}.{self.__class__.__qualname__}"
f"(trust={self.trust!r}, bans={self.bans!r})"
)
@property
def data(self) -> dict[str, Any]:
"""The raw data returned from the Ravy API."""
return self._data
@property
def trust(self) -> Trust:
"""The guild's `ravyapi.api.models.generic.trust.Trust` trust model."""
return self._trust
@property
def bans(self) -> list[BanEntryResponse]:
"""A list of the guilds's `ravyapi.api.models.generic.ban_entry.BanEntryResponse` ban models."""
return self._bans
|
bans: list[BanEntryResponse]
property
A list of the guilds's ravyapi.api.models.generic.ban_entry.BanEntryResponse
ban models.
data: dict[str, Any]
property
The raw data returned from the Ravy API.
trust: Trust
property
The guild's ravyapi.api.models.generic.trust.Trust
trust model.