From 48fe9f42c73a5a08fe3e3a261c7bbd59b110a83a Mon Sep 17 00:00:00 2001 From: omegaup-bot Date: Sun, 17 Mar 2024 18:53:58 +0000 Subject: [PATCH] omegaUp API change for "Plagiarism detector test temporarily disabled. (#7484)" API changes from https://github.com/omegaup/omegaup/commit/d709a419ca1ccfdd0a058fede4a7a65d69cde5da --- omegaup/api.py | 492 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 435 insertions(+), 57 deletions(-) diff --git a/omegaup/api.py b/omegaup/api.py index 1ac782e..c3608ae 100644 --- a/omegaup/api.py +++ b/omegaup/api.py @@ -1475,6 +1475,72 @@ def __init__( self.uuid = uuid +@dataclasses.dataclass +class _CertificateListItem: + """_CertificateListItem""" + certificate_type: str + date: datetime.datetime + name: Optional[str] + verification_code: str + + def __init__( + self, + *, + certificate_type: str, + date: int, + verification_code: str, + name: Optional[str] = None, + # Ignore any unknown arguments + **_kwargs: Any, + ): + self.certificate_type = certificate_type + self.date = datetime.datetime.fromtimestamp(date) + if name is not None: + self.name = name + else: + self.name = None + self.verification_code = verification_code + + +@dataclasses.dataclass +class _CertificateListMinePayload: + """_CertificateListMinePayload""" + certificates: Sequence['_CertificateListItem'] + + def __init__( + self, + *, + certificates: Sequence[Dict[str, Any]], + # Ignore any unknown arguments + **_kwargs: Any, + ): + self.certificates = [_CertificateListItem(**v) for v in certificates] + + +@dataclasses.dataclass +class _CertificateValidationPayload: + """_CertificateValidationPayload""" + certificate: Optional[str] + valid: bool + verification_code: str + + def __init__( + self, + *, + valid: bool, + verification_code: str, + certificate: Optional[str] = None, + # Ignore any unknown arguments + **_kwargs: Any, + ): + if certificate is not None: + self.certificate = certificate + else: + self.certificate = None + self.valid = valid + self.verification_code = verification_code + + @dataclasses.dataclass class _Clarification: """_Clarification""" @@ -1872,6 +1938,7 @@ class _CommonPayload: userClassname: str userCountry: str userTypes: Sequence[str] + userVerificationDeadline: Optional[datetime.datetime] def __init__( self, @@ -1897,6 +1964,7 @@ def __init__( userTypes: Sequence[str], currentName: Optional[str] = None, nextRegisteredContestForUser: Optional[Dict[str, Any]] = None, + userVerificationDeadline: Optional[int] = None, # Ignore any unknown arguments **_kwargs: Any, ): @@ -1930,6 +1998,11 @@ def __init__( self.userClassname = userClassname self.userCountry = userCountry self.userTypes = [v for v in userTypes] + if userVerificationDeadline is not None: + self.userVerificationDeadline = datetime.datetime.fromtimestamp( + userVerificationDeadline) + else: + self.userVerificationDeadline = None @dataclasses.dataclass @@ -2267,6 +2340,30 @@ def __init__( self.window_length = None +@dataclasses.dataclass +class _ContestCertificatesAdminDetails: + """_ContestCertificatesAdminDetails""" + certificateCutoff: Optional[int] + certificatesStatus: str + isCertificateGenerator: bool + + def __init__( + self, + *, + certificatesStatus: str, + isCertificateGenerator: bool, + certificateCutoff: Optional[int] = None, + # Ignore any unknown arguments + **_kwargs: Any, + ): + if certificateCutoff is not None: + self.certificateCutoff = certificateCutoff + else: + self.certificateCutoff = None + self.certificatesStatus = certificatesStatus + self.isCertificateGenerator = isCertificateGenerator + + @dataclasses.dataclass class _ContestDetails: """_ContestDetails""" @@ -2512,6 +2609,7 @@ def __init__( class _ContestEditPayload: """_ContestEditPayload""" admins: Sequence['_ContestAdmin'] + certificatesDetails: '_ContestCertificatesAdminDetails' details: '_ContestAdminDetails' group_admins: Sequence['_ContestGroupAdmin'] groups: Sequence['_ContestGroup'] @@ -2525,6 +2623,7 @@ def __init__( self, *, admins: Sequence[Dict[str, Any]], + certificatesDetails: Dict[str, Any], details: Dict[str, Any], group_admins: Sequence[Dict[str, Any]], groups: Sequence[Dict[str, Any]], @@ -2537,6 +2636,8 @@ def __init__( **_kwargs: Any, ): self.admins = [_ContestAdmin(**v) for v in admins] + self.certificatesDetails = _ContestCertificatesAdminDetails( + **certificatesDetails) self.details = _ContestAdminDetails(**details) self.group_admins = [_ContestGroupAdmin(**v) for v in group_admins] self.groups = [_ContestGroup(**v) for v in groups] @@ -2599,6 +2700,7 @@ class _ContestIntroPayload: needsBasicInformation: bool privacyStatement: '_PrivacyStatement' requestsUserInformation: str + shouldShowModalToLoginWithRegisteredIdentity: bool def __init__( self, @@ -2607,6 +2709,7 @@ def __init__( needsBasicInformation: bool, privacyStatement: Dict[str, Any], requestsUserInformation: str, + shouldShowModalToLoginWithRegisteredIdentity: bool, # Ignore any unknown arguments **_kwargs: Any, ): @@ -2614,6 +2717,7 @@ def __init__( self.needsBasicInformation = needsBasicInformation self.privacyStatement = _PrivacyStatement(**privacyStatement) self.requestsUserInformation = requestsUserInformation + self.shouldShowModalToLoginWithRegisteredIdentity = shouldShowModalToLoginWithRegisteredIdentity @dataclasses.dataclass @@ -6235,16 +6339,34 @@ def __init__( @dataclasses.dataclass class _OmegaUp_Controllers_Certificate__apiGetCertificatePdf: """_OmegaUp_Controllers_Certificate__apiGetCertificatePdf""" - certificate: str + certificate: Optional[str] + + def __init__( + self, + *, + certificate: Optional[str] = None, + # Ignore any unknown arguments + **_kwargs: Any, + ): + if certificate is not None: + self.certificate = certificate + else: + self.certificate = None + + +@dataclasses.dataclass +class _OmegaUp_Controllers_Certificate__apiGetUserCertificates: + """_OmegaUp_Controllers_Certificate__apiGetUserCertificates""" + certificates: Sequence['_CertificateListItem'] def __init__( self, *, - certificate: str, + certificates: Sequence[Dict[str, Any]], # Ignore any unknown arguments **_kwargs: Any, ): - self.certificate = certificate + self.certificates = [_CertificateListItem(**v) for v in certificates] @dataclasses.dataclass @@ -6313,6 +6435,21 @@ def __init__( self.pagerItems = [_PageItem(**v) for v in pagerItems] +@dataclasses.dataclass +class _OmegaUp_Controllers_Contest__apiAddProblem: + """_OmegaUp_Controllers_Contest__apiAddProblem""" + solutionStatus: str + + def __init__( + self, + *, + solutionStatus: str, + # Ignore any unknown arguments + **_kwargs: Any, + ): + self.solutionStatus = solutionStatus + + @dataclasses.dataclass class _OmegaUp_Controllers_Contest__apiAdminList: """_OmegaUp_Controllers_Contest__apiAdminList""" @@ -6452,6 +6589,21 @@ def __init__( self.alias = alias +@dataclasses.dataclass +class _OmegaUp_Controllers_Contest__apiGetNumberOfContestants: + """_OmegaUp_Controllers_Contest__apiGetNumberOfContestants""" + response: Dict[int, int] + + def __init__( + self, + *, + response: Dict[int, int], + # Ignore any unknown arguments + **_kwargs: Any, + ): + self.response = {k: v for k, v in response.items()} + + @dataclasses.dataclass class _OmegaUp_Controllers_Contest__apiList: """_OmegaUp_Controllers_Contest__apiList""" @@ -6920,6 +7072,21 @@ def __init__( self.pagerItems = [_PageItem(**v) for v in pagerItems] +@dataclasses.dataclass +class _OmegaUp_Controllers_Course__apiAddProblem: + """_OmegaUp_Controllers_Course__apiAddProblem""" + solutionStatus: str + + def __init__( + self, + *, + solutionStatus: str, + # Ignore any unknown arguments + **_kwargs: Any, + ): + self.solutionStatus = solutionStatus + + @dataclasses.dataclass class _OmegaUp_Controllers_Course__apiAdmins: """_OmegaUp_Controllers_Course__apiAdmins""" @@ -8558,6 +8725,42 @@ def __init__( self.submit_delay = submit_delay +@dataclasses.dataclass +class _OmegaUp_Controllers_Run__apiDisqualify: + """_OmegaUp_Controllers_Run__apiDisqualify""" + runs: Sequence['_OmegaUp_Controllers_Run__apiDisqualify_runs_entry'] + + def __init__( + self, + *, + runs: Sequence[Dict[str, Any]], + # Ignore any unknown arguments + **_kwargs: Any, + ): + self.runs = [ + _OmegaUp_Controllers_Run__apiDisqualify_runs_entry(**v) + for v in runs + ] + + +@dataclasses.dataclass +class _OmegaUp_Controllers_Run__apiDisqualify_runs_entry: + """_OmegaUp_Controllers_Run__apiDisqualify_runs_entry""" + guid: str + username: str + + def __init__( + self, + *, + guid: str, + username: str, + # Ignore any unknown arguments + **_kwargs: Any, + ): + self.guid = guid + self.username = username + + @dataclasses.dataclass class _OmegaUp_Controllers_Run__apiList: """_OmegaUp_Controllers_Run__apiList""" @@ -9591,7 +9794,9 @@ class _ProblemDetailsPayload: """_ProblemDetailsPayload""" allRuns: Optional[Sequence['_Run']] allowUserAddTags: Optional[bool] + allowedSolutionsToSee: int clarifications: Optional[Sequence['_Clarification']] + hasVisitedSection: Optional[bool] histogram: '_Histogram' levelTags: Optional[Sequence[str]] nominationStatus: Optional['_NominationStatus'] @@ -9609,6 +9814,7 @@ class _ProblemDetailsPayload: def __init__( self, *, + allowedSolutionsToSee: int, histogram: Dict[str, Any], problem: Dict[str, Any], solvers: Sequence[Dict[str, Any]], @@ -9616,6 +9822,7 @@ def __init__( allRuns: Optional[Sequence[Dict[str, Any]]] = None, allowUserAddTags: Optional[bool] = None, clarifications: Optional[Sequence[Dict[str, Any]]] = None, + hasVisitedSection: Optional[bool] = None, levelTags: Optional[Sequence[str]] = None, nominationStatus: Optional[Dict[str, Any]] = None, problemLevel: Optional[str] = None, @@ -9636,10 +9843,15 @@ def __init__( self.allowUserAddTags = allowUserAddTags else: self.allowUserAddTags = None + self.allowedSolutionsToSee = allowedSolutionsToSee if clarifications is not None: self.clarifications = [_Clarification(**v) for v in clarifications] else: self.clarifications = None + if hasVisitedSection is not None: + self.hasVisitedSection = hasVisitedSection + else: + self.hasVisitedSection = None self.histogram = _Histogram(**histogram) if levelTags is not None: self.levelTags = [v for v in levelTags] @@ -9825,6 +10037,7 @@ class _ProblemFormPayload: emailClarifications: bool extraWallTime: Union[int, str] groupScorePolicy: Optional[str] + hasVisitedSection: Optional[bool] inputLimit: Union[int, str] languages: str levelTags: Sequence[str] @@ -9877,6 +10090,7 @@ def __init__( visibility: int, visibilityStatuses: Dict[str, int], groupScorePolicy: Optional[str] = None, + hasVisitedSection: Optional[bool] = None, message: Optional[str] = None, parameter: Optional[str] = None, selectedTags: Optional[Sequence[Dict[str, Any]]] = None, @@ -9891,6 +10105,10 @@ def __init__( self.groupScorePolicy = groupScorePolicy else: self.groupScorePolicy = None + if hasVisitedSection is not None: + self.hasVisitedSection = hasVisitedSection + else: + self.hasVisitedSection = None self.inputLimit = inputLimit self.languages = languages self.levelTags = [v for v in levelTags] @@ -13865,6 +14083,7 @@ class _UserRankTablePayload: filter: str isIndex: bool isLogged: bool + lastUpdated: Optional[datetime.datetime] length: int page: int pagerItems: Sequence['_PageItem'] @@ -13881,6 +14100,7 @@ def __init__( page: int, pagerItems: Sequence[Dict[str, Any]], ranking: Dict[str, Any], + lastUpdated: Optional[int] = None, # Ignore any unknown arguments **_kwargs: Any, ): @@ -13889,6 +14109,10 @@ def __init__( self.filter = filter self.isIndex = isIndex self.isLogged = isLogged + if lastUpdated is not None: + self.lastUpdated = datetime.datetime.fromtimestamp(lastUpdated) + else: + self.lastUpdated = None self.length = length self.page = page self.pagerItems = [_PageItem(**v) for v in pagerItems] @@ -13934,6 +14158,7 @@ class _UserRank_rank_entry: problems_solved: int ranking: Optional[int] score: float + timestamp: Optional[datetime.datetime] user_id: int username: str @@ -13948,6 +14173,7 @@ def __init__( country_id: Optional[str] = None, name: Optional[str] = None, ranking: Optional[int] = None, + timestamp: Optional[int] = None, # Ignore any unknown arguments **_kwargs: Any, ): @@ -13966,6 +14192,10 @@ def __init__( else: self.ranking = None self.score = score + if timestamp is not None: + self.timestamp = datetime.datetime.fromtimestamp(timestamp) + else: + self.timestamp = None self.user_id = user_id self.username = username @@ -14052,15 +14282,18 @@ def __init__( class _VerificationParentalTokenDetailsPayload: """_VerificationParentalTokenDetailsPayload""" hasParentalVerificationToken: bool + message: str def __init__( self, *, hasParentalVerificationToken: bool, + message: str, # Ignore any unknown arguments **_kwargs: Any, ): self.hasParentalVerificationToken = hasParentalVerificationToken + self.message = message AdminPlatformReportStatsResponse = _OmegaUp_Controllers_Admin__apiPlatformReportStats @@ -14301,6 +14534,9 @@ def badgeDetails( CertificateGetCertificatePdfResponse = _OmegaUp_Controllers_Certificate__apiGetCertificatePdf """The return type of the CertificateGetCertificatePdf API.""" +CertificateGetUserCertificatesResponse = _OmegaUp_Controllers_Certificate__apiGetUserCertificates +"""The return type of the CertificateGetUserCertificates API.""" + CertificateValidateCertificateResponse = _OmegaUp_Controllers_Certificate__apiValidateCertificate """The return type of the CertificateValidateCertificate API.""" @@ -14311,6 +14547,35 @@ class Certificate: def __init__(self, client: 'Client') -> None: self._client = client + def generateContestCertificates( + self, + *, + certificates_cutoff: Optional[int] = None, + contest_alias: Optional[str] = None, + # Out-of-band parameters: + files_: Optional[Mapping[str, BinaryIO]] = None, + check_: bool = True, + timeout_: datetime.timedelta = _DEFAULT_TIMEOUT) -> None: + r"""Generates all the certificates for a contest given its contest alias. + + Args: + certificates_cutoff: + contest_alias: + + Returns: + The API result object. + """ + parameters: Dict[str, str] = {} + if certificates_cutoff is not None: + parameters['certificates_cutoff'] = str(certificates_cutoff) + if contest_alias is not None: + parameters['contest_alias'] = contest_alias + self._client.query('/api/certificate/generateContestCertificates/', + payload=parameters, + files_=files_, + timeout_=timeout_, + check_=check_) + def getCertificatePdf( self, *, @@ -14338,6 +14603,33 @@ def getCertificatePdf( timeout_=timeout_, check_=check_)) + def getUserCertificates( + self, + *, + user_id: Optional[int] = None, + # Out-of-band parameters: + files_: Optional[Mapping[str, BinaryIO]] = None, + check_: bool = True, + timeout_: datetime.timedelta = _DEFAULT_TIMEOUT + ) -> CertificateGetUserCertificatesResponse: + r"""Get all the certificates belonging to a user + + Args: + user_id: + + Returns: + The API result object. + """ + parameters: Dict[str, str] = {} + if user_id is not None: + parameters['user_id'] = str(user_id) + return _OmegaUp_Controllers_Certificate__apiGetUserCertificates( + **self._client.query('/api/certificate/getUserCertificates/', + payload=parameters, + files_=files_, + timeout_=timeout_, + check_=check_)) + def validateCertificate( self, *, @@ -14502,6 +14794,9 @@ def update( ContestListParticipatingResponse = _OmegaUp_Controllers_Contest__apiListParticipating """The return type of the ContestListParticipating API.""" +ContestGetNumberOfContestantsResponse = _OmegaUp_Controllers_Contest__apiGetNumberOfContestants +"""The return type of the ContestGetNumberOfContestants API.""" + ContestPublicDetailsResponse = _ContestPublicDetails """The return type of the ContestPublicDetails API.""" @@ -14523,6 +14818,9 @@ def update( ContestProblemsResponse = _OmegaUp_Controllers_Contest__apiProblems """The return type of the ContestProblems API.""" +ContestAddProblemResponse = _OmegaUp_Controllers_Contest__apiAddProblem +"""The return type of the ContestAddProblem API.""" + ContestRunsDiffResponse = _OmegaUp_Controllers_Contest__apiRunsDiff """The return type of the ContestRunsDiff API.""" @@ -14744,6 +15042,33 @@ def listParticipating( timeout_=timeout_, check_=check_)) + def getNumberOfContestants( + self, + *, + contest_ids: str, + # Out-of-band parameters: + files_: Optional[Mapping[str, BinaryIO]] = None, + check_: bool = True, + timeout_: datetime.timedelta = _DEFAULT_TIMEOUT + ) -> ContestGetNumberOfContestantsResponse: + r""" + + Args: + contest_ids: + + Returns: + The API result object. + """ + parameters: Dict[str, str] = { + 'contest_ids': contest_ids, + } + return _OmegaUp_Controllers_Contest__apiGetNumberOfContestants( + **self._client.query('/api/contest/getNumberOfContestants/', + payload=parameters, + files_=files_, + timeout_=timeout_, + check_=check_)) + def publicDetails( self, *, @@ -15156,17 +15481,18 @@ def problems( check_=check_)) def addProblem( - self, - *, - contest_alias: str, - order_in_contest: int, - points: float, - problem_alias: str, - commit: Optional[str] = None, - # Out-of-band parameters: - files_: Optional[Mapping[str, BinaryIO]] = None, - check_: bool = True, - timeout_: datetime.timedelta = _DEFAULT_TIMEOUT) -> None: + self, + *, + contest_alias: str, + order_in_contest: int, + points: float, + problem_alias: str, + commit: Optional[str] = None, + # Out-of-band parameters: + files_: Optional[Mapping[str, BinaryIO]] = None, + check_: bool = True, + timeout_: datetime.timedelta = _DEFAULT_TIMEOUT + ) -> ContestAddProblemResponse: r"""Adds a problem to a contest Args: @@ -15187,11 +15513,12 @@ def addProblem( } if commit is not None: parameters['commit'] = commit - self._client.query('/api/contest/addProblem/', - payload=parameters, - files_=files_, - timeout_=timeout_, - check_=check_) + return _OmegaUp_Controllers_Contest__apiAddProblem( + **self._client.query('/api/contest/addProblem/', + payload=parameters, + files_=files_, + timeout_=timeout_, + check_=check_)) def removeProblem( self, @@ -16218,6 +16545,9 @@ def archive( CourseCloneResponse = _OmegaUp_Controllers_Course__apiClone """The return type of the CourseClone API.""" +CourseAddProblemResponse = _OmegaUp_Controllers_Course__apiAddProblem +"""The return type of the CourseAddProblem API.""" + CourseGetProblemUsersResponse = _OmegaUp_Controllers_Course__apiGetProblemUsers """The return type of the CourseGetProblemUsers API.""" @@ -16541,18 +16871,19 @@ def updateAssignment( check_=check_) def addProblem( - self, - *, - assignment_alias: str, - course_alias: str, - points: float, - problem_alias: str, - commit: Optional[str] = None, - is_extra_problem: Optional[bool] = None, - # Out-of-band parameters: - files_: Optional[Mapping[str, BinaryIO]] = None, - check_: bool = True, - timeout_: datetime.timedelta = _DEFAULT_TIMEOUT) -> None: + self, + *, + assignment_alias: str, + course_alias: str, + points: float, + problem_alias: str, + commit: Optional[str] = None, + is_extra_problem: Optional[bool] = None, + # Out-of-band parameters: + files_: Optional[Mapping[str, BinaryIO]] = None, + check_: bool = True, + timeout_: datetime.timedelta = _DEFAULT_TIMEOUT + ) -> CourseAddProblemResponse: r"""Adds a problem to an assignment Args: @@ -16576,11 +16907,12 @@ def addProblem( parameters['commit'] = commit if is_extra_problem is not None: parameters['is_extra_problem'] = str(is_extra_problem) - self._client.query('/api/course/addProblem/', - payload=parameters, - files_=files_, - timeout_=timeout_, - check_=check_) + return _OmegaUp_Controllers_Course__apiAddProblem( + **self._client.query('/api/course/addProblem/', + payload=parameters, + files_=files_, + timeout_=timeout_, + check_=check_)) def updateProblemsOrder( self, @@ -17513,8 +17845,10 @@ def runs( *, assignment_alias: str, course_alias: str, + execution: Optional[str] = None, language: Optional[str] = None, offset: Optional[int] = None, + output: Optional[str] = None, problem_alias: Optional[str] = None, rowcount: Optional[int] = None, status: Optional[str] = None, @@ -17530,8 +17864,10 @@ def runs( Args: assignment_alias: course_alias: + execution: language: offset: + output: problem_alias: rowcount: status: @@ -17545,10 +17881,14 @@ def runs( 'assignment_alias': assignment_alias, 'course_alias': course_alias, } + if execution is not None: + parameters['execution'] = execution if language is not None: parameters['language'] = language if offset is not None: parameters['offset'] = str(offset) + if output is not None: + parameters['output'] = output if problem_alias is not None: parameters['problem_alias'] = problem_alias if rowcount is not None: @@ -18056,7 +18396,7 @@ def myList( def list( self, *, - query: Optional[str] = None, + query: str, # Out-of-band parameters: files_: Optional[Mapping[str, BinaryIO]] = None, check_: bool = True, @@ -18071,9 +18411,9 @@ def list( Returns: The API result object. """ - parameters: Dict[str, str] = {} - if query is not None: - parameters['query'] = query + parameters: Dict[str, str] = { + 'query': query, + } return [ _GroupListItem(**v) for v in self._client.query('/api/group/list/', payload=parameters, @@ -19676,8 +20016,10 @@ def runsDiff( def runs( self, *, + execution: Optional[str] = None, language: Optional[str] = None, offset: Optional[int] = None, + output: Optional[str] = None, problem_alias: Optional[str] = None, rowcount: Optional[int] = None, show_all: Optional[bool] = None, @@ -19692,8 +20034,10 @@ def runs( r"""Entry point for Problem runs API Args: + execution: language: offset: + output: problem_alias: rowcount: show_all: @@ -19705,10 +20049,14 @@ def runs( The API result object. """ parameters: Dict[str, str] = {} + if execution is not None: + parameters['execution'] = execution if language is not None: parameters['language'] = language if offset is not None: parameters['offset'] = str(offset) + if output is not None: + parameters['output'] = output if problem_alias is not None: parameters['problem_alias'] = problem_alias if rowcount is not None: @@ -20670,6 +21018,9 @@ def update( RunStatusResponse = _Run """The return type of the RunStatus API.""" +RunDisqualifyResponse = _OmegaUp_Controllers_Run__apiDisqualify +"""The return type of the RunDisqualify API.""" + RunGetSubmissionFeedbackResponse = Sequence['_SubmissionFeedback'] """The return type of the RunGetSubmissionFeedback API.""" @@ -20736,6 +21087,7 @@ def status( self, *, run_alias: str, + username: Optional[str] = None, # Out-of-band parameters: files_: Optional[Mapping[str, BinaryIO]] = None, check_: bool = True, @@ -20745,6 +21097,7 @@ def status( Args: run_alias: + username: Returns: The API result object. @@ -20752,6 +21105,8 @@ def status( parameters: Dict[str, str] = { 'run_alias': run_alias, } + if username is not None: + parameters['username'] = username return _Run(**self._client.query('/api/run/status/', payload=parameters, files_=files_, @@ -20788,29 +21143,52 @@ def rejudge( check_=check_) def disqualify( - self, - *, - run_alias: str, - # Out-of-band parameters: - files_: Optional[Mapping[str, BinaryIO]] = None, - check_: bool = True, - timeout_: datetime.timedelta = _DEFAULT_TIMEOUT) -> None: - r"""Disqualify a submission + self, + *, + contest_alias: Optional[str] = None, + problem_alias: Optional[str] = None, + run_alias: Optional[str] = None, + username: Optional[str] = None, + # Out-of-band parameters: + files_: Optional[Mapping[str, BinaryIO]] = None, + check_: bool = True, + timeout_: datetime.timedelta = _DEFAULT_TIMEOUT + ) -> RunDisqualifyResponse: + r"""Disqualify one or more submissions based on the received parameters: + + - When a run_alias is provided, it will only disqualify a single + submission. + - When run_alias is not provided, both the username and the contest_alias + are required. + - If a problem_alias is provided, all submissions belonging to the user + for this problem and contest will be disqualified. + - If a problem_alias is not provided, all submissions belonging to the + user in this contest will be disqualified. Args: + contest_alias: + problem_alias: run_alias: + username: Returns: The API result object. """ - parameters: Dict[str, str] = { - 'run_alias': run_alias, - } - self._client.query('/api/run/disqualify/', - payload=parameters, - files_=files_, - timeout_=timeout_, - check_=check_) + parameters: Dict[str, str] = {} + if contest_alias is not None: + parameters['contest_alias'] = contest_alias + if problem_alias is not None: + parameters['problem_alias'] = problem_alias + if run_alias is not None: + parameters['run_alias'] = run_alias + if username is not None: + parameters['username'] = username + return _OmegaUp_Controllers_Run__apiDisqualify( + **self._client.query('/api/run/disqualify/', + payload=parameters, + files_=files_, + timeout_=timeout_, + check_=check_)) def requalify( self, @@ -21201,7 +21579,7 @@ def setFeedback( check_: bool = True, timeout_: datetime.timedelta = _DEFAULT_TIMEOUT ) -> SubmissionSetFeedbackResponse: - r"""Updates the admin feedback for a submission + r"""Updates the admin feedback for a submission or creates the request feedback Args: assignment_alias: