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 concursos (#7225)" #176

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
92 changes: 92 additions & 0 deletions omegaup/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1909,8 +1909,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 +1933,7 @@ def __init__(
isLoggedIn: bool,
isMainUserIdentity: bool,
isReviewer: bool,
isUnder13User: bool,
lockDownImage: str,
navbarSection: str,
omegaUpLockDown: bool,
Expand All @@ -1939,6 +1942,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 +1963,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 +3938,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 +4304,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 +4438,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 +4450,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 +4488,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 +5755,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 +5770,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 +6259,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 +14266,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 +22884,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 +22978,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