diff --git a/cuenca/__init__.py b/cuenca/__init__.py index fa506d51..32551ede 100644 --- a/cuenca/__init__.py +++ b/cuenca/__init__.py @@ -42,6 +42,8 @@ 'configure', 'get_balance', 'JwtToken', + 'TermsOfService', + 'UserTOSAgreement', ] from . import http @@ -76,12 +78,14 @@ ServiceProvider, Session, Statement, + TermsOfService, Transfer, User, UserCredential, UserEvent, UserListsValidation, UserLogin, + UserTOSAgreement, Verification, WalletTransaction, Webhook, diff --git a/cuenca/resources/__init__.py b/cuenca/resources/__init__.py index e74f07f9..9a0191ea 100644 --- a/cuenca/resources/__init__.py +++ b/cuenca/resources/__init__.py @@ -38,6 +38,8 @@ 'Webhook', 'WhatsappTransfer', 'JwtToken', + 'TermsOfService', + 'UserTOSAgreement', ] from .accounts import Account @@ -71,12 +73,14 @@ from .service_providers import ServiceProvider from .sessions import Session from .statements import Statement +from .terms_of_service import TermsOfService from .transfers import Transfer from .user_credentials import UserCredential from .user_events import UserEvent from .user_lists_validation import UserListsValidation from .user_logins import UserLogin from .users import User +from .users_tos_agreements import UserTOSAgreement from .verifications import Verification from .wallet_transactions import WalletTransaction from .webhooks import Webhook @@ -123,6 +127,8 @@ Webhook, Platform, JwtToken, + TermsOfService, + UserTOSAgreement, ] for resource_cls in resource_classes: RESOURCES[resource_cls._resource] = resource_cls # type: ignore diff --git a/cuenca/resources/terms_of_service.py b/cuenca/resources/terms_of_service.py new file mode 100644 index 00000000..c73bc696 --- /dev/null +++ b/cuenca/resources/terms_of_service.py @@ -0,0 +1,18 @@ +import datetime as dt +from typing import ClassVar + +from cuenca_validations.types import TermsOfService as TermsOfServiceEnum +from cuenca_validations.types.general import SerializableHttpUrl + +from .base import Queryable, Retrievable + + +class TermsOfService(Retrievable, Queryable): + _resource: ClassVar = 'terms_of_service' + + id: str + is_active: bool + created_at: dt.datetime + type: TermsOfServiceEnum + version: str + uri: SerializableHttpUrl diff --git a/cuenca/resources/users_tos_agreements.py b/cuenca/resources/users_tos_agreements.py new file mode 100644 index 00000000..05ea588a --- /dev/null +++ b/cuenca/resources/users_tos_agreements.py @@ -0,0 +1,21 @@ +import datetime as dt +from typing import ClassVar + +from cuenca_validations.types.general import SerializableHttpUrl + +from .base import Creatable, Queryable, Retrievable + + +class UserTOSAgreement(Creatable, Retrievable, Queryable): + _resource: ClassVar = 'users_tos_agreements' + + id: str + created_at: dt.datetime + updated_at: dt.datetime + terms_of_service: str + user_id: str + ip: str + location: str + digital_signature: str + signed_document_url: SerializableHttpUrl + notification_id: str diff --git a/cuenca/version.py b/cuenca/version.py index 679045d5..0888f04c 100644 --- a/cuenca/version.py +++ b/cuenca/version.py @@ -1,3 +1,3 @@ -__version__ = '2.1.3' +__version__ = '2.1.4' CLIENT_VERSION = __version__ API_VERSION = '2020-03-19'