Skip to content

Commit

Permalink
questionnare first version
Browse files Browse the repository at this point in the history
  • Loading branch information
alexviquez committed Dec 27, 2023
1 parent 2447f60 commit 7975a15
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
40 changes: 40 additions & 0 deletions cuenca/resources/questionnaires.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import datetime as dt
from typing import ClassVar, cast

from cuenca_validations.types import QuestionnaireRequest

from ..http import Session, session as global_session
from .base import Creatable, Retrievable


class Questionnaires(Creatable, Retrievable):
_resource: ClassVar = 'questionnaires'

created_at: dt.datetime

class Config:
schema_extra = {
'example': {
'user_id': 'US234i23jh23h4h23',
'token': '3223j23ij23ij3',
'alert_id': 'ALewifjwiejf',
}
}

@classmethod
def create(
cls,
user_id: str,
token: str,
alert_id: str,
*,
session: Session = global_session,
) -> 'Questionnaires':
req = QuestionnaireRequest(
user_id=user_id,
token=token,
alert_id=alert_id,
)
return cast(
'Questionnaires', cls._create(session=session, **req.dict())
)
2 changes: 1 addition & 1 deletion cuenca/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '0.15.9'
__version__ = '0.15.11.dev0'
CLIENT_VERSION = __version__
API_VERSION = '2020-03-19'
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
requests==2.27.1
cuenca-validations==0.11.19
cuenca-validations==0.11.23.dev0
dataclasses>=0.7;python_version<"3.7"

0 comments on commit 7975a15

Please sign in to comment.