codingame_tools.client.service.services.clash_of_code¶
clash_of_code
¶
Async ClashOfCode service endpoint.
CgClashOfCodeServiceHelper
¶
CgClashOfCodeServiceHelper(service)
Bases: CgServiceHelper['CgClashOfCodeService']
Helper methods for CgClashOfCodeService. Currently empty.
Source code in codingame_tools/client/service/cg_service.py
124 125 | |
CgClashOfCodeService
¶
CgClashOfCodeService(client)
Bases: CgService
Async ClashOfCode service endpoint.
Source code in codingame_tools/client/service/services/clash_of_code.py
24 25 26 | |
get_clash_rank_by_codingamer_id
async
¶
get_clash_rank_by_codingamer_id(codingamer_id=None)
Get a codingamer's global Clash of Code ranking.
Returns None if the codingamer has never played Clash of Code--the server responds
with a genuine (not an error) JSON null in that case, rather than 404 or an empty
dict. This uses service_request (untyped JsonData) rather than
service_request_to_dict, since the latter would reject a null response as an
error--there would be no way to distinguish "no rank" from an actual failure.
Parameters:
-
codingamer_id(int | None, default:None) –The codingamer's numeric ID. If not provided, defaults to the logged-in codingamer's ID.
Returns:
-
CgClashRank | None–A CgClashRank object, or None if the codingamer has never played Clash of Code.
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/clash_of_code.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 | |
find_clash_by_handle
async
¶
find_clash_by_handle(handle)
Find a Clash of Code session by its handle.
handle must be a clash-instance handle (e.g. a CgClashSlot.clash_handle from
FeaturedEvent/findClashSlots)--confirmed empirically, neither a codingamer's public
handle nor the parent CgFeaturedEvent.handle are accepted here (both rejected with
a 422).
Parameters:
-
handle(str) –The opaque clash-instance handle string.
Returns:
-
CgClash–A CgClash object.
Raises:
-
CgAuthenticationError–If the session is not authenticated and cannot implicitly login.
-
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 not a dict.
Source code in codingame_tools/client/service/services/clash_of_code.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |