Source code for psnawp_api.models.trophies.trophy_constants
"""Provides types for the data received by trophy endpoints."""
from __future__ import annotations
from dataclasses import dataclass, field
from enum import Enum
from typing import Literal
[docs]
class TrophyType(Enum):
"""Represents the type of a PlayStation trophy.
Trophies are awarded for in-game achievements and come in four types.
"""
BRONZE = "bronze"
SILVER = "silver"
GOLD = "gold"
PLATINUM = "platinum"
[docs]
class TrophyRarity(Enum):
"""Represents the rarity of a PlayStation trophy.
The rarity of a trophy is determined by how many users have earned it. Lower values indicate rarer trophies.
"""
ULTRA_RARE = 0
VERY_RARE = 1
RARE = 2
COMMON = 3
[docs]
@dataclass(frozen=True)
class TrophySet:
"""Represents a collection of PlayStation trophies.
Used in API requests and responses to indicate the number of trophies of each type a game or player has earned.
"""
bronze: int = field(default=0)
silver: int = field(default=0)
gold: int = field(default=0)
platinum: int = field(default=0)