Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omegaUp API change for "Agregando apiGetCertificatePdf para coder del mes (#7227)" #184

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 106 additions & 60 deletions omegaup/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,8 @@ class _CoderOfTheMonthList_entry:
country_id: str
date: str
gravatar_32: str
problems_solved: Optional[int]
score: Optional[float]
username: str

def __init__(
Expand All @@ -1606,21 +1608,30 @@ def __init__(
date: str,
gravatar_32: str,
username: str,
problems_solved: Optional[int] = None,
score: Optional[float] = None,
# Ignore any unknown arguments
**_kwargs: Any,
):
self.classname = classname
self.country_id = country_id
self.date = date
self.gravatar_32 = gravatar_32
if problems_solved is not None:
self.problems_solved = problems_solved
else:
self.problems_solved = None
if score is not None:
self.score = score
else:
self.score = None
self.username = username


@dataclasses.dataclass
class _CoderOfTheMonthPayload:
"""_CoderOfTheMonthPayload"""
candidatesToCoderOfTheMonth: Sequence[
'_CoderOfTheMonthPayload_candidatesToCoderOfTheMonth_entry']
candidatesToCoderOfTheMonth: Sequence['_CoderOfTheMonthList_entry']
category: str
codersOfCurrentMonth: Sequence['_CoderOfTheMonthList_entry']
codersOfPreviousMonth: Sequence['_CoderOfTheMonthList_entry']
Expand All @@ -1640,7 +1651,7 @@ def __init__(
**_kwargs: Any,
):
self.candidatesToCoderOfTheMonth = [
_CoderOfTheMonthPayload_candidatesToCoderOfTheMonth_entry(**v)
_CoderOfTheMonthList_entry(**v)
for v in candidatesToCoderOfTheMonth
]
self.category = category
Expand All @@ -1657,63 +1668,6 @@ def __init__(
self.options = None


@dataclasses.dataclass
class _CoderOfTheMonthPayload_candidatesToCoderOfTheMonth_entry:
"""_CoderOfTheMonthPayload_candidatesToCoderOfTheMonth_entry"""
category: str
classname: str
coder_of_the_month_id: int
country_id: str
description: Optional[str]
problems_solved: int
ranking: int
school_id: Optional[int]
score: float
selected_by: Optional[int]
time: str
username: str

def __init__(
self,
*,
category: str,
classname: str,
coder_of_the_month_id: int,
country_id: str,
problems_solved: int,
ranking: int,
score: float,
time: str,
username: str,
description: Optional[str] = None,
school_id: Optional[int] = None,
selected_by: Optional[int] = None,
# Ignore any unknown arguments
**_kwargs: Any,
):
self.category = category
self.classname = classname
self.coder_of_the_month_id = coder_of_the_month_id
self.country_id = country_id
if description is not None:
self.description = description
else:
self.description = None
self.problems_solved = problems_solved
self.ranking = ranking
if school_id is not None:
self.school_id = school_id
else:
self.school_id = None
self.score = score
if selected_by is not None:
self.selected_by = selected_by
else:
self.selected_by = None
self.time = time
self.username = username


@dataclasses.dataclass
class _CoderOfTheMonthPayload_options:
"""_CoderOfTheMonthPayload_options"""
Expand Down Expand Up @@ -1909,8 +1863,10 @@ class _CommonPayload:
isLoggedIn: bool
isMainUserIdentity: bool
isReviewer: bool
isUnder13User: bool
lockDownImage: str
navbarSection: str
nextRegisteredContestForUser: Optional['_ContestListItem']
omegaUpLockDown: bool
profileProgress: float
userClassname: str
Expand All @@ -1931,6 +1887,7 @@ def __init__(
isLoggedIn: bool,
isMainUserIdentity: bool,
isReviewer: bool,
isUnder13User: bool,
lockDownImage: str,
navbarSection: str,
omegaUpLockDown: bool,
Expand All @@ -1939,6 +1896,7 @@ def __init__(
userCountry: str,
userTypes: Sequence[str],
currentName: Optional[str] = None,
nextRegisteredContestForUser: Optional[Dict[str, Any]] = None,
# Ignore any unknown arguments
**_kwargs: Any,
):
Expand All @@ -1959,8 +1917,14 @@ def __init__(
self.isLoggedIn = isLoggedIn
self.isMainUserIdentity = isMainUserIdentity
self.isReviewer = isReviewer
self.isUnder13User = isUnder13User
self.lockDownImage = lockDownImage
self.navbarSection = navbarSection
if nextRegisteredContestForUser is not None:
self.nextRegisteredContestForUser = _ContestListItem(
**nextRegisteredContestForUser)
else:
self.nextRegisteredContestForUser = None
self.omegaUpLockDown = omegaUpLockDown
self.profileProgress = profileProgress
self.userClassname = userClassname
Expand Down Expand Up @@ -3928,19 +3892,22 @@ def __init__(
@dataclasses.dataclass
class _CourseNewPayload:
"""_CourseNewPayload"""
hasVisitedSection: bool
is_admin: bool
is_curator: bool
languages: Dict[str, str]

def __init__(
self,
*,
hasVisitedSection: bool,
is_admin: bool,
is_curator: bool,
languages: Dict[str, str],
# Ignore any unknown arguments
**_kwargs: Any,
):
self.hasVisitedSection = hasVisitedSection
self.is_admin = is_admin
self.is_curator = is_curator
self.languages = {k: v for k, v in languages.items()}
Expand Down Expand Up @@ -4291,15 +4258,18 @@ def __init__(
class _CourseTabsPayload:
"""_CourseTabsPayload"""
courses: '_CourseTabsPayload_courses'
hasVisitedSection: bool

def __init__(
self,
*,
courses: Dict[str, Any],
hasVisitedSection: bool,
# Ignore any unknown arguments
**_kwargs: Any,
):
self.courses = _CourseTabsPayload_courses(**courses)
self.hasVisitedSection = hasVisitedSection


@dataclasses.dataclass
Expand Down Expand Up @@ -4422,6 +4392,7 @@ class _CurrentSession:
email: Optional[str]
identity: Optional[_OmegaUp_DAO_VO_Identities]
is_admin: bool
is_under_13_user: bool
loginIdentity: Optional[_OmegaUp_DAO_VO_Identities]
user: Optional[_OmegaUp_DAO_VO_Users]
valid: bool
Expand All @@ -4433,6 +4404,7 @@ def __init__(
associated_identities: Sequence[Dict[str, Any]],
classname: str,
is_admin: bool,
is_under_13_user: bool,
valid: bool,
apiTokenId: Optional[int] = None,
auth_token: Optional[str] = None,
Expand Down Expand Up @@ -4470,6 +4442,7 @@ def __init__(
else:
self.identity = None
self.is_admin = is_admin
self.is_under_13_user = is_under_13_user
if loginIdentity is not None:
self.loginIdentity = _OmegaUp_DAO_VO_Identities(**loginIdentity)
else:
Expand Down Expand Up @@ -5736,8 +5709,10 @@ class _NavbarProblemsetProblem:
acceptsSubmissions: bool
alias: str
bestScore: int
hasMyRuns: Optional[bool]
hasRuns: bool
maxScore: Union[float, int]
myBestScore: Optional[float]
text: str

def __init__(
Expand All @@ -5749,14 +5724,24 @@ def __init__(
hasRuns: bool,
maxScore: Union[float, int],
text: str,
hasMyRuns: Optional[bool] = None,
myBestScore: Optional[float] = None,
# Ignore any unknown arguments
**_kwargs: Any,
):
self.acceptsSubmissions = acceptsSubmissions
self.alias = alias
self.bestScore = bestScore
if hasMyRuns is not None:
self.hasMyRuns = hasMyRuns
else:
self.hasMyRuns = None
self.hasRuns = hasRuns
self.maxScore = maxScore
if myBestScore is not None:
self.myBestScore = myBestScore
else:
self.myBestScore = None
self.text = text


Expand Down Expand Up @@ -6228,6 +6213,21 @@ def __init__(
self.badges = [_Badge(**v) for v in badges]


@dataclasses.dataclass
class _OmegaUp_Controllers_Certificate__apiGetCertificatePdf:
"""_OmegaUp_Controllers_Certificate__apiGetCertificatePdf"""
certificate: str

def __init__(
self,
*,
certificate: str,
# Ignore any unknown arguments
**_kwargs: Any,
):
self.certificate = certificate


@dataclasses.dataclass
class _OmegaUp_Controllers_Clarification__apiDetails:
"""_OmegaUp_Controllers_Clarification__apiDetails"""
Expand Down Expand Up @@ -14220,6 +14220,44 @@ def badgeDetails(
check_=check_))


CertificateGetCertificatePdfResponse = _OmegaUp_Controllers_Certificate__apiGetCertificatePdf
"""The return type of the CertificateGetCertificatePdf API."""


class Certificate:
r"""CertificateController
"""
def __init__(self, client: 'Client') -> None:
self._client = client

def getCertificatePdf(
self,
*,
verification_code: str,
# Out-of-band parameters:
files_: Optional[Mapping[str, BinaryIO]] = None,
check_: bool = True,
timeout_: datetime.timedelta = _DEFAULT_TIMEOUT
) -> CertificateGetCertificatePdfResponse:
r"""API to generate the certificate PDF

Args:
verification_code:

Returns:
The API result object.
"""
parameters: Dict[str, str] = {
'verification_code': verification_code,
}
return _OmegaUp_Controllers_Certificate__apiGetCertificatePdf(
**self._client.query('/api/certificate/getCertificatePdf/',
payload=parameters,
files_=files_,
timeout_=timeout_,
check_=check_))


ClarificationCreateResponse = _Clarification
"""The return type of the ClarificationCreate API."""

Expand Down Expand Up @@ -22800,6 +22838,7 @@ def __init__(self,
self._admin: Optional[Admin] = None
self._authorization: Optional[Authorization] = None
self._badge: Optional[Badge] = None
self._certificate: Optional[Certificate] = None
self._clarification: Optional[Clarification] = None
self._contest: Optional[Contest] = None
self._course: Optional[Course] = None
Expand Down Expand Up @@ -22893,6 +22932,13 @@ def badge(self) -> Badge:
self._badge = Badge(self)
return self._badge

@property
def certificate(self) -> Certificate:
"""Returns the Certificate API."""
if self._certificate is None:
self._certificate = Certificate(self)
return self._certificate

@property
def clarification(self) -> Clarification:
"""Returns the Clarification API."""
Expand Down
Loading