api

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachmentsService

type AttachmentsService struct {
	// contains filtered or unexported fields
}

AttachmentsService handles communication with the issue attachment related endpoints

func NewAttachmentsService

func NewAttachmentsService(client *client.Client) *AttachmentsService

NewAttachmentsService creates a new attachments service

func (*AttachmentsService) CompleteUpload

func (s *AttachmentsService) CompleteUpload(workspaceSlug string, projectID string, issueID string, assetID string) (*models.Attachment, error)

CompleteUpload completes the upload process by notifying the API that the file has been uploaded

func (*AttachmentsService) GetUploadCredentials

func (s *AttachmentsService) GetUploadCredentials(workspaceSlug string, projectID string, issueID string, filename string, fileType string, fileSize int64) (*models.UploadCredentials, error)

GetUploadCredentials gets credentials to upload a file directly to cloud storage

func (*AttachmentsService) List

func (s *AttachmentsService) List(workspaceSlug string, projectID string, issueID string) ([]models.Attachment, error)

List returns all attachments for an issue

func (*AttachmentsService) UploadFile

func (s *AttachmentsService) UploadFile(uploadURL string, fields map[string]string, filePath string) error

UploadFile uploads a file to S3 using the provided credentials

func (*AttachmentsService) UploadFileToIssue

func (s *AttachmentsService) UploadFileToIssue(workspaceSlug string, projectID string, issueID string, filePath string) (*models.Attachment, error)

UploadFileToIssue uploads a file to an issue in a single step 一步完成文件上传到问题,包括获取上传凭证、上传文件和完成上传过程

type CommentRequest added in v0.3.0

type CommentRequest struct {
	CommentHTML string `json:"comment_html"`
	CreatedBy   string `json:"created_by,omitempty"` // ID of the member who created the comment
	Actor       string `json:"actor,omitempty"`      // ID of the member who updated the comment (used for update only)
	DisplayName string `json:"-"`                    // 成员显示名称,不会直接发送到API
}

CommentRequest represents the request body for creating or updating a comment

type CommentsService

type CommentsService struct {
	// contains filtered or unexported fields
}

CommentsService handles communication with the issue comments related endpoints

func NewCommentsService

func NewCommentsService(client *client.Client) *CommentsService

NewCommentsService creates a new comments service

func (*CommentsService) Create

func (s *CommentsService) Create(workspaceSlug string, projectID string, issueID string, request *CommentRequest) (*models.Comment, error)

Create creates a new comment 支持通过DisplayName或CreatedBy(MemberID)创建评论

func (*CommentsService) Delete

func (s *CommentsService) Delete(workspaceSlug string, projectID string, issueID string, commentID string) error

Delete deletes a comment

func (*CommentsService) Get

func (s *CommentsService) Get(workspaceSlug string, projectID string, issueID string, commentID string) (*models.Comment, error)

Get returns a comment by its ID

func (*CommentsService) List

func (s *CommentsService) List(workspaceSlug string, projectID string, issueID string) ([]models.Comment, error)

List returns all comments for an issue

func (*CommentsService) Update

func (s *CommentsService) Update(workspaceSlug string, projectID string, issueID string, commentID string, request *CommentRequest) (*models.Comment, error)

Update updates a comment 支持通过DisplayName或Actor(MemberID)更新评论

type CycleCreateRequest

type CycleCreateRequest struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	StartDate   string `json:"start_date,omitempty"`
	EndDate     string `json:"end_date,omitempty"`
}

CycleCreateRequest represents the request body for creating a cycle

type CycleIssueAddRequest

type CycleIssueAddRequest struct {
	Issues []string `json:"issues"`
}

CycleIssueAddRequest represents the request body for adding issues to a cycle

type CycleUpdateRequest

type CycleUpdateRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	StartDate   string `json:"start_date,omitempty"`
	EndDate     string `json:"end_date,omitempty"`
}

CycleUpdateRequest represents the request body for updating a cycle

type CyclesService

type CyclesService struct {
	// contains filtered or unexported fields
}

CyclesService handles communication with the cycle related endpoints

func NewCyclesService

func NewCyclesService(client *client.Client) *CyclesService

NewCyclesService creates a new cycles service

func (*CyclesService) AddIssues

func (s *CyclesService) AddIssues(workspaceSlug string, projectID string, cycleID string, issueIDs []string) error

AddIssues adds issues to a cycle

func (*CyclesService) Create

func (s *CyclesService) Create(workspaceSlug string, projectID string, createRequest *CycleCreateRequest) (*models.Cycle, error)

Create creates a new cycle

func (*CyclesService) Delete

func (s *CyclesService) Delete(workspaceSlug string, projectID string, cycleID string) error

Delete deletes a cycle

func (*CyclesService) Get

func (s *CyclesService) Get(workspaceSlug string, projectID string, cycleID string) (*models.Cycle, error)

Get returns a cycle by its ID

func (*CyclesService) List

func (s *CyclesService) List(workspaceSlug string, projectID string) ([]models.Cycle, error)

List returns all cycles in a project

func (*CyclesService) ListIssues

func (s *CyclesService) ListIssues(workspaceSlug string, projectID string, cycleID string) ([]models.Issue, error)

ListIssues returns all issues in a cycle

func (*CyclesService) RemoveIssue

func (s *CyclesService) RemoveIssue(workspaceSlug string, projectID string, cycleID string, issueID string) error

RemoveIssue removes an issue from a cycle

func (*CyclesService) Update

func (s *CyclesService) Update(workspaceSlug string, projectID string, cycleID string, updateRequest *CycleUpdateRequest) (*models.Cycle, error)

Update updates a cycle

type IssueCreateRequest

type IssueCreateRequest struct {
	Name          string   `json:"name"`
	Description   string   `json:"description,omitempty"`
	State         string   `json:"state,omitempty"` // 状态ID
	StateName     string   `json:"-"`               // 状态名称 (不发送到API)
	Priority      string   `json:"priority,omitempty"`
	AssigneeID    string   `json:"-"`                   // 分配人ID (不直接发送到API)
	Assignees     []string `json:"assignees,omitempty"` // 多个分配人ID
	AssigneeNames []string `json:"-"`                   // 多个分配人名称 (不发送到API)
}

IssueCreateRequest represents the request body for creating an issue

type IssueUpdateRequest

type IssueUpdateRequest struct {
	Name          string   `json:"name,omitempty"`
	Description   string   `json:"description,omitempty"`
	State         string   `json:"state,omitempty"` // 状态ID
	StateName     string   `json:"-"`               // 状态名称 (不发送到API)
	Priority      string   `json:"priority,omitempty"`
	AssigneeID    string   `json:"-"`                   // 分配人ID (不直接发送到API)
	Assignees     []string `json:"assignees,omitempty"` // 多个分配人ID
	AssigneeNames []string `json:"-"`                   // 多个分配人名称 (不发送到API)
}

IssueUpdateRequest represents the request body for updating an issue

type IssuesService

type IssuesService struct {
	// contains filtered or unexported fields
}

IssuesService handles communication with the issue related endpoints

func NewIssuesService

func NewIssuesService(client *client.Client) *IssuesService

NewIssuesService creates a new issues service

func (*IssuesService) Create

func (s *IssuesService) Create(workspaceSlug string, projectID string, createRequest *IssueCreateRequest) (*models.Issue, error)

Create creates a new issue

func (*IssuesService) Delete

func (s *IssuesService) Delete(workspaceSlug string, projectID string, issueID string) error

Delete deletes an issue

func (*IssuesService) Get

func (s *IssuesService) Get(workspaceSlug string, projectID string, issueID string) (*models.Issue, error)

Get returns an issue by its ID

func (*IssuesService) GetBySequenceID

func (s *IssuesService) GetBySequenceID(workspaceSlug string, sequenceID string) (*models.Issue, error)

GetBySequenceID returns an issue by its sequence ID

func (*IssuesService) List

func (s *IssuesService) List(workspaceSlug string, projectID string) ([]models.Issue, error)

List returns all issues in a project

func (*IssuesService) Update

func (s *IssuesService) Update(workspaceSlug string, projectID string, issueID string, updateRequest *IssueUpdateRequest) (*models.Issue, error)

Update updates an issue

func (*IssuesService) UpdateBySequenceID added in v0.3.0

func (s *IssuesService) UpdateBySequenceID(workspaceSlug string, sequenceID string, updateRequest *IssueUpdateRequest) (*models.Issue, error)

UpdateBySequenceID updates an issue by its sequence ID

type LabelCreateRequest

type LabelCreateRequest struct {
	Name        string  `json:"name"`
	Description string  `json:"description,omitempty"`
	Color       string  `json:"color,omitempty"`
	Parent      *string `json:"parent,omitempty"`
}

LabelCreateRequest represents the request body for creating a label

type LabelUpdateRequest

type LabelUpdateRequest struct {
	Name        string  `json:"name,omitempty"`
	Description string  `json:"description,omitempty"`
	Color       string  `json:"color,omitempty"`
	Parent      *string `json:"parent,omitempty"`
}

LabelUpdateRequest represents the request body for updating a label

type LabelsService

type LabelsService struct {
	// contains filtered or unexported fields
}

LabelsService handles communication with the label related endpoints

func NewLabelsService

func NewLabelsService(client *client.Client) *LabelsService

NewLabelsService creates a new labels service

func (*LabelsService) Create

func (s *LabelsService) Create(workspaceSlug string, projectID string, createRequest *LabelCreateRequest) (*models.Label, error)

Create creates a new label

func (*LabelsService) Delete

func (s *LabelsService) Delete(workspaceSlug string, projectID string, labelID string) error

Delete deletes a label

func (*LabelsService) Get

func (s *LabelsService) Get(workspaceSlug string, projectID string, labelID string) (*models.Label, error)

Get returns a label by its ID

func (*LabelsService) List

func (s *LabelsService) List(workspaceSlug string, projectID string) ([]models.Label, error)

List returns all labels in a project

func (*LabelsService) Update

func (s *LabelsService) Update(workspaceSlug string, projectID string, labelID string, updateRequest *LabelUpdateRequest) (*models.Label, error)

Update updates a label

type LinkCreateRequest

type LinkCreateRequest struct {
	Title string `json:"title,omitempty"`
	URL   string `json:"url"`
}

LinkCreateRequest represents the request body for creating a link

type LinkUpdateRequest

type LinkUpdateRequest struct {
	Title string `json:"title,omitempty"`
	URL   string `json:"url,omitempty"`
}

LinkUpdateRequest represents the request body for updating a link

type LinksService

type LinksService struct {
	// contains filtered or unexported fields
}

LinksService handles communication with the issue links related endpoints

func NewLinksService

func NewLinksService(client *client.Client) *LinksService

NewLinksService creates a new links service

func (*LinksService) Create

func (s *LinksService) Create(workspaceSlug string, projectID string, issueID string, createRequest *LinkCreateRequest) (*models.Link, error)

Create creates a new link

func (*LinksService) Delete

func (s *LinksService) Delete(workspaceSlug string, projectID string, issueID string, linkID string) error

Delete deletes a link

func (*LinksService) Get

func (s *LinksService) Get(workspaceSlug string, projectID string, issueID string, linkID string) (*models.Link, error)

Get returns a link by its ID

func (*LinksService) List

func (s *LinksService) List(workspaceSlug string, projectID string, issueID string) ([]models.Link, error)

List returns all links for an issue

func (*LinksService) Update

func (s *LinksService) Update(workspaceSlug string, projectID string, issueID string, linkID string, updateRequest *LinkUpdateRequest) (*models.Link, error)

Update updates a link

type MemberUserResponse added in v0.3.0

type MemberUserResponse struct {
	ID          string      `json:"id"`
	FirstName   string      `json:"first_name"`
	LastName    string      `json:"last_name"`
	Email       string      `json:"email"`
	Avatar      string      `json:"avatar"`
	AvatarURL   interface{} `json:"avatar_url"`
	DisplayName string      `json:"display_name"`
}

MemberUserResponse represents the simplified user response from the members endpoint

type MembersService added in v0.3.0

type MembersService struct {
	// contains filtered or unexported fields
}

MembersService handles communication with the project members related endpoints

func NewMembersService added in v0.3.0

func NewMembersService(client *client.Client) *MembersService

NewMembersService creates a new members service

func (*MembersService) Get added in v0.3.0

func (s *MembersService) Get(workspaceSlug string, projectID string, memberID string) (*models.Member, error)

Get returns a member by its ID

func (*MembersService) List added in v0.3.0

func (s *MembersService) List(workspaceSlug string, projectID string) ([]models.Member, error)

List returns all members for a project

type ModuleCreateRequest

type ModuleCreateRequest struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

ModuleCreateRequest represents the request body for creating a module

type ModuleIssueAddRequest

type ModuleIssueAddRequest struct {
	Issues []string `json:"issues"`
}

ModuleIssueAddRequest represents the request body for adding issues to a module

type ModuleUpdateRequest

type ModuleUpdateRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

ModuleUpdateRequest represents the request body for updating a module

type ModulesService

type ModulesService struct {
	// contains filtered or unexported fields
}

ModulesService handles communication with the module related endpoints

func NewModulesService

func NewModulesService(client *client.Client) *ModulesService

NewModulesService creates a new modules service

func (*ModulesService) AddIssues

func (s *ModulesService) AddIssues(workspaceSlug string, projectID string, moduleID string, issueIDs []string) error

AddIssues adds issues to a module

func (*ModulesService) Create

func (s *ModulesService) Create(workspaceSlug string, projectID string, createRequest *ModuleCreateRequest) (*models.Module, error)

Create creates a new module

func (*ModulesService) Delete

func (s *ModulesService) Delete(workspaceSlug string, projectID string, moduleID string) error

Delete deletes a module

func (*ModulesService) Get

func (s *ModulesService) Get(workspaceSlug string, projectID string, moduleID string) (*models.Module, error)

Get returns a module by its ID

func (*ModulesService) List

func (s *ModulesService) List(workspaceSlug string, projectID string) ([]models.Module, error)

List returns all modules in a project

func (*ModulesService) ListIssues

func (s *ModulesService) ListIssues(workspaceSlug string, projectID string, moduleID string) ([]models.Issue, error)

ListIssues returns all issues in a module

func (*ModulesService) RemoveIssue

func (s *ModulesService) RemoveIssue(workspaceSlug string, projectID string, moduleID string, issueID string) error

RemoveIssue removes an issue from a module

func (*ModulesService) Update

func (s *ModulesService) Update(workspaceSlug string, projectID string, moduleID string, updateRequest *ModuleUpdateRequest) (*models.Module, error)

Update updates a module

type ProjectCreateRequest

type ProjectCreateRequest struct {
	Name        string `json:"name"`
	Identifier  string `json:"identifier"`
	Description string `json:"description,omitempty"`
}

ProjectCreateRequest represents the request body for creating a project

type ProjectUpdateRequest

type ProjectUpdateRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

ProjectUpdateRequest represents the request body for updating a project

type ProjectsService

type ProjectsService struct {
	// contains filtered or unexported fields
}

ProjectsService handles communication with the project related endpoints

func NewProjectsService

func NewProjectsService(client *client.Client) *ProjectsService

NewProjectsService creates a new projects service

func (*ProjectsService) Create

func (s *ProjectsService) Create(workspaceSlug string, createRequest *ProjectCreateRequest) (*models.Project, error)

Create creates a new project

func (*ProjectsService) Delete

func (s *ProjectsService) Delete(workspaceSlug string, projectID string) error

Delete deletes a project

func (*ProjectsService) Get

func (s *ProjectsService) Get(workspaceSlug string, projectID string) (*models.Project, error)

Get returns a project by its ID

func (*ProjectsService) List

func (s *ProjectsService) List(workspaceSlug string) ([]models.Project, error)

List returns all projects in a workspace

func (*ProjectsService) Update

func (s *ProjectsService) Update(workspaceSlug string, projectID string, updateRequest *ProjectUpdateRequest) (*models.Project, error)

Update updates a project

type StateCreateRequest

type StateCreateRequest struct {
	Name        string `json:"name"`
	Color       string `json:"color"`
	Description string `json:"description,omitempty"`
}

StateCreateRequest represents the request body for creating a state

type StateUpdateRequest

type StateUpdateRequest struct {
	Name        string `json:"name,omitempty"`
	Color       string `json:"color,omitempty"`
	Description string `json:"description,omitempty"`
}

StateUpdateRequest represents the request body for updating a state

type StatesService

type StatesService struct {
	// contains filtered or unexported fields
}

StatesService handles communication with the state related endpoints

func NewStatesService

func NewStatesService(client *client.Client) *StatesService

NewStatesService creates a new states service

func (*StatesService) Create

func (s *StatesService) Create(workspaceSlug string, projectID string, createRequest *StateCreateRequest) (*models.State, error)

Create creates a new state

func (*StatesService) Delete

func (s *StatesService) Delete(workspaceSlug string, projectID string, stateID string) error

Delete deletes a state

func (*StatesService) Get

func (s *StatesService) Get(workspaceSlug string, projectID string, stateID string) (*models.State, error)

Get returns a state by its ID

func (*StatesService) List

func (s *StatesService) List(workspaceSlug string, projectID string) ([]models.State, error)

List returns all states in a project

func (*StatesService) Update

func (s *StatesService) Update(workspaceSlug string, projectID string, stateID string, updateRequest *StateUpdateRequest) (*models.State, error)

Update updates a state

type UploadCredentialsRequest

type UploadCredentialsRequest struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Size int64  `json:"size"`
}

UploadCredentialsRequest represents the request body for getting upload credentials

type WorklogCreateRequest

type WorklogCreateRequest struct {
	Description string `json:"description"`
	Duration    int    `json:"duration"` // Duration in minutes
}

WorklogCreateRequest represents the request body for creating a worklog

type WorklogUpdateRequest

type WorklogUpdateRequest struct {
	Description string `json:"description,omitempty"`
	Duration    int    `json:"duration,omitempty"` // Duration in minutes
}

WorklogUpdateRequest represents the request body for updating a worklog

type WorklogsService

type WorklogsService struct {
	// contains filtered or unexported fields
}

WorklogsService handles communication with the worklog related endpoints

func NewWorklogsService

func NewWorklogsService(client *client.Client) *WorklogsService

NewWorklogsService creates a new worklogs service

func (*WorklogsService) Create

func (s *WorklogsService) Create(workspaceSlug string, projectID string, issueID string, createRequest *WorklogCreateRequest) (*models.Worklog, error)

Create creates a new worklog for an issue

func (*WorklogsService) Delete

func (s *WorklogsService) Delete(workspaceSlug string, projectID string, issueID string, worklogID string) error

Delete deletes a worklog

func (*WorklogsService) Get

func (s *WorklogsService) Get(workspaceSlug string, projectID string, issueID string, worklogID string) (*models.Worklog, error)

Get returns a single worklog by ID

func (*WorklogsService) GetTotalTime

func (s *WorklogsService) GetTotalTime(workspaceSlug string, projectID string) ([]models.WorklogTotal, error)

GetTotalTime returns the total time spent for all issues in a project

func (*WorklogsService) List

func (s *WorklogsService) List(workspaceSlug string, projectID string, issueID string) ([]models.Worklog, error)

List returns all worklogs for an issue

func (*WorklogsService) Update

func (s *WorklogsService) Update(workspaceSlug string, projectID string, issueID string, worklogID string, updateRequest *WorklogUpdateRequest) (*models.Worklog, error)

Update updates a worklog

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL