Skip to content

codingame_tools.client.service.services.programming_language

programming_language

Async ProgrammingLanguage service endpoint.

CgProgrammingLanguageServiceHelper

CgProgrammingLanguageServiceHelper(service)

Bases: CgServiceHelper['CgProgrammingLanguageService']

Helper methods for CgProgrammingLanguageService. Currently empty.

Source code in codingame_tools/client/service/cg_service.py
124
125
def __init__(self, service: TService) -> None:
    self.service = service

CgProgrammingLanguageService

CgProgrammingLanguageService(client)

Bases: CgService

Async ProgrammingLanguage service endpoint.

Source code in codingame_tools/client/service/services/programming_language.py
23
24
25
def __init__(self, client: CgClient) -> None:
    super().__init__(client, "ProgrammingLanguage")
    self.helper = CgProgrammingLanguageServiceHelper(self)

find_all_ids async

find_all_ids()

Find the IDs of all programming languages supported for contribution reference solutions.

Returns:

  • list[CgSolutionLanguage]

    A list of CgSolutionLanguage strings, e.g. "Python3", "Java", "C++".

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 list.

Source code in codingame_tools/client/service/services/programming_language.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
async def find_all_ids(self) -> list[CgSolutionLanguage]:
    """Find the IDs of all programming languages supported for contribution reference solutions.

    Returns:
        A list of `CgSolutionLanguage` strings, e.g. "Python3", "Java", "C++".

    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 list.
    """
    raw_ids = await self.service_request_to_list("findAllIds", [])
    return cast(list[CgSolutionLanguage], raw_ids)