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

Implement api/timeline #80

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

srachmiletter
Copy link

Implements /api/timeline endpoint documented here.

Checklist when adding a new endpoint
  • Added new endpoint to the README.md
  • Ensure that my endpoint name does not repeat the name of the client. Wrong: client.users.get_user(), Correct: client.users.get()
  • Typed the returned JSON using TypedDicts in berserk/types/, example
  • Tested GET endpoints not requiring authentification. Documentation, example
  • Added the endpoint and your name to CHANGELOG.md in the To be released section (to be created if necessary)

Comment on lines +100 to +102
class TimelineEvents(TypedDict):
entries: list[dict[str, Any]]
users: dict[str, Any]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good day, the idea is not to have any Any in the response type.

Comment on lines +70 to +71
:param int since: timestamp to show events since, default 1356998400070
:param int nb: max number of events to fetch, default 15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:param int since: timestamp to show events since, default 1356998400070
:param int nb: max number of events to fetch, default 15
:param since: only show events after this timestamp, default 1356998400070 (the earliest allowed by Lichess)
:param nb: max number of events to fetch, default 15

We generally leave out the types here since they are already given via the type hints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants