diff options
Diffstat (limited to 'internal/api')
| -rw-r--r-- | internal/api/google_calendar.go | 5 | ||||
| -rw-r--r-- | internal/api/google_tasks.go | 5 | ||||
| -rw-r--r-- | internal/api/interfaces.go | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/internal/api/google_calendar.go b/internal/api/google_calendar.go index 68d423b..8bb3143 100644 --- a/internal/api/google_calendar.go +++ b/internal/api/google_calendar.go @@ -176,6 +176,11 @@ func (c *GoogleCalendarClient) GetEventsByDateRange(ctx context.Context, start, return deduplicateEvents(allEvents), nil } +// SetCalendarIDs updates the calendar IDs used by the client +func (c *GoogleCalendarClient) SetCalendarIDs(ids []string) { + c.calendarIDs = ids +} + // GetCalendarList returns all calendars accessible to the user func (c *GoogleCalendarClient) GetCalendarList(ctx context.Context) ([]models.CalendarInfo, error) { list, err := c.srv.CalendarList.List().Do() diff --git a/internal/api/google_tasks.go b/internal/api/google_tasks.go index 8a6488e..da3cd3b 100644 --- a/internal/api/google_tasks.go +++ b/internal/api/google_tasks.go @@ -175,6 +175,11 @@ func (c *GoogleTasksClient) UncompleteTask(ctx context.Context, listID, taskID s return nil } +// SetTaskListID updates the task list ID(s) used by the client +func (c *GoogleTasksClient) SetTaskListID(id string) { + c.tasklistID = id +} + // GetTaskLists returns all task lists accessible to the user func (c *GoogleTasksClient) GetTaskLists(ctx context.Context) ([]models.TaskListInfo, error) { list, err := c.srv.Tasklists.List().Context(ctx).Do() diff --git a/internal/api/interfaces.go b/internal/api/interfaces.go index cec64be..99701a1 100644 --- a/internal/api/interfaces.go +++ b/internal/api/interfaces.go @@ -39,6 +39,7 @@ type GoogleCalendarAPI interface { GetUpcomingEvents(ctx context.Context, maxResults int) ([]models.CalendarEvent, error) GetEventsByDateRange(ctx context.Context, start, end time.Time) ([]models.CalendarEvent, error) GetCalendarList(ctx context.Context) ([]models.CalendarInfo, error) + SetCalendarIDs(ids []string) } // GoogleTasksAPI defines the interface for Google Tasks operations @@ -48,6 +49,7 @@ type GoogleTasksAPI interface { CompleteTask(ctx context.Context, listID, taskID string) error UncompleteTask(ctx context.Context, listID, taskID string) error GetTaskLists(ctx context.Context) ([]models.TaskListInfo, error) + SetTaskListID(id string) } // Ensure concrete types implement interfaces |
