Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "datagsm-openapi-sdk"
version = "1.0.3"
version = "1.1.0"
description = "Python SDK for DataGSM OpenAPI"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
2 changes: 1 addition & 1 deletion src/datagsm_openapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
ValidationException,
)

__version__ = "1.0.3"
__version__ = "1.1.0"

__all__ = [
"BadRequestException",
Expand Down
8 changes: 7 additions & 1 deletion src/datagsm_openapi/api/student.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dataclasses import dataclass
from typing import Optional

from ..models import Sex, SortDirection, Student, StudentResponse, StudentRole, StudentSortBy
from ..models import Major, Sex, SortDirection, Student, StudentResponse, StudentRole, StudentSortBy
from ._base import BaseApi


Expand All @@ -22,6 +22,8 @@ class StudentRequest:
role: Student role filter
dormitory_room: Dormitory room number
specialty: Specialty filter (e.g. Backend)
major: Major (department) filter
github_id: GitHub ID filter (partial match)
include_withdrawn: Include withdrawn students (default: False)
only_enrolled: Filter to enrolled students only, excluding GRADUATE and WITHDRAWN
page: Page number (default: 0)
Expand All @@ -40,6 +42,8 @@ class StudentRequest:
role: Optional[StudentRole] = None
dormitory_room: Optional[int] = None
specialty: Optional[str] = None
major: Optional[Major] = None
github_id: Optional[str] = None
include_withdrawn: Optional[bool] = None
only_enrolled: Optional[bool] = None
page: int = 0
Expand All @@ -64,6 +68,8 @@ def to_params(self) -> dict[str, Optional[object]]:
"role": self.role.value if self.role else None,
"dormitoryRoom": self.dormitory_room,
"specialty": self.specialty,
"major": self.major.value if self.major else None,
"githubId": self.github_id,
"includeWithdrawn": self.include_withdrawn,
"onlyEnrolled": self.only_enrolled,
"page": self.page,
Expand Down
6 changes: 6 additions & 0 deletions src/datagsm_openapi/models/student.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Student(BaseModel):
dormitory_room: Dormitory room number
major_club: Major club membership
autonomous_club: Autonomous club membership
github_id: GitHub account ID
github_url: GitHub profile URL
"""

id: int = Field(..., description="Student ID")
Expand All @@ -53,6 +55,10 @@ class Student(BaseModel):
autonomous_club: Optional[Club] = Field(
None, alias="autonomousClub", description="Autonomous club"
)
github_id: Optional[str] = Field(None, alias="githubId", description="GitHub account ID")
github_url: Optional[str] = Field(
None, alias="githubUrl", description="GitHub profile URL"
)

model_config = ConfigDict(populate_by_name=True)

Expand Down
Loading