clubhouse

package module
v0.0.0-...-ccc0765 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoryTypeFeature string = "feature"
	StoryTypeBug     string = "bug"
	StoryTypeChore   string = "chore"
)
View Source
const DefaultURL = "https://api.clubhouse.io/api/v3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	CreatedAt       string        `json:"created_at"`
	Deleted         bool          `json:"deleted"`
	EntityType      string        `json:"entity_type"`
	ID              int64         `json:"id"`
	MergedBranchIDs []int64       `json:"merged_branch_ids"`
	Name            string        `json:"name"`
	Persistent      bool          `json:"persistent"`
	PullRequests    []PullRequest `json:"pull_requests"`
	RepositoryID    int64         `json:"repository_id"`
	UpdatedAt       string        `json:"updated_at"`
	URL             string        `json:"url"`
}

type Client

type Client struct {
	Debug      bool
	HTTPClient *http.Client
	Token      string
	URL        string
}

func New

func New(token string) *Client

func (*Client) AddLabelToMultipleStories

func (c *Client) AddLabelToMultipleStories(ids []int64, params CreateLabelParams) error

func (*Client) CreateEpic

func (c *Client) CreateEpic(params CreateEpicParams) (*Epic, error)

func (*Client) ListEpics

func (c *Client) ListEpics() ([]Epic, error)

func (*Client) ListProjects

func (c *Client) ListProjects() ([]*Project, error)

func (*Client) ListStoriesForProject

func (c *Client) ListStoriesForProject(id string) ([]Story, error)

func (*Client) ListWorkflows

func (c *Client) ListWorkflows() ([]Workflow, error)

func (*Client) StoriesCreate

func (c *Client) StoriesCreate(params []CreateStoryParams) ([]*Story, error)

func (*Client) StoriesDelete

func (c *Client) StoriesDelete(storyIds []int64) error

func (*Client) StoryArchive

func (c *Client) StoryArchive(storyId int64) (*Story, error)

func (*Client) StoryCreate

func (c *Client) StoryCreate(param CreateStoryParams) (*Story, error)

func (*Client) StoryDelete

func (c *Client) StoryDelete(storyId int64) error

func (*Client) StoryGet

func (c *Client) StoryGet(storyId int64) (*Story, error)

type Comment

type Comment struct {
	AppURL           string    `json:"app_url"`
	AuthorID         string    `json:"author_id"`
	Comments         []Comment `json:"comments"`
	CreatedAt        string    `json:"created_at"`
	Deleted          bool      `json:"deleted"`
	EntityType       string    `json:"entity_type"`
	ExternalID       string    `json:"external_id"`
	GroupMentionIDs  []string  `json:"group_mention_ids"`
	ID               int64     `json:"id"`
	MemberMentionIDs []string  `json:"member_mention_ids"`
	MentionIDs       []string  `json:"mention_ids"`
	Text             string    `json:"text"`
	UpdatedAt        string    `json:"updated_at"`
}

type Commit

type Commit struct {
	AuthorEmail     string   `json:"author_email"`
	AuthorID        string   `json:"author_id"`
	AuthorIdentity  Identity `json:"author_identity"`
	CreatedAt       string   `json:"created_at"`
	EntityType      string   `json:"entity_type"`
	Hash            string   `json:"hash"`
	ID              int64    `json:"id"`
	MergedBranchIDs []int64  `json:"merged_branch_ids"`
	Message         string   `json:"message"`
	RepositoryID    int64    `json:"repository_id"`
	Timestamp       string   `json:"timestamp"`
	UpdatedAt       string   `json:"updated_at"`
	URL             string   `json:"url"`
}

type CreateCommentParams

type CreateCommentParams struct {
	AuthorID   *string    `json:"author_id,omitempty"`
	CreatedAt  *time.Time `json:"created_at,omitempty"`
	ExternalID *string    `json:"external_id,omitempty"`
	Text       string     `json:"text"`
	UpdatedAt  *time.Time `json:"updated_at"`
}

type CreateEpicParams

type CreateEpicParams struct {
	// Required
	Name          string `json:"name"`
	Description   string `json:"description"`
	RequestedByID string `json:"requested_by_id"`

	// Optional
	CompletedAtOverride *time.Time          `json:"completed_at_override,omitempty"`
	CreatedAt           time.Time           `json:"created_at,omitempty"`
	Deadline            *time.Time          `json:"deadline,omitempty"`
	EpicStateID         int64               `json:"epic_state_id,omitempty"`
	ExternalID          string              `json:"external_id,omitempty"`
	FollowerIDs         []string            `json:"follower_ids,omitempty"`
	Labels              []CreateLabelParams `json:"labels,omitempty"`
	MilestoneID         int64               `json:"milestone_id,omitempty"`
	OwnerIDs            []string            `json:"owner_ids,omitempty"`
	PlannedStartDate    *time.Time          `json:"planned_start_date,omitempty"`
	StartedAtOverride   *time.Time          `json:"started_at_override,omitempty"`
	UpdatedAt           *time.Time          `json:"updated_at,omitempty"`
}

type CreateExternalTicketParams

type CreateExternalTicketParams struct {
	// Optional
	ExternalID  *string `json:"external_id,omitempty"`
	ExternalURL *string `json:"external_url,omitempty"`
}

type CreateLabelParams

type CreateLabelParams struct {
	// Required
	Name string `json:"name"`

	// Optional
	Color       *string `json:"color,omitempty"`
	Description *string `json:"description,omitempty"`
	ExternalID  *string `json:"external_id,omitempty"`
}

type CreateStoryCommentParams

type CreateStoryCommentParams struct {
	// Required
	Text string `json:"text"`

	// Optional
	AuthorID   *string    `json:"author_id,omitempty"`
	CreatedAt  *time.Time `json:"created_at,omitempty"`
	ExternalID *string    `json:"external_id,omitempty"`
	UpdatedAt  *time.Time `json:"updated_at,omitempty"`
}

type CreateStoryLinkParams

type CreateStoryLinkParams struct {
	// Required
	ObjectID  int64  `json:"object_id"`
	SubjectID int64  `json:"subject_id"`
	Verb      string `json:"verb"`
}

type CreateStoryParams

type CreateStoryParams struct {
	// Required
	Name        string `json:"name"`
	Description string `json:"description"`
	ProjectID   int64  `json:"project_id"`
	Archived    bool   `json:"archived"`
	StoryType   string `json:"story_type"`

	// Optional
	Comments            []CreateStoryCommentParams   `json:"comments,omitempty"`
	CompletedAtOverride *time.Time                   `json:"completed_at_override,omitempty"`
	CreatedAt           *time.Time                   `json:"created_at,omitempty"`
	Deadline            *time.Time                   `json:"deadline,omitempty"`
	EpicID              *int64                       `json:"epic_id,omitempty"`
	Estimate            *int64                       `json:"estimate,omitempty"`
	ExternalID          *string                      `json:"external_id,omitempty"`
	ExternalTickets     []CreateExternalTicketParams `json:"external_tickets,omitempty"`
	FileIDs             []int64                      `json:"file_ids,omitempty"`
	FollowerIDs         []string                     `json:"follower_ids,omitempty"`
	IterationID         *int64                       `json:"iteration_id,omitempty"`
	Labels              []CreateLabelParams          `json:"labels,omitempty"`
	LinkedFileIDs       []int64                      `json:"linked_file_ids,omitempty"`
	OwnerIDs            []string                     `json:"owner_ids,omitempty"`
	RequestedByID       *string                      `json:"requested_by_id,omitempty"`
	StartedAtOverride   *time.Time                   `json:"started_at_override,omitempty"`
	StoryLinks          []CreateStoryLinkParams      `json:"story_links,omitempty"`
	Tasks               []CreateTaskParams           `json:"tasks,omitempty"`
	UpdatedAt           *time.Time                   `json:"updated_at,omitempty"`
	WorkflowStateID     *int64                       `json:"workflow_state_id,omitempty"`
}

type CreateTaskParams

type CreateTaskParams struct {
	// Required
	Complete    bool   `json:"complete"`
	Description string `json:"description"`

	// Optional
	CreatedAt  *time.Time `json:"created_at,omitempty"`
	ExternalID *string    `json:"external_id,omitempty"`
	OwnerIDs   []string   `json:"owner_ids,omitempty"`
	UpdatedAt  *time.Time `json:"updated_at,omitempty"`
}

type DeleteStoriesParam

type DeleteStoriesParam struct {
	StoryIds []int64 `json:"story_ids"`
}

type Epic

type Epic struct {
	AppURL              string           `json:"app_url"`
	Archived            bool             `json:"archived"`
	Comments            []Comment        `json:"comments"`
	Completed           bool             `json:"completed"`
	CompletedAt         time.Time        `json:"completed_at"`
	CompletedAtOverride time.Time        `json:"completed_at_override"`
	Deadline            time.Time        `json:"deadline"`
	Description         string           `json:"description"`
	EntityType          string           `json:"entity_type"`
	EpicStateID         int64            `json:"epic_state_id"`
	ExternalID          string           `json:"external_id"`
	ExternalTickets     []ExternalTicket `json:"external_tickets"`
	FollowerIDs         []string         `json:"follower_ids"`
	GroupMentionIDs     []string         `json:"group_mention_ids"`
	ID                  int64            `json:"id"`
	Labels              []Label          `json:"labels"`
	MemberMentionIDs    []string         `json:"member_mention_ids"`
	MentionIDs          []string         `json:"mention_ids"`
	MilestoneID         int64            `json:"milestone_id"`
	Name                string           `json:"name"`
	OwnerIDs            []string         `json:"owner_ids"`
	PlannedStartDate    time.Time        `json:"planned_start_date"`
	Position            int64            `json:"position"`
	ProjectIDs          []int64          `json:"project_ids"`
	RequestByID         string           `json:"requested_by_id"`
	Started             bool             `json:"started"`
	StartedAt           time.Time        `json:"started_at"`
	StartedAtOverride   time.Time        `json:"started_at_override"`
	State               string           `json:"state"` // Deprecated
	Stats               EpicStats        `json:"stats"`
	UpdatedAt           string           `json:"updated_at"`
	CreatedAt           time.Time        `json:"created_at"`
}

type EpicState

type EpicState struct {
	ID          int64     `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	EntityType  string    `json:"entity_type"`
	Type        string    `json:"type"`
	Color       string    `json:"color"`
	Position    int64     `json:"position"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type EpicStats

type EpicStats struct {
	AverageCycleTime      int64     `json:"average_cycle_time"`
	AverageLeadTime       int64     `json:"average_lead_time"`
	LastStoryUpdate       time.Time `json:"last_story_update"`
	NumPoints             int64     `json:"num_points"`
	NumPointsDone         int64     `json:"num_points_done"`
	NumPointsStarted      int64     `json:"num_points_started"`
	NumPointsUnstarted    int64     `json:"num_points_unstarted"`
	NumRelatedDocuments   int64     `json:"num_related_documents"`
	NumStoriesDone        int64     `json:"num_stories_done"`
	NumStoriesStarted     int64     `json:"num_stories_started"`
	NumStoriesUnestimated int64     `json:"num_stories_unestimated"`
	NumStoriesUnstarted   int64     `json:"num_stories_unstarted"`
}

type EpicWorkflow

type EpicWorkflow struct {
	ID                 int64       `json:"id"`
	EntityType         string      `json:"entity_type"`
	DefaultEpicStateId int64       `json:"default_epic_state_id"`
	EpicStates         []EpicState `json:"epic_states"`
	CreatedAt          time.Time   `json:"created_at"`
	UpdatedAt          time.Time   `json:"updated_at"`
}

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Tag     string `json:"tag"`
}

type ExternalTicket

type ExternalTicket struct {
	EpicIDs     []int64 `json:"epic_ids"`
	ExternalID  string  `json:"external_id"`
	ExternalURL string  `json:"external_url"`
	ID          string  `json:"id"`
	StoryIDs    []int64 `json:"story_ids"`
}

type File

type File struct {
	ContentType      string   `json:"content_type"`
	CreatedAt        string   `json:"created_at"`
	Description      string   `json:"description"`
	EntityType       string   `json:"entity_type"`
	ExternalID       string   `json:"external_id"`
	Filename         string   `json:"filename"`
	GroupMentionIDs  []string `json:"group_mention_ids"`
	ID               int64    `json:"id"`
	MemberMentionIDs []string `json:"member_mention_ids"`
	MentionIDs       []string `json:"mention_ids"`
	Name             string   `json:"name"`
	Size             int64    `json:"size"`
	StoryIDs         []int64  `json:"story_ids"`
	ThumbnailURL     string   `json:"thumbnail_url"`
	UpdatedAt        string   `json:"updated_at"`
	UploaderID       string   `json:"uploader_id"`
	URL              string   `json:"url"`
}

type Identity

type Identity struct {
	EntityType string `json:"entity_type"`
	Name       string `json:"name"`
	Type       string `json:"type"`
}

type Label

type Label struct {
	AppURL      string `json:"app_url"`
	Archived    bool   `json:"archived"`
	Color       string `json:"color"`
	CreatedAt   string `json:"created_at"`
	Description string `json:"description"`
	EntityType  string `json:"entity_type"`
	ExternalID  string `json:"external_id"`
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Stats       struct {
		NumEpics              int64 `json:"num_epics"`
		NumPointsCompleted    int64 `json:"num_points_completed"`
		NumPointsInProgress   int64 `json:"num_points_in_progress"`
		NumPointsTotal        int64 `json:"num_points_total"`
		NumRelatedDocuments   int64 `json:"num_related_documents"`
		NumStoriesCompleted   int64 `json:"num_stories_completed"`
		NumStoriesInProgress  int64 `json:"num_stories_in_progress"`
		NumStoriesTotal       int64 `json:"num_stories_total"`
		NumStoriesUnestimated int64 `json:"num_stories_unestimated"`
	} `json:"stats"`
	UpdatedAt string `json:"updated_at"`
}

type LinkedFile

type LinkedFile struct {
	ContentType      string   `json:"content_type"`
	CreatedAt        string   `json:"created_at"`
	Description      string   `json:"description"`
	EntityType       string   `json:"entity_type"`
	GroupMentionIDs  []string `json:"group_mention_ids"`
	ID               int64    `json:"id"`
	MemberMentionIDs []string `json:"member_mention_ids"`
	MentionIDs       []string `json:"mention_ids"`
	Name             string   `json:"name"`
	Size             int64    `json:"size"`
	StoryIDs         []int64  `json:"story_ids"`
	ThumbnailURL     string   `json:"thumbnail_url"`
	Type             string   `json:"type"`
	UpdatedAt        string   `json:"updated_at"`
	UploaderID       string   `json:"uploader_id"`
	URL              string   `json:"url"`
}

type Project

type Project struct {
	Abbreviation      string   `json:"abbreviation"`
	AppURL            string   `json:"app_url"`
	Archived          bool     `json:"archived"`
	Color             string   `json:"color"`
	CreatedAt         string   `json:"created_at"`
	DaysToThermometer int64    `json:"days_to_thermometer"`
	Description       string   `json:"description"`
	EntityType        string   `json:"entity_type"`
	ExternalID        string   `json:"external_id"`
	FollowerIDs       []string `json:"follower_ids"`
	ID                int64    `json:"id"`
	IterationLength   int64    `json:"iteration_length"`
	Name              string   `json:"name"`
	ShowThermometer   bool     `json:"show_thermometer"`
	StartTime         string   `json:"start_time"`
	Stats             struct {
		NumPoints           int64 `json:"num_points"`
		NumRelatedDocuments int64 `json:"num_related_documents"`
		NumStories          int64 `json:"num_stories"`
	} `json:"stats"`
	TeamID    int64  `json:"team_id"`
	UpdatedAt string `json:"updated_at"`
}

type PullRequest

type PullRequest struct {
	BranchID         int64  `json:"branch_id"`
	BranchName       string `json:"branch_name"`
	Closed           bool   `json:"closed"`
	CreatedAt        string `json:"created_at"`
	EntityType       string `json:"entity_type"`
	ID               int64  `json:"id"`
	NumAdded         int64  `json:"num_added"`
	NumCommits       int64  `json:"num_commits"`
	NumModified      int64  `json:"num_modified"`
	NumRemoved       int64  `json:"num_removed"`
	Number           int64  `json:"number"`
	TargetBranchID   int64  `json:"target_branch_id"`
	TargetBranchName string `json:"target_branch_name"`
	Title            string `json:"title"`
	UpdatedAt        string `json:"updated_at"`
	URL              string `json:"url"`
}

type Story

type Story struct {
	AppURL               string           `json:"app_url"`
	Archived             bool             `json:"archived"`
	Blocked              bool             `json:"blocked"`
	Blocker              bool             `json:"blocker"`
	Branches             []Branch         `json:"branches"`
	Comments             []Comment        `json:"comments"`
	Commits              []Commit         `json:"commits"`
	Completed            bool             `json:"completed"`
	CompletedAt          string           `json:"completed_at"`
	CompletedAtOverride  string           `json:"completed_at_override"`
	CreatedAt            string           `json:"created_at"`
	CycleTime            int64            `json:"cycle_time"`
	Deadline             string           `json:"deadline"`
	Description          string           `json:"description"`
	EntityType           string           `json:"entity_type"`
	EpicID               int64            `json:"epic_id"`
	Estimate             int64            `json:"estimate"`
	ExternalID           string           `json:"external_id"`
	ExternalTickets      []ExternalTicket `json:"external_tickets"`
	Files                []File           `json:"files"`
	FollowerIDs          []string         `json:"follower_ids"`
	GroupMentionIDs      []string         `json:"group_mention_ids"`
	ID                   int64            `json:"id"`
	IterationID          int64            `json:"iteration_id"`
	Labels               []Label          `json:"label"`
	LeadTime             int64            `json:"lead_time"`
	LinkedFiles          []LinkedFile     `json:"linked_files"`
	MemberMentionIDs     []string         `json:"member_mention_ids"`
	MentionIDs           []string         `json:"mention_ids"`
	MovedAt              string           `json:"moved_at"`
	Name                 string           `json:"name"`
	OwnerIDs             []string         `json:"owner_ids"`
	Position             int64            `json:"position"`
	PreviousIterationIDs []int64          `json:"previous_iteration_ids"`
	ProjectID            int64            `json:"project_id"`
	PullRequests         []PullRequest    `json:"pull_requests"`
	RequestedByID        string           `json:"requested_by_id"`
	Started              bool             `json:"started"`
	StartedAt            string           `json:"started_at"`
	StartedAtOverride    string           `json:"started_at_override"`
	Stats                struct {
		NumRelatedDocuments int64 `json:"num_related_documents"`
	} `json:"stats"`
	StoryLinks      []StoryLink `json:"story_links"`
	StoryType       string      `json:"story_type"`
	Tasks           []Task      `json:"tasks"`
	UpdatedAt       string      `json:"updated_at"`
	WorkflowStateID int64       `json:"workflow_state_id"`
}
type StoryLink struct {
	CreatedAt  string `json:"created_at"`
	EntityType string `json:"entity_type"`
	ID         int64  `json:"id"`
	ObjectID   int64  `json:"object_id"`
	SubjectID  int64  `json:"subject_id"`
	Type       string `json:"type"`
	UpdatedAt  string `json:"updated_at"`
	Verb       string `json:"verb"`
}

type Task

type Task struct {
	Complete         bool     `json:"complete"`
	CompletedAt      string   `json:"completed_at"`
	CreatedAt        string   `json:"created_at"`
	Description      string   `json:"description"`
	EntityType       string   `json:"entity_type"`
	ExternalID       string   `json:"external_id"`
	GroupMentionIDs  []string `json:"group_mention_ids"`
	ID               int64    `json:"id"`
	MemberMentionIDs []string `json:"member_mention_ids"`
	MentionIDs       []string `json:"mention_ids"`
	OwnerIDs         []string `json:"owner_ids"`
	Position         int64    `json:"position"`
	StoryID          int64    `json:"story_id"`
	UpdatedAt        string   `json:"updated_at"`
}

type UpdateStoriesParam

type UpdateStoriesParam struct {
	Name                string     `json:"name,omitempty"`
	Description         string     `json:"description,omitempty"`
	Archived            bool       `json:"archived"`
	BeforeStoryID       *int64     `json:"before_id,omitempty"`
	EpicID              *int64     `json:"epic_id,omitempty"`
	Estimate            *int64     `json:"estimate,omitempty"`
	BranchIDs           []*int64   `json:"branch_ids,omitempty"`
	CommitIDs           []*int64   `json:"commit_ids,omitempty"`
	FileIDs             []*int64   `json:"file_ids,omitempty"`
	FollowerIDs         []*int64   `json:"follower_ids,omitempty"`
	IterationID         []*int64   `json:"iteration_id,omitempty"`
	StoryType           []*int64   `json:"story_type,omitempty"`
	StartedAtOverride   *time.Time `json:"started_at_override,omitempty"`
	CompletedAtOverride *time.Time `json:"completed_at_override,omitempty"`
}

type Workflow

type Workflow struct {
	// Like EpicWorkflow
	ID              int64           `json:"id"`
	Name            string          `json:"name"`
	Description     string          `json:"description"`
	EntityType      string          `json:"entity_type"`
	DefaultStateId  int64           `json:"default_state_id"`
	States          []WorkflowState `json:"states"`
	AutoAssignOwner bool            `json:"auto_assign_owner"`
	ProjectIds      []int64         `json:"project_ids"`
	TeamId          int64           `json:"team_id"`
	CreatedAt       time.Time       `json:"created_at"`
	UpdatedAt       time.Time       `json:"updated_at"`
}

type WorkflowState

type WorkflowState struct {
	EpicState
	NumStories        int64  `json:"num_stories"`
	NumStoryTemplates int64  `json:"num_story_templates"`
	Verb              string `json:"verb"`
}

Jump to

Keyboard shortcuts

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