Skip to content

Commit

Permalink
Do not use request restrictions alongside the sync token
Browse files Browse the repository at this point in the history
  • Loading branch information
balysv committed Nov 17, 2021
1 parent a956365 commit 647d7f8
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,13 @@ fun Calendar.findAllCalendars(syncToken: String?): GoogleCalendarListResponse {
private fun Calendar.findCalendarsPage(nextPageToken: String?, syncToken: String? = null): Calendar.CalendarList.List {
val requestBuilder = this.calendarList().list()
requestBuilder.maxResults = 250
requestBuilder.syncToken = syncToken
requestBuilder.showDeleted = true
requestBuilder.showHidden = false
if (syncToken != null) {
requestBuilder.syncToken = syncToken
} else {
requestBuilder.showDeleted = true
requestBuilder.showHidden = false
}

requestBuilder.fields =
"""
nextPageToken,nextSyncToken,items(id,timeZone,accessRole,primary,selected,summary,summaryOverride,backgroundColor,foregroundColor,deleted)
Expand Down

0 comments on commit 647d7f8

Please sign in to comment.