psnawp_api.models.game_entitlements module#
Provides endpoint to fetch the info from Game Entitlements info for client.
- class EntitlementAttribute[source]#
Bases:
TypedDictRepresents an entitlement attribute for a game entitlement.
- class GameEntitlement[source]#
Bases:
TypedDictRepresents a single game entitlement entry.
- conceptMeta: ConceptMeta#
- entitlementAttributes: list[EntitlementAttribute]#
- isBeta: NotRequired[bool]#
- isGame: NotRequired[bool]#
- rewardMeta: RewardMeta#
- serviceType: NotRequired[int]#
- class GameEntitlementsIterator(authenticator: Authenticator, url: str, pagination_args: PaginationArguments, title_ids: str)[source]#
Bases:
PaginationIterator[GameEntitlement]An iterator for retrieving the authenticated user’s game entitlements (owned games) from the PlayStation Network.
Note
This class retrieves only PS4 and PS5 game entitlements, as the underlying API endpoints accessed via the PlayStation Android app are limited to these platforms.
- Variables:
authenticator (Authenticator) – An instance of
Authenticatorused to authenticate and make HTTPS requests.title_ids (str) – Comma-separated string of title IDs to filter and check if the client owns any of the specified titles.
Init for GameEntitlementsIterator.
- __init__(authenticator: Authenticator, url: str, pagination_args: PaginationArguments, title_ids: str) None[source]#
Init for GameEntitlementsIterator.
- fetch_next_page() Generator[GameEntitlement, None, None][source]#
Fetches the next page of Entitlements objects from the API.
- Yield:
A generator yielding Entitlements objects.
- classmethod from_endpoint(authenticator: Authenticator, pagination_args: PaginationArguments, title_ids: str) Self[source]#
Creates an instance of GameEntitlementsIterator from the given endpoint.
- Parameters:
authenticator – The Authenticator instance used for making authenticated requests to the API.
pagination_args – Arguments for handling pagination, including limit, offset, and page size.
title_ids – Comma-separated string of title IDs to filter and check if the client owns any of the specified titles.
- Returns:
An instance of GameEntitlementsIterator.