codingame_tools.client.service.services.survey¶
survey
¶
Async Survey service endpoint.
CgSurveyServiceHelper
¶
CgSurveyServiceHelper(service)
Bases: CgServiceHelper['CgSurveyService']
Helper methods for CgSurveyService. Currently empty.
Source code in codingame_tools/client/service/cg_service.py
124 125 | |
CgSurveyService
¶
CgSurveyService(client)
Bases: CgService
Async Survey service endpoint.
Source code in codingame_tools/client/service/services/survey.py
24 25 26 | |
find_survey
async
¶
find_survey(codingamer_id=None, limit=2)
Find a survey to potentially show a codingamer.
UNVERIFIED: every account tested (including a couple of different real accounts)
returned a bare null, so the real response shape (CgSurvey) is an empty
placeholder pending a real example. limit's purpose is unconfirmed too--assumed
(per the observed default value of 2) to cap the number of surveys returned, but this
couldn't be verified empirically since no non-null response was ever observed.
Uses service_request (untyped JsonData) rather than service_request_to_dict,
since the latter would reject the (apparently common) null response as an error.
Parameters:
-
codingamer_id(int | None, default:None) –The codingamer to find a survey for. If not provided, defaults to the logged-in codingamer's ID.
-
limit(int, default:2) –Assumed maximum number of results; unconfirmed. Defaults to 2 (the only value observed in practice).
Returns:
-
CgSurvey | None–A CgSurvey object, or None if no survey is currently applicable.
Raises:
-
CgAuthenticationError–If the session is not authenticated and cannot implicitly login, or if
codingamer_idis not provided and no codingamer ID can be resolved from the session's credentials. -
CgClientHttpError–If a transport error occurs, if the response content could not be decoded at all, if the status code is not 2xx, or if the decoded content is neither a dict nor null.
Source code in codingame_tools/client/service/services/survey.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |