Documentation ¶
Overview ¶
Package asana is a client for Asana API.
Index ¶
- func Bool(b bool) *bool
- type Client
- func (c *Client) CreateTask(ctx context.Context, fields map[string]string, opts *Filter) (Task, error)
- func (c *Client) CreateTask2(ctx context.Context, body interface{}, opts *Filter) (Task, error)
- func (c *Client) CreateWebhook(ctx context.Context, id int64, target string) (Webhook, error)
- func (c *Client) CreateWebhookWithGID(ctx context.Context, id string, target string) (Webhook, error)
- func (c *Client) DeleteTask(ctx context.Context, taskGid string) error
- func (c *Client) DeleteWebhook(ctx context.Context, id int64) error
- func (c *Client) DeleteWebhookByGID(ctx context.Context, id string) error
- func (c *Client) GetAuthenticatedUser(ctx context.Context, opt *Filter) (User, error)
- func (c *Client) GetTask(ctx context.Context, id int64, opt *Filter) (Task, error)
- func (c *Client) GetTaskByGID(ctx context.Context, id string, opt *Filter) (Task, error)
- func (c *Client) GetUserByID(ctx context.Context, id int64, opt *Filter) (User, error)
- func (c *Client) GetWebhook(ctx context.Context, id int64) (Webhook, error)
- func (c *Client) GetWebhookByGID(ctx context.Context, id string) (Webhook, error)
- func (c *Client) GetWebhooks(ctx context.Context, opt *Filter) ([]Webhook, error)
- func (c *Client) ListProjectSections(ctx context.Context, projectGID string, opt *Filter) ([]Section, error)
- func (c *Client) ListProjectTasks(ctx context.Context, projectID int64, opt *Filter) ([]Task, error)
- func (c *Client) ListProjects(ctx context.Context, opt *Filter) ([]Project, error)
- func (c *Client) ListTags(ctx context.Context, opt *Filter) ([]Tag, error)
- func (c *Client) ListTaskStories(ctx context.Context, taskID int64, opt *Filter) ([]Story, error)
- func (c *Client) ListTasks(ctx context.Context, opt *Filter) ([]Task, error)
- func (c *Client) ListTeams(ctx context.Context, opt *Filter) ([]Team, error)
- func (c *Client) ListUsers(ctx context.Context, opt *Filter) ([]User, error)
- func (c *Client) ListWorkspaces(ctx context.Context) ([]Workspace, error)
- func (c *Client) Request(ctx context.Context, path string, opt *Filter, v interface{}) error
- func (c *Client) UpdateTask(ctx context.Context, id int64, tu TaskUpdate, opt *Filter) (Task, error)
- func (c *Client) UpdateTaskByGID(ctx context.Context, id string, tu TaskUpdate, opt *Filter) (Task, error)
- func (c *Client) UpdateTaskSection(ctx context.Context, sectionGID string, taskSectionUpdate TaskSectionUpdate) error
- type Doer
- type DoerFunc
- type Error
- type Errors
- type Filter
- type Heart
- type Membership
- type Membership2
- type NewTask
- type NextPage
- type Project
- type RequestError
- type Resource
- type Response
- type Section
- type Story
- type Tag
- type Tags
- type Task
- type TaskSectionUpdate
- type TaskUpdate
- type Team
- type User
- type Webhook
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
func NewClient ¶
NewClient created new asana client with doer. If doer is nil then http.DefaultClient used intead.
func (*Client) CreateTask ¶
func (c *Client) CreateTask(ctx context.Context, fields map[string]string, opts *Filter) (Task, error)
CreateTask creates a task.
func (*Client) CreateTask2 ¶
func (*Client) CreateWebhook ¶
func (*Client) CreateWebhookWithGID ¶
func (*Client) DeleteWebhookByGID ¶
func (*Client) GetAuthenticatedUser ¶
func (*Client) GetTaskByGID ¶
func (*Client) GetUserByID ¶
func (*Client) GetWebhook ¶
func (*Client) GetWebhookByGID ¶
func (*Client) GetWebhooks ¶
func (*Client) ListProjectSections ¶
func (*Client) ListProjectTasks ¶
func (*Client) ListProjects ¶
func (*Client) ListTaskStories ¶
func (*Client) ListWorkspaces ¶
func (*Client) UpdateTask ¶
func (c *Client) UpdateTask(ctx context.Context, id int64, tu TaskUpdate, opt *Filter) (Task, error)
UpdateTask updates a task.
func (*Client) UpdateTaskByGID ¶
func (*Client) UpdateTaskSection ¶
type Doer ¶
Doer interface used for doing http calls. Use it as point of setting Auth header or custom status code error handling.
type DoerFunc ¶
DoerFunc implements Doer interface. Allow to transform any appropriate function "f" to Doer instance: DoerFunc(f).
type Error ¶
type Filter ¶
type Filter struct { Archived *bool `url:"archived,omitempty"` Assignee int64 `url:"assignee,omitempty"` AssigneeGID string `url:"assignee,omitempty"` Project int64 `url:"project,omitempty"` ProjectGID string `url:"project,omitempty"` Workspace int64 `url:"workspace,omitempty"` WorkspaceGID string `url:"workspace,omitempty"` TeamGID string `url:"team,omitempty"` ResourceGID string `url:"resource,omitempty"` CompletedSince string `url:"completed_since,omitempty"` ModifiedSince string `url:"modified_since,omitempty"` OptFields []string `url:"opt_fields,comma,omitempty"` OptExpand []string `url:"opt_expand,comma,omitempty"` Offset string `url:"offset,omitempty"` Limit uint32 `url:"limit,omitempty"` }
type Membership ¶
type Membership2 ¶
type RequestError ¶
HTTP request error
func (RequestError) Error ¶
func (re RequestError) Error() string
type Story ¶
type Story struct { ID int64 `json:"id,omitempty"` GID string `json:"gid,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` CreatedBy User `json:"created_by,omitempty"` Hearts []Heart `json:"hearts,omitempty"` Text string `json:"text,omitempty"` Type string `json:"type,omitempty"` // E.g., "comment", "system". }
type Task ¶
type Task struct { ID int64 `json:"id,omitempty"` GID string `json:"gid,omitempty"` Assignee *User `json:"assignee,omitempty"` AssigneeStatus string `json:"assignee_status,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` CreatedBy User `json:"created_by,omitempty"` // Undocumented field, but it can be included. Completed bool `json:"completed,omitempty"` CompletedAt time.Time `json:"completed_at,omitempty"` Name string `json:"name,omitempty"` Hearts []Heart `json:"hearts,omitempty"` Notes string `json:"notes,omitempty"` ParentTask *Task `json:"parent,omitempty"` Projects []Project `json:"projects,omitempty"` DueOn string `json:"due_on,omitempty"` DueAt string `json:"due_at,omitempty"` Memberships []Membership2 `json:"memberships,omitempty"` Tags []Tags `json:"tags,omitempty"` }
type TaskSectionUpdate ¶
type TaskSectionUpdate struct {
TaskGID string `json:"task"`
}
type TaskUpdate ¶
type TaskUpdate struct { Completed *bool `json:"completed,omitempty"` Notes *string `json:"notes,omitempty"` AssigneeSection *string `json:"assignee_section,omitempty"` }
TaskUpdate is used to update a task.
type Webhook ¶
type Webhook struct { ID int64 `json:"id,omitempty"` GID string `json:"gid,omitempty"` Resource Resource `json:"resource,omitempty"` Target string `json:"target,omitempty"` Active bool `json:"active,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` LastSuccessAt time.Time `json:"last_success_at,omitempty"` LastFailureAt time.Time `json:"last_failure_at,omitempty"` }
Click to show internal directories.
Click to hide internal directories.