edutap.wallet_google.registry.register_model#
- class edutap.wallet_google.registry.register_model(name: str, url_part: str, *, plural: str | None = None, resource_id: str = 'id', can_create: bool = True, can_read: bool = True, can_update: bool = True, can_disable: bool = True, can_list: bool = True, can_message: bool = True)#
Registers a Pydantic model based on GoogleWalletModel in a registry. To be used as a decorator.
- __init__(name: str, url_part: str, *, plural: str | None = None, resource_id: str = 'id', can_create: bool = True, can_read: bool = True, can_update: bool = True, can_disable: bool = True, can_list: bool = True, can_message: bool = True)#
Prepares the registration of a GoogleWalletModel or its subclasses.
- Parameters:
name – Name of the model. Usually the same as the class name.
url_part – Part of the URL to be used for the RESTful API endpoint.
plural – Lowercase plural of the name. Defaults to url_part + ‘s’.
resource_id – key name to fetch resource_id from. Defaults to ‘id’.
can_create – Whether it is possible to use in the ‘create’ API function. Defaults to True.
can_read – Whether it is possible to use in the ‘read’ API function. Defaults to True.
can_update – Whether it is possible to use in the ‘update’ API function. Defaults to True.
can_disable – Whether it is possible to use in the ‘disable’ API function. Defaults to True.
can_list – Whether it is possible to use in the ‘list’ API function. Defaults to True.
can_message – Whether it is possible to use in the ‘message’ API function. Defaults to True.
Methods
__init__
(name, url_part, *[, plural, ...])Prepares the registration of a GoogleWalletModel or its subclasses.