Documentation
¶
Index ¶
- type Client
- func (pc *Client) CreateProject(name, description, teamID string) (*core.Project, error)
- func (pc *Client) GetProject(projectID string) (*core.Project, error)
- func (pc *Client) ListAllProjects(limit int) ([]core.Project, error)
- func (pc *Client) ListByTeam(teamID string, limit int) ([]core.Project, error)
- func (pc *Client) ListUserProjects(userID string, limit int) ([]core.Project, error)
- func (pc *Client) RemoveProjectMetadataKey(projectID, key string) error
- func (pc *Client) UpdateProject(projectID string, input UpdateProjectInput) (*core.Project, error)
- func (pc *Client) UpdateProjectDescription(projectID, newContent string) error
- func (pc *Client) UpdateProjectMetadataKey(projectID, key string, value interface{}) error
- func (pc *Client) UpdateProjectState(projectID, state string) error
- type UpdateProjectInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
ProjectClient handles all project-related operations for the Linear API. It uses the shared BaseClient for HTTP communication and focuses on project management functionality.
func NewClient ¶
func NewClient(base *core.BaseClient) *Client
NewProjectClient creates a new project client with the provided base client
func (*Client) CreateProject ¶
CreateProject creates a new project in Linear Why: Projects are containers for organizing related issues. This method enables project creation with proper team assignment.
func (*Client) GetProject ¶
GetProject retrieves a single project by ID Why: This is the primary method for fetching detailed project information including associated issues and metadata.
func (*Client) ListAllProjects ¶
ListAllProjects retrieves all projects in the workspace Why: Users need to discover available projects. This method provides a complete list with optional limiting for performance.
func (*Client) ListByTeam ¶
ListByTeam retrieves projects for a specific team Why: Teams often have many projects. Filtering by team makes it easier to find relevant projects without seeing all org-wide projects.
func (*Client) ListUserProjects ¶
ListUserProjects retrieves projects that have issues assigned to a specific user Why: Users often want to see only projects they're actively working on. This method filters projects based on issue assignments.
func (*Client) RemoveProjectMetadataKey ¶
RemoveProjectMetadataKey removes a specific metadata key from a project Why: Metadata keys may become obsolete. This method allows selective removal without affecting other metadata. Note: Uses 'content' field instead of 'description' to avoid 255 char limit.
func (*Client) UpdateProject ¶
UpdateProject updates a project with the provided input Supports updating name, description, state, lead, start date, and target date
func (*Client) UpdateProjectDescription ¶
UpdateProjectDescription updates a project's content while preserving metadata Why: Project content may contain both user content and metadata. This method ensures metadata is preserved during content updates. Note: Linear has two fields - 'description' (255 char limit) and 'content' (no limit). We use 'content' for longer text to avoid the character limit.
func (*Client) UpdateProjectMetadataKey ¶
UpdateProjectMetadataKey updates a specific metadata key for a project Why: Granular metadata updates allow changing individual values without affecting other metadata. This is more efficient than full replacements. Note: Uses 'content' field instead of 'description' to avoid 255 char limit.
func (*Client) UpdateProjectState ¶
UpdateProjectState updates the state of a project Why: Projects have states (planned, started, completed, etc.) that need to be updated as work progresses. This method provides that capability.
type UpdateProjectInput ¶
type UpdateProjectInput struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Content *string `json:"content,omitempty"`
State *string `json:"state,omitempty"`
LeadID *string `json:"leadId,omitempty"`
StartDate *string `json:"startDate,omitempty"`
TargetDate *string `json:"targetDate,omitempty"`
}
UpdateProjectInput represents the input for updating a project