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

Google: Pass eventTypes #664

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion inbox/events/google.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide Google Calendar events."""

import datetime
import email.utils
import json
Expand Down Expand Up @@ -131,8 +132,9 @@ def _get_raw_events(
url = "https://www.googleapis.com/calendar/v3/calendars/{}/events".format(
urllib.parse.quote(calendar_uid)
)
params = {"eventTypes": "default"}
try:
return self._get_resource_list(url, updatedMin=sync_from_time_str)
return self._get_resource_list(url, updatedMin=sync_from_time_str, **params)
Copy link
Member

@wojcikstefan wojcikstefan Feb 8, 2024

Choose a reason for hiding this comment

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

Why the use of kwargs? Is it because the linter would complain about passing eventTypes="default" explicitly to the function call since it's not the typical Pythonic snake_case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was indeed unnecessary, I changed it.

except requests.exceptions.HTTPError as exc:
assert exc.response is not None
if exc.response.status_code == 410:
Expand Down Expand Up @@ -382,6 +384,7 @@ def watch_calendar(
try:
r = requests.post(
watch_url,
params={"eventTypes": "default"},
data=json.dumps(data),
headers=headers,
auth=OAuthRequestsWrapper(token),
Expand Down
Loading