Documentation ¶
Overview ¶
Package asana is a client for Asana API.
Index ¶
- Variables
- type Client
- func (c *Client) CreateTask(ctx context.Context, fields map[string]string, opts *Filter) (Task, 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) GetUserByID(ctx context.Context, id int64, opt *Filter) (User, 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) 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)
- type Doer
- type DoerFunc
- type Error
- type Errors
- type Filter
- type Heart
- type Project
- type Response
- type Story
- type Tag
- type Task
- type TaskUpdate
- type User
- type Workspace
Constants ¶
This section is empty.
Variables ¶
View Source
var ( errors.New("asana: unauthorized") )ErrUnauthorized =
Functions ¶
This section is empty.
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) GetAuthenticatedUser ¶
func (*Client) GetUserByID ¶
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.
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"` Project int64 `url:"project,omitempty"` Workspace int64 `url:"workspace,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"` }
type Response ¶
type Response struct { Data interface{} `json:"data,omitempty"` Errors Errors `json:"errors,omitempty"` }
type Task ¶
type Task struct { ID int64 `json:"gid,omitempty,string"` 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"` 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"` }
type TaskUpdate ¶
type TaskUpdate struct { Notes *string `json:"notes,omitempty"` Hearted *bool `json:"hearted,omitempty"` }
TaskUpdate is used to update a task.
Click to show internal directories.
Click to hide internal directories.