Add more fields to tasks

This commit is contained in:
kolaente 2020-12-18 00:48:40 +01:00
parent 403692b72a
commit 2846322bde
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 50 additions and 13 deletions

View File

@ -32,7 +32,7 @@ import (
"code.vikunja.io/api/pkg/user"
)
const apiScopes = `tasks.read%20tasks.read.shared`
const apiScopes = `tasks.read tasks.read.shared`
type Migration struct {
Code string `json:"code"`
@ -47,18 +47,55 @@ type apiTokenResponse struct {
}
type task struct {
ID string `json:"id"`
OdataEtag string `json:"@odata.etag"`
Importance string `json:"importance"`
IsReminderOn bool `json:"isReminderOn"`
Status string `json:"status"`
Title string `json:"title"`
CreatedDateTime time.Time `json:"createdDateTime"`
LastModifiedDateTime time.Time `json:"lastModifiedDateTime"`
Body struct {
Content string `json:"content"`
ContentType string `json:"contentType"`
} `json:"body"`
OdataEtag string `json:"@odata.etag"`
Importance string `json:"importance"`
IsReminderOn bool `json:"isReminderOn"`
Status string `json:"status"`
Title string `json:"title"`
CreatedDateTime time.Time `json:"createdDateTime"`
LastModifiedDateTime time.Time `json:"lastModifiedDateTime"`
ID string `json:"id"`
Body body `json:"body"`
DueDateTime dueDateTime `json:"dueDateTime"`
Recurrence recurrence `json:"recurrence"`
ReminderDateTime reminderDateTime `json:"reminderDateTime"`
CompletedDateTime completedDateTime `json:"completedDateTime"`
}
type completedDateTime struct {
DateTime string `json:"dateTime"`
TimeZone string `json:"timeZone"`
}
type body struct {
Content string `json:"content"`
ContentType string `json:"contentType"`
}
type dueDateTime struct {
DateTime string `json:"dateTime"`
TimeZone string `json:"timeZone"`
}
type pattern struct {
Type string `json:"type"`
Interval int `json:"interval"`
Month int `json:"month"`
DayOfMonth int `json:"dayOfMonth"`
DaysOfWeek []string `json:"daysOfWeek"`
FirstDayOfWeek string `json:"firstDayOfWeek"`
Index string `json:"index"`
}
type taskRange struct {
Type string `json:"type"`
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
RecurrenceTimeZone string `json:"recurrenceTimeZone"`
NumberOfOccurrences int `json:"numberOfOccurrences"`
}
type recurrence struct {
Pattern pattern `json:"pattern"`
Range taskRange `json:"range"`
}
type reminderDateTime struct {
DateTime string `json:"dateTime"`
TimeZone string `json:"timeZone"`
}
type tasksResponse struct {