protonmail: update calendar endpoints

They are now under the /calendar/v1 prefix.
This commit is contained in:
Simon Ser 2020-10-13 17:28:35 +02:00
parent bcb69ab597
commit 5dc0d0b2e8
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,8 @@ import (
"strconv"
)
const calendarPath = "/calendar/v1"
type CalendarFlags int
type Calendar struct {
@ -49,7 +51,7 @@ func (c *Client) ListCalendars(page, pageSize int) ([]*Calendar, error) {
v.Set("PageSize", strconv.Itoa(pageSize))
}
req, err := c.newRequest(http.MethodGet, "/calendars?"+v.Encode(), nil)
req, err := c.newRequest(http.MethodGet, calendarPath+"?"+v.Encode(), nil)
if err != nil {
return nil, err
}
@ -81,7 +83,7 @@ func (c *Client) ListCalendarEvents(calendarID string, filter *CalendarEventFilt
v.Set("PageSize", strconv.Itoa(filter.PageSize))
}
req, err := c.newRequest(http.MethodGet, "/calendars/"+calendarID+"/events?"+v.Encode(), nil)
req, err := c.newRequest(http.MethodGet, calendarPath+"/"+calendarID+"/events?"+v.Encode(), nil)
if err != nil {
return nil, err
}