Skip to content

Commit

Permalink
omegaUp API change for "Modify store to fit unembedded editor (#7762)"
Browse files Browse the repository at this point in the history
API changes from omegaup/omegaup@54cf124
  • Loading branch information
omegaup-bot committed Aug 30, 2024
1 parent 420615a commit d215f29
Showing 1 changed file with 52 additions and 50 deletions.
102 changes: 52 additions & 50 deletions omegaup/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13365,17 +13365,23 @@ class _SubmissionsListPayload:
"""_SubmissionsListPayload"""
includeUser: bool
submissions: Sequence['_Submission']
username: Optional[str]

def __init__(
self,
*,
includeUser: bool,
submissions: Sequence[Dict[str, Any]],
username: Optional[str] = None,
# Ignore any unknown arguments
**_kwargs: Any,
):
self.includeUser = includeUser
self.submissions = [_Submission(**v) for v in submissions]
if username is not None:
self.username = username
else:
self.username = None


@dataclasses.dataclass
Expand Down Expand Up @@ -15398,43 +15404,46 @@ def createVirtual(
def create(
self,
*,
admission_mode: Optional[Any] = None,
alias: Optional[Any] = None,
finish_time: int,
start_time: int,
submissions_gap: int,
window_length: int,
admission_mode: Optional[str] = None,
alias: Optional[str] = None,
check_plagiarism: Optional[bool] = None,
contest_for_teams: Optional[bool] = None,
description: Optional[Any] = None,
feedback: Optional[Any] = None,
finish_time: Optional[Any] = None,
languages: Optional[Any] = None,
description: Optional[str] = None,
feedback: Optional[str] = None,
languages: Optional[str] = None,
needs_basic_information: Optional[bool] = None,
penalty: Optional[Any] = None,
penalty_calc_policy: Optional[Any] = None,
penalty_type: Optional[Any] = None,
points_decay_factor: Optional[Any] = None,
penalty: Optional[int] = None,
penalty_calc_policy: Optional[str] = None,
penalty_type: Optional[str] = None,
points_decay_factor: Optional[float] = None,
problems: Optional[str] = None,
requests_user_information: Optional[Any] = None,
requests_user_information: Optional[bool] = None,
score_mode: Optional[str] = None,
scoreboard: Optional[Any] = None,
show_scoreboard_after: Optional[Any] = None,
start_time: Optional[Any] = None,
submissions_gap: Optional[Any] = None,
scoreboard: Optional[float] = None,
show_scoreboard_after: Optional[bool] = None,
teams_group_alias: Optional[str] = None,
title: Optional[Any] = None,
window_length: Optional[int] = None,
title: Optional[str] = None,
# Out-of-band parameters:
files_: Optional[Mapping[str, BinaryIO]] = None,
check_: bool = True,
timeout_: datetime.timedelta = _DEFAULT_TIMEOUT) -> None:
r"""Creates a new contest

Args:
finish_time:
start_time:
submissions_gap:
window_length:
admission_mode:
alias:
check_plagiarism:
contest_for_teams:
description:
feedback:
finish_time:
languages:
needs_basic_information:
penalty:
Expand All @@ -15446,41 +15455,41 @@ def create(
score_mode:
scoreboard:
show_scoreboard_after:
start_time:
submissions_gap:
teams_group_alias:
title:
window_length:

Returns:
The API result object.
"""
parameters: Dict[str, str] = {}
parameters: Dict[str, str] = {
'finish_time': str(finish_time),
'start_time': str(start_time),
'submissions_gap': str(submissions_gap),
'window_length': str(window_length),
}
if admission_mode is not None:
parameters['admission_mode'] = str(admission_mode)
parameters['admission_mode'] = admission_mode
if alias is not None:
parameters['alias'] = str(alias)
parameters['alias'] = alias
if check_plagiarism is not None:
parameters['check_plagiarism'] = str(check_plagiarism)
if contest_for_teams is not None:
parameters['contest_for_teams'] = str(contest_for_teams)
if description is not None:
parameters['description'] = str(description)
parameters['description'] = description
if feedback is not None:
parameters['feedback'] = str(feedback)
if finish_time is not None:
parameters['finish_time'] = str(finish_time)
parameters['feedback'] = feedback
if languages is not None:
parameters['languages'] = str(languages)
parameters['languages'] = languages
if needs_basic_information is not None:
parameters['needs_basic_information'] = str(
needs_basic_information)
if penalty is not None:
parameters['penalty'] = str(penalty)
if penalty_calc_policy is not None:
parameters['penalty_calc_policy'] = str(penalty_calc_policy)
parameters['penalty_calc_policy'] = penalty_calc_policy
if penalty_type is not None:
parameters['penalty_type'] = str(penalty_type)
parameters['penalty_type'] = penalty_type
if points_decay_factor is not None:
parameters['points_decay_factor'] = str(points_decay_factor)
if problems is not None:
Expand All @@ -15494,16 +15503,10 @@ def create(
parameters['scoreboard'] = str(scoreboard)
if show_scoreboard_after is not None:
parameters['show_scoreboard_after'] = str(show_scoreboard_after)
if start_time is not None:
parameters['start_time'] = str(start_time)
if submissions_gap is not None:
parameters['submissions_gap'] = str(submissions_gap)
if teams_group_alias is not None:
parameters['teams_group_alias'] = teams_group_alias
if title is not None:
parameters['title'] = str(title)
if window_length is not None:
parameters['window_length'] = str(window_length)
parameters['title'] = title
self._client.query('/api/contest/create/',
payload=parameters,
files_=files_,
Expand Down Expand Up @@ -16211,6 +16214,7 @@ def update(
*,
contest_alias: str,
finish_time: int,
start_time: int,
submissions_gap: int,
window_length: int,
admission_mode: Optional[str] = None,
Expand All @@ -16219,19 +16223,18 @@ def update(
contest_for_teams: Optional[bool] = None,
default_show_all_contestants_in_scoreboard: Optional[bool] = None,
description: Optional[str] = None,
feedback: Optional[Any] = None,
languages: Optional[Any] = None,
feedback: Optional[str] = None,
languages: Optional[str] = None,
needs_basic_information: Optional[bool] = None,
penalty: Optional[int] = None,
penalty_calc_policy: Optional[Any] = None,
penalty_type: Optional[Any] = None,
penalty_calc_policy: Optional[str] = None,
penalty_type: Optional[str] = None,
points_decay_factor: Optional[float] = None,
problems: Optional[str] = None,
requests_user_information: Optional[str] = None,
score_mode: Optional[str] = None,
scoreboard: Optional[float] = None,
show_scoreboard_after: Optional[bool] = None,
start_time: Optional[datetime.datetime] = None,
teams_group_alias: Optional[str] = None,
title: Optional[str] = None,
# Out-of-band parameters:
Expand All @@ -16244,6 +16247,7 @@ def update(
Args:
contest_alias:
finish_time:
start_time:
submissions_gap:
window_length:
admission_mode:
Expand All @@ -16264,7 +16268,6 @@ def update(
score_mode:
scoreboard:
show_scoreboard_after:
start_time:
teams_group_alias:
title:

Expand All @@ -16274,6 +16277,7 @@ def update(
parameters: Dict[str, str] = {
'contest_alias': contest_alias,
'finish_time': str(finish_time),
'start_time': str(start_time),
'submissions_gap': str(submissions_gap),
'window_length': str(window_length),
}
Expand All @@ -16291,18 +16295,18 @@ def update(
if description is not None:
parameters['description'] = description
if feedback is not None:
parameters['feedback'] = str(feedback)
parameters['feedback'] = feedback
if languages is not None:
parameters['languages'] = str(languages)
parameters['languages'] = languages
if needs_basic_information is not None:
parameters['needs_basic_information'] = str(
needs_basic_information)
if penalty is not None:
parameters['penalty'] = str(penalty)
if penalty_calc_policy is not None:
parameters['penalty_calc_policy'] = str(penalty_calc_policy)
parameters['penalty_calc_policy'] = penalty_calc_policy
if penalty_type is not None:
parameters['penalty_type'] = str(penalty_type)
parameters['penalty_type'] = penalty_type
if points_decay_factor is not None:
parameters['points_decay_factor'] = str(points_decay_factor)
if problems is not None:
Expand All @@ -16315,8 +16319,6 @@ def update(
parameters['scoreboard'] = str(scoreboard)
if show_scoreboard_after is not None:
parameters['show_scoreboard_after'] = str(show_scoreboard_after)
if start_time is not None:
parameters['start_time'] = str(int(start_time.timestamp()))
if teams_group_alias is not None:
parameters['teams_group_alias'] = teams_group_alias
if title is not None:
Expand Down

0 comments on commit d215f29

Please sign in to comment.