Documentation
¶
Index ¶
- type APIClient
- type Campfire
- type CampfireLine
- type CampfireLineCreate
- type CampfireOperations
- type Card
- type CardCreateRequest
- type CardMoveRequest
- type CardOperations
- type CardTable
- type CardUpdateRequest
- type Client
- func (c *Client) ArchiveCard(ctx context.Context, projectID string, cardID int64) error
- func (c *Client) CompleteTodo(ctx context.Context, projectID string, todoID int64) error
- func (c *Client) CreateCard(ctx context.Context, projectID string, columnID int64, req CardCreateRequest) (*Card, error)
- func (c *Client) CreateColumn(ctx context.Context, projectID string, cardTableID int64, ...) (*Column, error)
- func (c *Client) CreateMessage(ctx context.Context, projectID string, messageBoardID int64, ...) (*Message, error)
- func (c *Client) CreateStep(ctx context.Context, projectID string, cardID int64, req StepCreateRequest) (*Step, error)
- func (c *Client) CreateTodo(ctx context.Context, projectID string, todoListID int64, req TodoCreateRequest) (*Todo, error)
- func (c *Client) CreateTodoList(ctx context.Context, projectID string, todoSetID int64, ...) (*TodoList, error)
- func (c *Client) Delete(path string) error
- func (c *Client) DeleteCampfireLine(ctx context.Context, projectID string, campfireID int64, lineID int64) error
- func (c *Client) DeleteMessage(ctx context.Context, projectID string, messageID int64) error
- func (c *Client) DeleteStep(ctx context.Context, projectID string, stepID int64) error
- func (c *Client) Get(path string, result interface{}) error
- func (c *Client) GetAllTodos(ctx context.Context, projectID string, todoListID int64) ([]Todo, error)
- func (c *Client) GetCampfire(ctx context.Context, projectID string, campfireID int64) (*Campfire, error)
- func (c *Client) GetCampfireByName(ctx context.Context, projectID string, name string) (*Campfire, error)
- func (c *Client) GetCampfireLines(ctx context.Context, projectID string, campfireID int64, limit int) ([]CampfireLine, error)
- func (c *Client) GetCard(ctx context.Context, projectID string, cardID int64) (*Card, error)
- func (c *Client) GetCardTable(ctx context.Context, projectID string, cardTableID int64) (*CardTable, error)
- func (c *Client) GetCardsInColumn(ctx context.Context, projectID string, columnID int64) ([]Card, error)
- func (c *Client) GetMessage(ctx context.Context, projectID string, messageID int64) (*Message, error)
- func (c *Client) GetMessageBoard(ctx context.Context, projectID string) (*MessageBoard, error)
- func (c *Client) GetPerson(ctx context.Context, personID int64) (*Person, error)
- func (c *Client) GetProject(ctx context.Context, projectID string) (*Project, error)
- func (c *Client) GetProjectCardTable(ctx context.Context, projectID string) (*CardTable, error)
- func (c *Client) GetProjectPeople(ctx context.Context, projectID string) ([]Person, error)
- func (c *Client) GetProjectTodoSet(ctx context.Context, projectID string) (*TodoSet, error)
- func (c *Client) GetProjects(ctx context.Context) ([]Project, error)
- func (c *Client) GetTodo(ctx context.Context, projectID string, todoID int64) (*Todo, error)
- func (c *Client) GetTodoGroups(ctx context.Context, projectID string, todoListID int64) ([]TodoGroup, error)
- func (c *Client) GetTodoList(ctx context.Context, projectID string, todoListID int64) (*TodoList, error)
- func (c *Client) GetTodoLists(ctx context.Context, projectID string, todoSetID int64) ([]TodoList, error)
- func (c *Client) GetTodos(ctx context.Context, projectID string, todoListID int64) ([]Todo, error)
- func (c *Client) ListCampfires(ctx context.Context, projectID string) ([]Campfire, error)
- func (c *Client) ListMessageCategories(ctx context.Context, projectID string, messageBoardID int64) ([]MessageCategory, error)
- func (c *Client) ListMessages(ctx context.Context, projectID string, messageBoardID int64) ([]Message, error)
- func (c *Client) MoveCard(ctx context.Context, projectID string, cardID int64, columnID int64) error
- func (c *Client) MoveColumn(ctx context.Context, projectID string, cardTableID int64, ...) error
- func (c *Client) MoveStep(ctx context.Context, projectID string, cardID int64, stepID int64, ...) error
- func (c *Client) Post(path string, payload interface{}, result interface{}) error
- func (c *Client) PostCampfireLine(ctx context.Context, projectID string, campfireID int64, content string) (*CampfireLine, error)
- func (c *Client) Put(path string, payload interface{}, result interface{}) error
- func (c *Client) SetColumnColor(ctx context.Context, projectID string, columnID int64, color string) error
- func (c *Client) SetStepCompletion(ctx context.Context, projectID string, stepID int64, completed bool) error
- func (c *Client) UncompleteTodo(ctx context.Context, projectID string, todoID int64) error
- func (c *Client) UpdateCard(ctx context.Context, projectID string, cardID int64, req CardUpdateRequest) (*Card, error)
- func (c *Client) UpdateColumn(ctx context.Context, projectID string, columnID int64, req ColumnUpdateRequest) (*Column, error)
- func (c *Client) UpdateMessage(ctx context.Context, projectID string, messageID int64, ...) (*Message, error)
- func (c *Client) UpdateStep(ctx context.Context, projectID string, stepID int64, req StepUpdateRequest) (*Step, error)
- type Column
- type ColumnColorRequest
- type ColumnCreateRequest
- type ColumnMoveRequest
- type ColumnOperations
- type ColumnUpdateRequest
- type Message
- type MessageBoard
- type MessageCategory
- type MessageCreateRequest
- type MessageUpdateRequest
- type ModularClient
- func (c *ModularClient) Campfires() CampfireOperations
- func (c *ModularClient) Cards() CardOperations
- func (c *ModularClient) Columns() ColumnOperations
- func (c *ModularClient) People() PeopleOperations
- func (c *ModularClient) Projects() ProjectOperations
- func (c *ModularClient) Steps() StepOperations
- func (c *ModularClient) Todos() TodoOperations
- type PaginatedRequest
- type PeopleOperations
- type Person
- type Project
- type ProjectOperations
- type RateLimiter
- type Step
- type StepCompletionRequest
- type StepCreateRequest
- type StepOperations
- type StepPositionRequest
- type StepUpdateRequest
- type Todo
- type TodoCreateRequest
- type TodoGroup
- type TodoList
- type TodoListCreateRequest
- type TodoOperations
- type TodoSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface {
// Project methods
GetProjects(ctx context.Context) ([]Project, error)
GetProject(ctx context.Context, projectID string) (*Project, error)
// Todo methods
GetProjectTodoSet(ctx context.Context, projectID string) (*TodoSet, error)
GetTodoLists(ctx context.Context, projectID string, todoSetID int64) ([]TodoList, error)
GetTodoList(ctx context.Context, projectID string, todoListID int64) (*TodoList, error)
GetTodos(ctx context.Context, projectID string, todoListID int64) ([]Todo, error)
GetAllTodos(ctx context.Context, projectID string, todoListID int64) ([]Todo, error)
GetTodo(ctx context.Context, projectID string, todoID int64) (*Todo, error)
GetTodoGroups(ctx context.Context, projectID string, todoListID int64) ([]TodoGroup, error)
CreateTodo(ctx context.Context, projectID string, todoListID int64, req TodoCreateRequest) (*Todo, error)
CreateTodoList(ctx context.Context, projectID string, todoSetID int64, req TodoListCreateRequest) (*TodoList, error)
CompleteTodo(ctx context.Context, projectID string, todoID int64) error
UncompleteTodo(ctx context.Context, projectID string, todoID int64) error
// Campfire methods
ListCampfires(ctx context.Context, projectID string) ([]Campfire, error)
GetCampfire(ctx context.Context, projectID string, campfireID int64) (*Campfire, error)
GetCampfireByName(ctx context.Context, projectID string, name string) (*Campfire, error)
GetCampfireLines(ctx context.Context, projectID string, campfireID int64, limit int) ([]CampfireLine, error)
PostCampfireLine(ctx context.Context, projectID string, campfireID int64, content string) (*CampfireLine, error)
DeleteCampfireLine(ctx context.Context, projectID string, campfireID int64, lineID int64) error
// Card table methods
GetProjectCardTable(ctx context.Context, projectID string) (*CardTable, error)
GetCardTable(ctx context.Context, projectID string, cardTableID int64) (*CardTable, error)
GetCardsInColumn(ctx context.Context, projectID string, columnID int64) ([]Card, error)
GetCard(ctx context.Context, projectID string, cardID int64) (*Card, error)
CreateCard(ctx context.Context, projectID string, columnID int64, req CardCreateRequest) (*Card, error)
UpdateCard(ctx context.Context, projectID string, cardID int64, req CardUpdateRequest) (*Card, error)
MoveCard(ctx context.Context, projectID string, cardID int64, columnID int64) error
ArchiveCard(ctx context.Context, projectID string, cardID int64) error
// Card step methods
CreateStep(ctx context.Context, projectID string, cardID int64, req StepCreateRequest) (*Step, error)
UpdateStep(ctx context.Context, projectID string, stepID int64, req StepUpdateRequest) (*Step, error)
SetStepCompletion(ctx context.Context, projectID string, stepID int64, completed bool) error
MoveStep(ctx context.Context, projectID string, cardID int64, stepID int64, position int) error
DeleteStep(ctx context.Context, projectID string, stepID int64) error
// People methods
GetProjectPeople(ctx context.Context, projectID string) ([]Person, error)
GetPerson(ctx context.Context, personID int64) (*Person, error)
}
APIClient defines the interface for interacting with the Basecamp API
type Campfire ¶
type Campfire struct {
ID int64 `json:"id"`
Name string `json:"title"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LinesURL string `json:"lines_url"`
URL string `json:"url"`
Bucket struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
} `json:"bucket"`
Creator Person `json:"creator"`
}
Campfire represents a Basecamp campfire (chat room)
type CampfireLine ¶
type CampfireLine struct {
ID int64 `json:"id"`
Status string `json:"status"`
Content string `json:"content"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
URL string `json:"url"`
Creator Person `json:"creator"`
Parent struct {
ID int64 `json:"id"`
Title string `json:"title"`
Type string `json:"type"`
URL string `json:"url"`
} `json:"parent"`
}
CampfireLine represents a message in a campfire
type CampfireLineCreate ¶
type CampfireLineCreate struct {
Content string `json:"content"`
}
CampfireLineCreate represents the request body for creating a campfire line
type CampfireOperations ¶
type CampfireOperations interface {
ListCampfires(ctx context.Context, projectID string) ([]Campfire, error)
GetCampfire(ctx context.Context, projectID string, campfireID int64) (*Campfire, error)
GetCampfireByName(ctx context.Context, projectID string, name string) (*Campfire, error)
GetCampfireLines(ctx context.Context, projectID string, campfireID int64, limit int) ([]CampfireLine, error)
PostCampfireLine(ctx context.Context, projectID string, campfireID int64, content string) (*CampfireLine, error)
DeleteCampfireLine(ctx context.Context, projectID string, campfireID int64, lineID int64) error
}
CampfireOperations defines campfire-specific operations
type Card ¶
type Card struct {
ID int64 `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
Status string `json:"status"`
DueOn *string `json:"due_on,omitempty"`
Assignees []Person `json:"assignees"`
Steps []Step `json:"steps"`
StepsCount int `json:"steps_count"`
Creator *Person `json:"creator"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Parent *Column `json:"parent"`
URL string `json:"url"`
}
Card represents a card in a card table
type CardCreateRequest ¶
type CardCreateRequest struct {
Title string `json:"title"`
Content string `json:"content,omitempty"`
DueOn *string `json:"due_on,omitempty"`
Notify bool `json:"notify,omitempty"`
}
CardCreateRequest represents the payload for creating a new card
type CardMoveRequest ¶
type CardMoveRequest struct {
ColumnID int64 `json:"column_id"`
}
CardMoveRequest represents the payload for moving a card
type CardOperations ¶
type CardOperations interface {
GetProjectCardTable(ctx context.Context, projectID string) (*CardTable, error)
GetCardTable(ctx context.Context, projectID string, cardTableID int64) (*CardTable, error)
GetCardsInColumn(ctx context.Context, projectID string, columnID int64) ([]Card, error)
GetCard(ctx context.Context, projectID string, cardID int64) (*Card, error)
CreateCard(ctx context.Context, projectID string, columnID int64, req CardCreateRequest) (*Card, error)
UpdateCard(ctx context.Context, projectID string, cardID int64, req CardUpdateRequest) (*Card, error)
MoveCard(ctx context.Context, projectID string, cardID int64, columnID int64) error
ArchiveCard(ctx context.Context, projectID string, cardID int64) error
}
CardOperations defines card table-specific operations
type CardTable ¶
type CardTable struct {
ID int64 `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Lists []Column `json:"lists"`
CardsCount int `json:"cards_count"`
URL string `json:"url"`
}
CardTable represents a Basecamp card table (kanban board)
type CardUpdateRequest ¶
type CardUpdateRequest struct {
Title string `json:"title,omitempty"`
Content string `json:"content,omitempty"`
DueOn *string `json:"due_on,omitempty"`
AssigneeIDs []int64 `json:"assignee_ids,omitempty"`
}
CardUpdateRequest represents the payload for updating a card
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient creates a new API client Deprecated: Use NewModularClient instead for better separation of concerns
func (*Client) ArchiveCard ¶
ArchiveCard archives a card
func (*Client) CompleteTodo ¶
CompleteTodo marks a todo as complete
func (*Client) CreateCard ¶
func (c *Client) CreateCard(ctx context.Context, projectID string, columnID int64, req CardCreateRequest) (*Card, error)
CreateCard creates a new card in a column
func (*Client) CreateColumn ¶
func (c *Client) CreateColumn(ctx context.Context, projectID string, cardTableID int64, req ColumnCreateRequest) (*Column, error)
CreateColumn creates a new column in a card table
func (*Client) CreateMessage ¶ added in v0.5.0
func (c *Client) CreateMessage(ctx context.Context, projectID string, messageBoardID int64, req MessageCreateRequest) (*Message, error)
CreateMessage creates a new message on a message board
func (*Client) CreateStep ¶
func (c *Client) CreateStep(ctx context.Context, projectID string, cardID int64, req StepCreateRequest) (*Step, error)
CreateStep creates a new step in a card
func (*Client) CreateTodo ¶
func (c *Client) CreateTodo(ctx context.Context, projectID string, todoListID int64, req TodoCreateRequest) (*Todo, error)
CreateTodo creates a new todo in a todo list
func (*Client) CreateTodoList ¶
func (c *Client) CreateTodoList(ctx context.Context, projectID string, todoSetID int64, req TodoListCreateRequest) (*TodoList, error)
CreateTodoList creates a new todo list in a project
func (*Client) DeleteCampfireLine ¶
func (c *Client) DeleteCampfireLine(ctx context.Context, projectID string, campfireID int64, lineID int64) error
DeleteCampfireLine deletes a message from a campfire
func (*Client) DeleteMessage ¶ added in v0.5.0
DeleteMessage deletes a message
func (*Client) DeleteStep ¶
DeleteStep deletes a step (archive it)
func (*Client) GetAllTodos ¶
func (c *Client) GetAllTodos(ctx context.Context, projectID string, todoListID int64) ([]Todo, error)
GetAllTodos fetches all todos in a todo list including completed ones
func (*Client) GetCampfire ¶
func (c *Client) GetCampfire(ctx context.Context, projectID string, campfireID int64) (*Campfire, error)
GetCampfire returns a specific campfire
func (*Client) GetCampfireByName ¶
func (c *Client) GetCampfireByName(ctx context.Context, projectID string, name string) (*Campfire, error)
GetCampfireByName finds a campfire by name (case-insensitive partial match)
func (*Client) GetCampfireLines ¶
func (c *Client) GetCampfireLines(ctx context.Context, projectID string, campfireID int64, limit int) ([]CampfireLine, error)
GetCampfireLines returns messages from a campfire
func (*Client) GetCardTable ¶
func (c *Client) GetCardTable(ctx context.Context, projectID string, cardTableID int64) (*CardTable, error)
GetCardTable fetches a card table by ID
func (*Client) GetCardsInColumn ¶
func (c *Client) GetCardsInColumn(ctx context.Context, projectID string, columnID int64) ([]Card, error)
GetCardsInColumn fetches all cards in a specific column
func (*Client) GetMessage ¶ added in v0.5.0
func (c *Client) GetMessage(ctx context.Context, projectID string, messageID int64) (*Message, error)
GetMessage returns a specific message
func (*Client) GetMessageBoard ¶ added in v0.5.0
GetMessageBoard returns the message board for a project
func (*Client) GetProject ¶
GetProject fetches a single project by ID
func (*Client) GetProjectCardTable ¶
GetProjectCardTable fetches the card table for a project
func (*Client) GetProjectPeople ¶
GetProjectPeople fetches all people associated with a project
func (*Client) GetProjectTodoSet ¶
GetProjectTodoSet fetches the todo set for a project
func (*Client) GetProjects ¶
GetProjects fetches all projects for the account (handles pagination)
func (*Client) GetTodoGroups ¶
func (c *Client) GetTodoGroups(ctx context.Context, projectID string, todoListID int64) ([]TodoGroup, error)
GetTodoGroups fetches all groups in a todo list
func (*Client) GetTodoList ¶
func (c *Client) GetTodoList(ctx context.Context, projectID string, todoListID int64) (*TodoList, error)
GetTodoList fetches a single todo list by ID
func (*Client) GetTodoLists ¶
func (c *Client) GetTodoLists(ctx context.Context, projectID string, todoSetID int64) ([]TodoList, error)
GetTodoLists fetches all todo lists in a todo set
func (*Client) ListCampfires ¶
ListCampfires returns all campfires for a project
func (*Client) ListMessageCategories ¶ added in v0.5.0
func (c *Client) ListMessageCategories(ctx context.Context, projectID string, messageBoardID int64) ([]MessageCategory, error)
ListMessageCategories returns all categories for a message board
func (*Client) ListMessages ¶ added in v0.5.0
func (c *Client) ListMessages(ctx context.Context, projectID string, messageBoardID int64) ([]Message, error)
ListMessages returns all messages on a message board
func (*Client) MoveCard ¶
func (c *Client) MoveCard(ctx context.Context, projectID string, cardID int64, columnID int64) error
MoveCard moves a card to a different column
func (*Client) MoveColumn ¶
func (c *Client) MoveColumn(ctx context.Context, projectID string, cardTableID int64, sourceID, targetID int64, position string) error
MoveColumn moves a column to a different position
func (*Client) MoveStep ¶
func (c *Client) MoveStep(ctx context.Context, projectID string, cardID int64, stepID int64, position int) error
MoveStep repositions a step within a card
func (*Client) PostCampfireLine ¶
func (c *Client) PostCampfireLine(ctx context.Context, projectID string, campfireID int64, content string) (*CampfireLine, error)
PostCampfireLine posts a new message to a campfire
func (*Client) SetColumnColor ¶
func (c *Client) SetColumnColor(ctx context.Context, projectID string, columnID int64, color string) error
SetColumnColor sets the color of a column
func (*Client) SetStepCompletion ¶
func (c *Client) SetStepCompletion(ctx context.Context, projectID string, stepID int64, completed bool) error
SetStepCompletion sets the completion status of a step
func (*Client) UncompleteTodo ¶
UncompleteTodo marks a todo as incomplete
func (*Client) UpdateCard ¶
func (c *Client) UpdateCard(ctx context.Context, projectID string, cardID int64, req CardUpdateRequest) (*Card, error)
UpdateCard updates a card
func (*Client) UpdateColumn ¶
func (c *Client) UpdateColumn(ctx context.Context, projectID string, columnID int64, req ColumnUpdateRequest) (*Column, error)
UpdateColumn updates a column
func (*Client) UpdateMessage ¶ added in v0.5.0
func (c *Client) UpdateMessage(ctx context.Context, projectID string, messageID int64, req MessageUpdateRequest) (*Message, error)
UpdateMessage updates an existing message
func (*Client) UpdateStep ¶
func (c *Client) UpdateStep(ctx context.Context, projectID string, stepID int64, req StepUpdateRequest) (*Step, error)
UpdateStep updates a step
type Column ¶
type Column struct {
ID int64 `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Type string `json:"type"`
Color string `json:"color,omitempty"`
Status string `json:"status"`
OnHold bool `json:"on_hold"`
CardsCount int `json:"cards_count"`
CardsURL string `json:"cards_url"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Column represents a column in a card table
type ColumnColorRequest ¶
type ColumnColorRequest struct {
Color string `json:"color"`
}
ColumnColorRequest represents the payload for changing a column's color
type ColumnCreateRequest ¶
type ColumnCreateRequest struct {
Title string `json:"title"`
Description string `json:"description,omitempty"`
}
ColumnCreateRequest represents the payload for creating a new column
type ColumnMoveRequest ¶
type ColumnMoveRequest struct {
SourceID int64 `json:"source_id"`
TargetID int64 `json:"target_id"`
Position string `json:"position,omitempty"` // "before" or "after"
}
ColumnMoveRequest represents the payload for moving a column
type ColumnOperations ¶
type ColumnOperations interface {
CreateColumn(ctx context.Context, projectID string, cardTableID int64, req ColumnCreateRequest) (*Column, error)
UpdateColumn(ctx context.Context, projectID string, columnID int64, req ColumnUpdateRequest) (*Column, error)
SetColumnColor(ctx context.Context, projectID string, columnID int64, color string) error
MoveColumn(ctx context.Context, projectID string, cardTableID int64, sourceID, targetID int64, position string) error
}
ColumnOperations defines column-specific operations
type ColumnUpdateRequest ¶
type ColumnUpdateRequest struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
}
ColumnUpdateRequest represents the payload for updating a column
type Message ¶ added in v0.5.0
type Message struct {
ID int64 `json:"id"`
Subject string `json:"subject"`
Content string `json:"content"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Creator Person `json:"creator"`
Parent struct {
ID int64 `json:"id"`
Title string `json:"title"`
Type string `json:"type"`
URL string `json:"url"`
} `json:"parent"`
Category *MessageCategory `json:"category"`
CommentsCount int `json:"comments_count"`
URL string `json:"url"`
}
Message represents a Basecamp message
type MessageBoard ¶ added in v0.5.0
type MessageBoard struct {
ID int64 `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
MessagesURL string `json:"messages_url"`
URL string `json:"url"`
MessagesCount int `json:"messages_count"`
Bucket struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
} `json:"bucket"`
Creator Person `json:"creator"`
}
MessageBoard represents a Basecamp message board
type MessageCategory ¶ added in v0.5.0
type MessageCategory struct {
ID int64 `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
Color string `json:"color"`
}
MessageCategory represents a message category
type MessageCreateRequest ¶ added in v0.5.0
type MessageCreateRequest struct {
Subject string `json:"subject"`
Content string `json:"content"`
Status string `json:"status,omitempty"` // draft or active
CategoryID *int64 `json:"category_id,omitempty"`
}
MessageCreateRequest represents the payload for creating a new message
type MessageUpdateRequest ¶ added in v0.5.0
type MessageUpdateRequest struct {
Subject string `json:"subject,omitempty"`
Content string `json:"content,omitempty"`
CategoryID *int64 `json:"category_id,omitempty"`
}
MessageUpdateRequest represents the payload for updating a message
type ModularClient ¶
type ModularClient struct {
*Client // Embed the existing client for now
}
ModularClient provides access to all API operations through focused interfaces
func NewModularClient ¶
func NewModularClient(accountID, accessToken string) *ModularClient
NewModularClient creates a new modular client that exposes focused interfaces
func (*ModularClient) Campfires ¶
func (c *ModularClient) Campfires() CampfireOperations
Campfires returns the campfire operations interface
func (*ModularClient) Cards ¶
func (c *ModularClient) Cards() CardOperations
Cards returns the card operations interface
func (*ModularClient) Columns ¶
func (c *ModularClient) Columns() ColumnOperations
Columns returns the column operations interface
func (*ModularClient) People ¶
func (c *ModularClient) People() PeopleOperations
People returns the people operations interface
func (*ModularClient) Projects ¶
func (c *ModularClient) Projects() ProjectOperations
Projects returns the project operations interface
func (*ModularClient) Steps ¶
func (c *ModularClient) Steps() StepOperations
Steps returns the step operations interface
func (*ModularClient) Todos ¶
func (c *ModularClient) Todos() TodoOperations
Todos returns the todo operations interface
type PaginatedRequest ¶
type PaginatedRequest struct {
// contains filtered or unexported fields
}
PaginatedRequest handles paginated requests to the Basecamp API
func NewPaginatedRequest ¶
func NewPaginatedRequest(client *Client) *PaginatedRequest
NewPaginatedRequest creates a new paginated request handler
func (*PaginatedRequest) GetAll ¶
func (pr *PaginatedRequest) GetAll(path string, result interface{}) error
GetAll fetches all pages of results from a paginated endpoint The result parameter must be a pointer to a slice
type PeopleOperations ¶
type PeopleOperations interface {
GetProjectPeople(ctx context.Context, projectID string) ([]Person, error)
GetPerson(ctx context.Context, personID int64) (*Person, error)
}
PeopleOperations defines people-specific operations
type Person ¶
type Person struct {
ID int64 `json:"id"`
Name string `json:"name"`
EmailAddress string `json:"email_address"`
Title string `json:"title"`
AvatarURL string `json:"avatar_url"`
}
Person represents a Basecamp user
type Project ¶
type Project struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Purpose string `json:"purpose"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
Project represents a Basecamp project
type ProjectOperations ¶
type ProjectOperations interface {
GetProjects(ctx context.Context) ([]Project, error)
GetProject(ctx context.Context, projectID string) (*Project, error)
}
ProjectOperations defines project-specific operations
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter implements a token bucket algorithm for rate limiting Basecamp allows 50 requests per 10 seconds
func GetRateLimiter ¶
func GetRateLimiter() *RateLimiter
GetRateLimiter returns the global rate limiter instance
func NewRateLimiter ¶
func NewRateLimiter(maxTokens int, refillDuration time.Duration) *RateLimiter
NewRateLimiter creates a new rate limiter
func (*RateLimiter) Reset ¶
func (rl *RateLimiter) Reset()
Reset resets the rate limiter to full capacity
func (*RateLimiter) TryAcquire ¶
func (rl *RateLimiter) TryAcquire() bool
TryAcquire attempts to acquire a token without blocking
type Step ¶
type Step struct {
ID int64 `json:"id"`
Title string `json:"title"`
Status string `json:"status"`
Completed bool `json:"completed"`
DueOn *string `json:"due_on,omitempty"`
Assignees []Person `json:"assignees"`
Creator *Person `json:"creator"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Step represents a step within a card
type StepCompletionRequest ¶
type StepCompletionRequest struct {
Completion string `json:"completion"` // "on" or "off"
}
StepCompletionRequest represents the payload for changing step completion
type StepCreateRequest ¶
type StepCreateRequest struct {
Title string `json:"title"`
DueOn *string `json:"due_on,omitempty"`
Assignees string `json:"assignees,omitempty"` // comma-separated list of person IDs
}
StepCreateRequest represents the payload for creating a new step
type StepOperations ¶
type StepOperations interface {
CreateStep(ctx context.Context, projectID string, cardID int64, req StepCreateRequest) (*Step, error)
UpdateStep(ctx context.Context, projectID string, stepID int64, req StepUpdateRequest) (*Step, error)
SetStepCompletion(ctx context.Context, projectID string, stepID int64, completed bool) error
MoveStep(ctx context.Context, projectID string, cardID int64, stepID int64, position int) error
DeleteStep(ctx context.Context, projectID string, stepID int64) error
}
StepOperations defines card step-specific operations
type StepPositionRequest ¶
type StepPositionRequest struct {
SourceID int64 `json:"source_id"`
Position int `json:"position"` // zero-indexed
}
StepPositionRequest represents the payload for repositioning a step
type StepUpdateRequest ¶
type StepUpdateRequest struct {
Title string `json:"title,omitempty"`
DueOn *string `json:"due_on,omitempty"`
Assignees string `json:"assignees,omitempty"`
}
StepUpdateRequest represents the payload for updating a step
type Todo ¶
type Todo struct {
ID int64 `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
Description string `json:"description"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Completed bool `json:"completed"`
DueOn *string `json:"due_on"`
StartsOn *string `json:"starts_on"`
TodolistID int64 `json:"todolist_id"`
Creator *Person `json:"creator"`
Assignees []Person `json:"assignees"`
}
Todo represents a Basecamp todo item
type TodoCreateRequest ¶
type TodoCreateRequest struct {
Content string `json:"content"`
Description string `json:"description,omitempty"`
DueOn *string `json:"due_on,omitempty"`
StartsOn *string `json:"starts_on,omitempty"`
AssigneeIDs []int64 `json:"assignee_ids,omitempty"`
}
TodoCreateRequest represents the payload for creating a new todo
type TodoGroup ¶
type TodoGroup struct {
ID int64 `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Description string `json:"description"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Completed bool `json:"completed"`
CompletedRatio string `json:"completed_ratio"`
TodosCount int `json:"todos_count"`
TodosURL string `json:"todos_url"`
Position int `json:"position"`
}
TodoGroup represents a group of todos within a todo list
type TodoList ¶
type TodoList struct {
ID int64 `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Description string `json:"description"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Completed bool `json:"completed"`
CompletedRatio string `json:"completed_ratio"`
TodosCount int `json:"todos_count"`
TodosURL string `json:"todos_url"`
GroupsURL string `json:"groups_url"`
}
TodoList represents a Basecamp todo list
type TodoListCreateRequest ¶
type TodoListCreateRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
}
TodoListCreateRequest represents the payload for creating a new todo list
type TodoOperations ¶
type TodoOperations interface {
GetProjectTodoSet(ctx context.Context, projectID string) (*TodoSet, error)
GetTodoLists(ctx context.Context, projectID string, todoSetID int64) ([]TodoList, error)
GetTodoList(ctx context.Context, projectID string, todoListID int64) (*TodoList, error)
GetTodos(ctx context.Context, projectID string, todoListID int64) ([]Todo, error)
GetAllTodos(ctx context.Context, projectID string, todoListID int64) ([]Todo, error)
GetTodo(ctx context.Context, projectID string, todoID int64) (*Todo, error)
GetTodoGroups(ctx context.Context, projectID string, todoListID int64) ([]TodoGroup, error)
CreateTodo(ctx context.Context, projectID string, todoListID int64, req TodoCreateRequest) (*Todo, error)
CreateTodoList(ctx context.Context, projectID string, todoSetID int64, req TodoListCreateRequest) (*TodoList, error)
CompleteTodo(ctx context.Context, projectID string, todoID int64) error
UncompleteTodo(ctx context.Context, projectID string, todoID int64) error
}
TodoOperations defines todo-specific operations