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) 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) 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) 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) SearchTasks(ctx context.Context, workspaceID int64, opt *Filter) ([]Task, 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)
- type CustomField
- type Doer
- type DoerFunc
- type EnumOptions
- type EnumValue
- type Error
- type Errors
- type Filter
- type Heart
- type NextPage
- type Project
- type RequestError
- type Resource
- type Response
- type SearchFilter
- type Story
- type Tag
- type Task
- 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) 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) ListProjectTasks ¶
func (*Client) ListProjects ¶
func (*Client) ListTaskStories ¶
func (*Client) ListWorkspaces ¶
func (*Client) SearchTasks ¶
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 ¶
type CustomField ¶
type CustomField struct { GID string `json:"gid,omitempty"` ResourceType string `json:"resource_type,omitempty"` CurrencyCode string `json:"currency_code,omitempty"` CustomLabel string `json:"custom_label,omitempty"` CustomLabelPosition string `json:"custom_label_position,omitempty"` Description string `json:"description,omitempty"` Enabled bool `json:"enabled,omitempty"` EnumOptions []EnumOptions `json:"enum_options,omitempty"` EnumValue EnumValue `json:"enum_value,omitempty"` Format string `json:"format,omitempty"` HasNotificationsEnabled bool `json:"has_notifications_enabled,omitempty"` IsGlobalToWorkspace bool `json:"is_global_to_workspace,omitempty"` Name string `json:"name,omitempty"` NumberValue float64 `json:"number_value,omitempty"` Precision int `json:"precision,omitempty"` ResourceSubtype string `json:"resource_subtype,omitempty"` TextValue string `json:"text_value,omitempty"` Type string `json:"type,omitempty"` }
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 EnumOptions ¶
type Error ¶
type Filter ¶
type Filter struct { Archived *bool `url:"archived,omitempty"` Assignee int64 `url:"assignee,omitempty"` AssigneeGID int64 `url:"assignee,omitempty"` Project int64 `url:"project,omitempty"` ProjectGID string `url:"project,omitempty"` Workspace int64 `url:"workspace,omitempty"` WorkspaceGID string `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"` Offset string `url:"offset,omitempty"` Limit uint32 `url:"limit,omitempty"` Search *SearchFilter `url:"-"` }
type RequestError ¶
HTTP request error
func (RequestError) Error ¶
func (re RequestError) Error() string
type SearchFilter ¶
type SearchFilter struct { ProjectAll int64 `url:"projects.all,omitempty"` SortBy string `url:"sort_by,omitempty"` SortAscending *bool `url:"sort_ascending,omitempty"` CreatedAtAfter string `url:"created_at.after,omitempty"` CreatedAtBefore string `url:"created_at.before,omitempty"` ModifiedAtAfter string `url:"modified_at.after,omitempty"` }
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"` CustomFields []CustomField `json:"custom_fields,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.