Skip to content

Commit e8a92b7

Browse files
committed
platforms
1 parent 1304600 commit e8a92b7

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed

cuenca/resources/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
'KYCVerification',
2020
'LimitedWallet',
2121
'LoginToken',
22+
'Platform',
2223
'Saving',
2324
'ServiceProvider',
2425
'Session',
@@ -53,6 +54,7 @@
5354
from .kyc_verifications import KYCVerification
5455
from .limited_wallets import LimitedWallet
5556
from .login_tokens import LoginToken
57+
from .platforms import Platform
5658
from .resources import RESOURCES
5759
from .savings import Saving
5860
from .service_providers import ServiceProvider
@@ -103,6 +105,7 @@
103105
WalletTransaction,
104106
WhatsappTransfer,
105107
Webhook,
108+
Platform,
106109
]
107110
for resource_cls in resource_classes:
108111
RESOURCES[resource_cls._resource] = resource_cls # type: ignore

cuenca/resources/platforms.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import datetime as dt
2+
from typing import ClassVar, cast
3+
4+
from pydantic import BaseModel
5+
6+
from ..http import Session, session as global_session
7+
from .base import Creatable
8+
from cuenca_validations.types import PlatformRequest
9+
10+
11+
class Platform(Creatable):
12+
_resource: ClassVar = 'platforms'
13+
14+
created_at: dt.datetime
15+
name: str
16+
17+
class Config:
18+
fields = {
19+
'name': {'description': 'name of the platform being created'}
20+
}
21+
schema_extra = {
22+
'example': {
23+
'id': 'PT0123456789',
24+
'name': 'Arteria',
25+
'created_at': '2021-08-24T14:15:22Z',
26+
}
27+
}
28+
29+
@classmethod
30+
def create(cls, name, *, session: Session = global_session):
31+
req = PlatformRequest(name=name)
32+
return cast('Platform', cls._create(session=session, **req))

cuenca/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '0.10.0'
1+
__version__ = '0.10.1.dev0'
22
CLIENT_VERSION = __version__
33
API_VERSION = '2020-03-19'

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
requests==2.27.1
2-
cuenca-validations==0.10.7
2+
cuenca-validations==0.10.8.dev2
33
dataclasses>=0.7;python_version<"3.7"

0 commit comments

Comments
 (0)