Skip to content

Commit b31f85e

Browse files
committed
examples auth
1 parent 10b9865 commit b31f85e

File tree

6 files changed

+40
-2
lines changed

6 files changed

+40
-2
lines changed

cuenca/resources/api_keys.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ class ApiKey(Creatable, Queryable, Retrievable, Updateable):
1515
deactivated_at: Optional[dt.datetime]
1616
user_id: Optional[str]
1717

18+
class Config:
19+
schema_extra = {
20+
"example": {
21+
"id": "AK-123",
22+
"updated_at": "2021-08-24T14:15:22Z",
23+
"created_at": "2021-08-24T14:15:22Z",
24+
"secret": "super-secret-random-string",
25+
"deactivated_at": None,
26+
"user_id": "US-123",
27+
}
28+
}
29+
1830
@property
1931
def active(self) -> bool:
2032
return (

cuenca/resources/login_tokens.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
class LoginToken(Creatable):
88
_resource: ClassVar = 'login_tokens'
99

10+
class Config:
11+
schema_extra = {"example": {"id": "LT-123"}}
12+
1013
@classmethod
1114
def create(cls, session: Session = global_session) -> 'LoginToken':
1215
"""

cuenca/resources/sessions.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ class Session(Creatable, Retrievable, Queryable):
2020
failure_url: Optional[AnyUrl]
2121
type: Optional[SessionType]
2222

23+
class Config:
24+
schema_extra = {
25+
"example": {
26+
"id": "SE-123",
27+
"created_at": "2022-08-24T14:15:22Z",
28+
"user_id": "US-123",
29+
"platform_id": "PT-123",
30+
"expires_at": "2022-08-24T14:30:22Z",
31+
"success_url": "http://example_success.com",
32+
"failure_url": "http://example_failure.com",
33+
"type": "session.registration",
34+
}
35+
}
36+
2337
@classmethod
2438
def create(
2539
cls,

cuenca/resources/user_logins.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ class UserLogin(Creatable):
1313
last_login_at: Optional[dt.datetime]
1414
success: bool
1515

16+
class Config:
17+
schema_extra = {
18+
"example": {
19+
"id": "UL-123",
20+
"last_login_at": "2022-01-01T14:15:22Z",
21+
"success": True,
22+
}
23+
}
24+
1625
@classmethod
1726
def create(
1827
cls, password: str, *, session: Session = global_session

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.dev2'
1+
__version__ = '0.10.0.dev3'
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.dev2
2+
cuenca-validations==0.10.7.dev3
33
dataclasses>=0.7;python_version<"3.7"

0 commit comments

Comments
 (0)