Released v1

This commit is contained in:
Steve Cliff
2026-02-12 10:37:19 +00:00
commit b07572fed5
77 changed files with 19518 additions and 0 deletions
+178
View File
@@ -0,0 +1,178 @@
package model
import (
"encoding/json"
"fmt"
)
type Project struct {
ID string `json:"id"`
OwnerProjectManagerID *string `json:"ownerProjectManagerId"`
BackgroundImageID *string `json:"backgroundImageId"`
Name string `json:"name"`
Description *string `json:"description"`
BackgroundType *string `json:"backgroundType"`
BackgroundGradient *string `json:"backgroundGradient"`
IsHidden bool `json:"isHidden"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Board struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
Position float64 `json:"position"`
Name string `json:"name"`
DefaultView string `json:"defaultView"`
DefaultCardType string `json:"defaultCardType"`
LimitCardTypesToDefaultOne bool `json:"limitCardTypesToDefaultOne"`
AlwaysDisplayCardCreator bool `json:"alwaysDisplayCardCreator"`
ExpandTaskListsByDefault bool `json:"expandTaskListsByDefault"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
Lists []List `json:"lists,omitempty"`
Cards []Card `json:"cards,omitempty"`
}
type List struct {
ID string `json:"id"`
BoardID string `json:"boardId"`
Type string `json:"type"`
Position *float64 `json:"position"`
Name *string `json:"name"`
Color *string `json:"color"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Stopwatch struct {
StartedAt string `json:"startedAt"`
Total float64 `json:"total"`
}
type Card struct {
ID string `json:"id"`
BoardID string `json:"boardId"`
ListID string `json:"listId"`
CreatorUserID *string `json:"creatorUserId"`
PrevListID *string `json:"prevListId"`
CoverAttachmentID *string `json:"coverAttachmentId"`
Type string `json:"type"`
Position *float64 `json:"position"`
Name string `json:"name"`
Description *string `json:"description"`
DueDate *string `json:"dueDate"`
IsDueCompleted *bool `json:"isDueCompleted"`
Stopwatch *Stopwatch `json:"stopwatch"`
CommentsTotal int `json:"commentsTotal"`
IsClosed bool `json:"isClosed"`
ListChangedAt *string `json:"listChangedAt"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type CardWithList struct {
Card
ListName string `json:"listName"`
}
type Comment struct {
ID string `json:"id"`
CardID string `json:"cardId"`
UserID *string `json:"userId"`
Text string `json:"text"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type TaskList struct {
ID string `json:"id"`
CardID string `json:"cardId"`
Position float64 `json:"position"`
Name string `json:"name"`
ShowOnFrontOfCard bool `json:"showOnFrontOfCard"`
HideCompletedTasks bool `json:"hideCompletedTasks"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Task struct {
ID string `json:"id"`
TaskListID string `json:"taskListId"`
LinkedCardID *string `json:"linkedCardId"`
AssigneeUserID *string `json:"assigneeUserId"`
Position float64 `json:"position"`
Name string `json:"name"`
IsCompleted bool `json:"isCompleted"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Label struct {
ID string `json:"id"`
BoardID string `json:"boardId"`
Position float64 `json:"position"`
Name *string `json:"name"`
Color string `json:"color"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Action struct {
ID string `json:"id"`
BoardID *string `json:"boardId"`
CardID string `json:"cardId"`
UserID *string `json:"userId"`
Type string `json:"type"`
Data json.RawMessage `json:"data"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type CardLabel struct {
ID string `json:"id"`
CardID string `json:"cardId"`
LabelID string `json:"labelId"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type CardMembership struct {
ID string `json:"id"`
CardID string `json:"cardId"`
UserID string `json:"userId"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Envelope struct {
Data any `json:"data"`
Error *string `json:"error"`
}
type StatusSummary struct {
TotalBoards int `json:"totalBoards"`
Boards []BoardSummary `json:"boards"`
}
type BoardSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Lists []ListSummary `json:"lists"`
}
type ListSummary struct {
ID string `json:"id"`
Name string `json:"name"`
OpenCards int `json:"openCards"`
ClosedCards int `json:"closedCards"`
}
type APIError struct {
StatusCode int
Message string
}
func (e *APIError) Error() string {
return fmt.Sprintf("API error (status %d): %s", e.StatusCode, e.Message)
}