codingame_tools.client.common.protocol.featured_event¶
featured_event
¶
JSON-serializable dataclasses for the FeaturedEvent service's findUpcomingAndOngoingFeaturedEvents, findClashSlots, and findByHandle Codingame API methods.
CgClashMode
module-attribute
¶
CgClashMode = str
A Clash of Code game mode, e.g. "FASTEST", "SHORTEST", "REVERSE".
CgSolutionLanguage
module-attribute
¶
CgSolutionLanguage = str
The programming language used for the reference solution, e.g. "Python3", "Java", "C++", etc.
Code submitted/played (TestSession/play, TestSession/submit, contribution
updateContribution/createContribution) runs server-side in a sandbox with a specific
version and, for some languages, specific bundled libraries--relevant to know when writing a
solution that assumes a particular language feature or library is available. Confirmed:
- Python3: 3.11.5, with NumPy, pandas, and SciPy available.
Other languages' exact versions/bundled libraries aren't catalogued here yet--see https://www.codingame.com/playgrounds/40701/help-center/languages-versions (a client-rendered page; fetching it programmatically only returns the loading shell, not the real content, so this couldn't be filled in automatically--add entries here as they're confirmed for other languages actually in use).
File-extension mapping for a CgSolutionLanguage lives in codingame_tools.language
(get_language(cg_id).extension / get_language_by_extension(ext)), not here--this module is
wire-protocol schema only.
CgFeaturedEventType
module-attribute
¶
CgFeaturedEventType = str
The kind of featured event, e.g. "CLASH_OF_CODE", "PUZZLE".
CgFeaturedEvent
dataclass
¶
CgFeaturedEvent(id, handle, draft, participant_count, event_type=Alias('type'), _publish_time=Alias('publishTime'), _start_time=Alias('startTime'), _end_time=Alias('endTime'), extra_data=dict(), registered=None, _review_date=Alias('reviewDate', default=None))
Bases: JSONWizardX
A scheduled/ongoing site-wide featured event, as returned by findUpcomingAndOngoingFeaturedEvents and findByHandle.
handle
instance-attribute
¶
handle
Opaque handle for the event. For a event_type == "CLASH_OF_CODE" event, this was NOT
accepted by ClashOfCode/findClashByHandle (rejected with a 422)--it appears to be a
FeaturedEvent-specific handle, not the handle of a joinable clash instance.
participant_count
instance-attribute
¶
participant_count
Number of codingamers registered/participating.
event_type
class-attribute
instance-attribute
¶
event_type = Alias('type')
The kind of event; see CgFeaturedEventType.
registered
class-attribute
instance-attribute
¶
registered = None
Whether the requesting codingamer is registered for this event. Only present when the event was looked up in a codingamer-specific context (e.g. findUpcomingAndOngoingFeaturedEvents); absent from findByHandle, which has no codingamer context to compute this against.
publish_time
property
writable
¶
publish_time
See the field docstring for _publish_time. Always UTC.
review_date
property
writable
¶
review_date
See the field docstring for _review_date. Always UTC. None if not applicable.
CgClashSlot
dataclass
¶
CgClashSlot(clash_handle, clash_mode, id, programming_languages, subscribed_to_notifications, _end_time=Alias('endTime'), _joinable_time=Alias('joinableTime'), _start_time=Alias('startTime'), extra_data=dict())
Bases: JSONWizardX
A single scheduled Clash of Code slot belonging to a featured event, as returned (in a
bare JSON array) by findClashSlots. clash_handle (distinct from the parent
CgFeaturedEvent.handle/CgFeaturedEvent.id) can be passed to
ClashOfCode/findClashByHandle to fetch full details/results for this specific clash.
clash_handle
instance-attribute
¶
clash_handle
Opaque handle for this specific clash instance--see class docstring.
programming_languages
instance-attribute
¶
programming_languages
Programming languages available for this clash slot.
subscribed_to_notifications
instance-attribute
¶
subscribed_to_notifications
Whether the requesting codingamer has subscribed to notifications for this slot.
joinable_time
property
writable
¶
joinable_time
See the field docstring for _joinable_time. Always UTC.