Documentation
¶
Overview ¶
Copyright 2020
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Code generated by gen-accessors; DO NOT EDIT.
Index ¶
- Constants
- type Client
- type CommonResourceFields
- type CustomField
- func (c *CustomField) GetCurrencyCode() string
- func (c *CustomField) GetCustomLabel() string
- func (c *CustomField) GetCustomLabelPosition() string
- func (c *CustomField) GetDescription() string
- func (c *CustomField) GetEnabled() bool
- func (c *CustomField) GetEnumValues() *Enum
- func (c *CustomField) GetFormat() string
- func (c *CustomField) GetHasNotificationEnabled() bool
- func (c *CustomField) GetIsGlobalToWorkspace() bool
- func (c *CustomField) GetName() string
- func (c *CustomField) GetNumberValue() int
- func (c *CustomField) GetPrecision() int
- func (c *CustomField) GetResourceSubtype() string
- func (c *CustomField) GetTextValue() string
- func (c *CustomField) GetType() string
- func (c *CustomField) HasEnumOptions() bool
- type CustomFieldSetting
- type CustomFieldsService
- type Enum
- type InputOutputOpts
- type InputOutputParams
- type ListParams
- type Option
- type Project
- func (p *Project) GetArchived() bool
- func (p *Project) GetColor() string
- func (p *Project) GetCreatedAt() time.Time
- func (p *Project) GetCurrentStatus() *ProjectStatus
- func (p *Project) GetDefaultView() string
- func (p *Project) GetDueDate() string
- func (p *Project) GetDueOn() string
- func (p *Project) GetHtmlNotes() string
- func (p *Project) GetIcon() string
- func (p *Project) GetIsTemplate() bool
- func (p *Project) GetModifiedAt() time.Time
- func (p *Project) GetName() string
- func (p *Project) GetNotes() string
- func (p *Project) GetOwner() *User
- func (p *Project) GetPermalinkURL() string
- func (p *Project) GetPublic() bool
- func (p *Project) GetStartOn() string
- func (p *Project) GetTeam() *Team
- func (p *Project) GetWorkspace() *Workspace
- func (p *Project) HasCustomFieldSettings() bool
- func (p *Project) HasCustomFields() bool
- func (p *Project) HasFollowers() bool
- func (p *Project) HasMembers() bool
- type ProjectListParams
- type ProjectRequest
- type ProjectResponse
- type ProjectStatus
- func (p *ProjectStatus) GetAuthor() *User
- func (p *ProjectStatus) GetColor() string
- func (p *ProjectStatus) GetCreatedAt() time.Time
- func (p *ProjectStatus) GetCreatedBy() *User
- func (p *ProjectStatus) GetHtmlText() string
- func (p *ProjectStatus) GetModifiedAt() string
- func (p *ProjectStatus) GetText() string
- func (p *ProjectStatus) GetTitle() string
- type ProjectStatusesService
- type ProjectsResponse
- type ProjectsService
- func (p *ProjectsService) Create(createOpts *ProjectRequest, ioOpts *InputOutputOpts) (*ProjectResponse, *simpleresty.Response, error)
- func (p *ProjectsService) Delete(id string) (*simpleresty.Response, error)
- func (p *ProjectsService) Get(id string, params ...interface{}) (*ProjectResponse, *simpleresty.Response, error)
- func (p *ProjectsService) List(params ...interface{}) (*ProjectsResponse, *simpleresty.Response, error)
- func (p *ProjectsService) Update(id string, updateOpts *ProjectRequest, ioOpts *InputOutputOpts) (*ProjectResponse, *simpleresty.Response, error)
- type Team
- type TeamsService
- type User
- type UserPhoto
- type UsersService
- type Workspace
- type WorkspacesService
Constants ¶
const ( // DefaultAPIBaseURL is the base URL. DefaultAPIBaseURL = "https://app.asana.com/api/1.0" // DefaultUserAgent is the user agent used when making API calls. DefaultUserAgent = "asana-go" // DefaultContentTypeHeader is the default Content-Type header. DefaultContentTypeHeader = "application/json" // DefaultAcceptHeader is the default Accept header. DefaultAcceptHeader = "application/json" // DefaultMaxRetryCount is the number of times to retry the request. DefaultMaxRetryCount = 3 // DefaultMaxRetryWaitTime is the number of seconds a retry can wait for. DefaultMaxRetryWaitTime = 300 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Services used for talking to different parts of the Asana API. Projects *ProjectsService // contains filtered or unexported fields }
A Client manages communication with the Asana API.
type CommonResourceFields ¶
type CommonResourceFields struct { // Globally unique identifier of the resource, as a string. GID *string `json:"gid,omitempty"` // The base type of this resource. ResourceType *string `json:"resource_type,omitempty"` }
CommonResourceFields represents common fields returned by all API resources.
func (*CommonResourceFields) GetGID ¶
func (c *CommonResourceFields) GetGID() string
GetGID returns the GID field if it's non-nil, zero value otherwise.
func (*CommonResourceFields) GetResourceType ¶
func (c *CommonResourceFields) GetResourceType() string
GetResourceType returns the ResourceType field if it's non-nil, zero value otherwise.
type CustomField ¶
type CustomField struct { CommonResourceFields // ISO 4217 currency code to format this custom field. This will be null if the format is not currency. CurrencyCode *string `json:"currency_code,omitempty"` // This is the string that appears next to the custom field value. This will be null if the format is not custom. CustomLabel *string `json:"custom_label,omitempty"` // Only relevant for custom fields with custom format. This depicts where to place the custom label. // This will be null if the format is not custom. CustomLabelPosition *string `json:"custom_label_position,omitempty"` // (Opt In) The description of the custom field. Description *string `json:"description,omitempty"` // Conditional. Determines if the custom field is enabled or not. Enabled *bool `json:"enabled"` // Conditional. Only relevant for custom fields of type enum. This array specifies the possible values which an // enum custom field can adopt. To modify the enum options, refer to working with enum options. EnumOptions []*Enum `json:"enum_options,omitempty"` // Conditional. Only relevant for custom fields of type enum. This object is the chosen value of an enum custom field. EnumValues *Enum `json:"enum_value,omitempty"` // The format of this custom field. Format *string `json:"format,omitempty"` // Conditional. This flag describes whether a follower of a task with this field should receive inbox notifications // from changes to this field. HasNotificationEnabled *bool `json:"has_notifications_enabled,omitempty"` // This flag describes whether this custom field is available to every container in the workspace. // Before project-specific custom fields, this field was always true. IsGlobalToWorkspace *bool `json:"is_global_to_workspace,omitempty"` // The name of the custom field. Name *string `json:"name,omitempty"` // Conditional. This number is the value of a number custom field. NumberValue *int `json:"number_value,omitempty"` // Only relevant for custom fields of type ‘Number’. This field dictates the number of places after the decimal // to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive. // For percentage format, this may be unintuitive, as a value of 0.25 has a precision of 0, while a value of 0.251 // has a precision of 1. This is due to 0.25 being displayed as 25%. // The identifier format will always have a precision of 0. Precision *int `json:"precision,omitempty"` // The type of the custom field. Must be one of the given values. ResourceSubtype *string `json:"resource_subtype,omitempty"` // Conditional. This string is the value of a text custom field. TextValue *string `json:"text_value,omitempty"` // Deprecated: new integrations should prefer the resource_subtype field. // The type of the custom field. Must be one of the given values. Type *string `json:"type,omitempty"` }
Custom field store the metadata that is used in order to add user-specified information to tasks in Asana.
func (*CustomField) GetCurrencyCode ¶
func (c *CustomField) GetCurrencyCode() string
GetCurrencyCode returns the CurrencyCode field if it's non-nil, zero value otherwise.
func (*CustomField) GetCustomLabel ¶
func (c *CustomField) GetCustomLabel() string
GetCustomLabel returns the CustomLabel field if it's non-nil, zero value otherwise.
func (*CustomField) GetCustomLabelPosition ¶
func (c *CustomField) GetCustomLabelPosition() string
GetCustomLabelPosition returns the CustomLabelPosition field if it's non-nil, zero value otherwise.
func (*CustomField) GetDescription ¶
func (c *CustomField) GetDescription() string
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*CustomField) GetEnabled ¶
func (c *CustomField) GetEnabled() bool
GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.
func (*CustomField) GetEnumValues ¶
func (c *CustomField) GetEnumValues() *Enum
GetEnumValues returns the EnumValues field.
func (*CustomField) GetFormat ¶
func (c *CustomField) GetFormat() string
GetFormat returns the Format field if it's non-nil, zero value otherwise.
func (*CustomField) GetHasNotificationEnabled ¶
func (c *CustomField) GetHasNotificationEnabled() bool
GetHasNotificationEnabled returns the HasNotificationEnabled field if it's non-nil, zero value otherwise.
func (*CustomField) GetIsGlobalToWorkspace ¶
func (c *CustomField) GetIsGlobalToWorkspace() bool
GetIsGlobalToWorkspace returns the IsGlobalToWorkspace field if it's non-nil, zero value otherwise.
func (*CustomField) GetName ¶
func (c *CustomField) GetName() string
GetName returns the Name field if it's non-nil, zero value otherwise.
func (*CustomField) GetNumberValue ¶
func (c *CustomField) GetNumberValue() int
GetNumberValue returns the NumberValue field if it's non-nil, zero value otherwise.
func (*CustomField) GetPrecision ¶
func (c *CustomField) GetPrecision() int
GetPrecision returns the Precision field if it's non-nil, zero value otherwise.
func (*CustomField) GetResourceSubtype ¶
func (c *CustomField) GetResourceSubtype() string
GetResourceSubtype returns the ResourceSubtype field if it's non-nil, zero value otherwise.
func (*CustomField) GetTextValue ¶
func (c *CustomField) GetTextValue() string
GetTextValue returns the TextValue field if it's non-nil, zero value otherwise.
func (*CustomField) GetType ¶
func (c *CustomField) GetType() string
GetType returns the Type field if it's non-nil, zero value otherwise.
func (*CustomField) HasEnumOptions ¶
func (c *CustomField) HasEnumOptions() bool
HasEnumOptions checks if CustomField has any EnumOptions.
type CustomFieldSetting ¶
type CustomFieldSetting struct { CommonResourceFields // The custom field that is applied to the parent. CustomField *CustomField `json:"custom_field,omitempty"` // is_important is used in the Asana web application to determine if this custom field // is displayed in the list/grid view of a project or portfolio. IsImportant *bool `json:"is_important,omitempty"` // The parent to which the custom field is applied. This can be a project or portfolio and indicates // that the tasks or projects that the parent contains may be given custom field values for this custom field. Parent *Project `json:"parent,omitempty"` // Deprecated: new integrations should prefer the parent field. // The id of the project that this custom field settings refers to. Project *Project `json:"project,omitempty"` }
CustomFieldSetting represent the many-to-many join of the Custom Field and Project as well as stores information that is relevant to that particular pairing.
func (*CustomFieldSetting) GetCustomField ¶
func (c *CustomFieldSetting) GetCustomField() *CustomField
GetCustomField returns the CustomField field.
func (*CustomFieldSetting) GetIsImportant ¶
func (c *CustomFieldSetting) GetIsImportant() bool
GetIsImportant returns the IsImportant field if it's non-nil, zero value otherwise.
func (*CustomFieldSetting) GetParent ¶
func (c *CustomFieldSetting) GetParent() *Project
GetParent returns the Parent field.
func (*CustomFieldSetting) GetProject ¶
func (c *CustomFieldSetting) GetProject() *Project
GetProject returns the Project field.
type CustomFieldsService ¶
type CustomFieldsService service
CustomFieldsService handles communication with the custom field related methods of the Asana API.
Asana API docs: https://developers.asana.com/docs/custom-fields
type Enum ¶
type Enum struct { CommonResourceFields // The color of the enum option. Defaults to ‘none’. Color *string `json:"color,omitempty"` // Whether or not the enum option is a selectable value for the custom field. Enabled *bool `json:"enabled"` // The name of the enum option/value. Name *string `json:"name,omitempty"` }
Enum represents the common fields available for EnumOption and EnumValue.
func (*Enum) GetEnabled ¶
GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.
type InputOutputOpts ¶
type InputOutputOpts struct { // Provides “pretty” output. Pretty bool `json:"opt_pretty"` // Defines fields to return. Fields []string `json:"opt_fields"` }
InputOutputOpts represents the options available for POST or PUT request or when the `application/json` content type.
func (*InputOutputOpts) HasFields ¶
func (i *InputOutputOpts) HasFields() bool
HasFields checks if InputOutputOpts has any Fields.
type InputOutputParams ¶
type InputOutputParams struct { // Provides the response in "pretty" output. In the case of JSON this means doing proper line breaking // and indentation to make it readable. This will take extra time and increase the response size // so it is advisable only to use this during debugging. Pretty bool `url:"opt_pretty"` // Some requests return compact representations of objects, to conserve resources and complete // the request more efficiently. Other times requests return more information than you may need. // This option allows you to list the exact set of fields that the API should be sure to return for the objects. // The field names should be provided as paths, described below. Fields []string `url:"opt_fields"` }
InputOutputParams specify query parameters to control how your request is interpreted and how the response is generated. This struct is used for any GET requests or any PUT/POST requests that use the `application/x-www-form-urlencoded` content type.
Reference: https://developers.asana.com/docs/input-output-options
func (*InputOutputParams) HasFields ¶
func (i *InputOutputParams) HasFields() bool
HasFields checks if InputOutputParams has any Fields.
type ListParams ¶
type ListParams struct { // Results per page. Limit int `url:"opt_fields"` // Offset token. Offset string `url:"offset"` }
ListParams represents the query parameters available to most (if not all) list methods.
type Option ¶
Option is a functional option for configuring the API client.
func AccessToken ¶
AccessToken sets the account access token for authentication.
func CustomHTTPHeaders ¶
CustomHTTPHeaders sets additional HTTPHeaders
func HTTP ¶
func HTTP(http *simpleresty.Client) Option
func RetryCount ¶
type Project ¶
type Project struct { CommonResourceFields // Name of the project. This is generally a short sentence fragment that fits on a line in the UI // for maximum readability. However, it can be longer. Name *string `json:"name,omitempty"` // True if the project is archived, false if not. Archived projects do not show in the UI by default // and may be treated differently for queries. Archived *bool `json:"archived,omitempty"` // Color of the project. Color *string `json:"color,omitempty"` // The time at which this resource was created. CreatedAt *time.Time `json:"created_at,omitempty"` // A project status is an update on the progress of a particular project, and is sent out to all project followers // when created. These updates include both text describing the update and a color code intended to represent the // overall state of the project: "green" for projects that are on track, "yellow" for projects at risk, // and "red" for projects that are behind. CurrentStatus *ProjectStatus `json:"current_status,omitempty"` // Array of Custom Field Settings (in compact form). CustomFieldSettings []*CustomFieldSetting `json:"custom_field_settings,omitempty"` // The default view (list, board, calendar, or timeline) of a project. DefaultView *string `json:"default_view,omitempty"` // Deprecated: new integrations should prefer the due_on field. DueDate *string `json:"due_date,omitempty"` // The day on which this project is due. This takes a date with format YYYY-MM-DD. DueOn *string `json:"due_on,omitempty"` // Opt In. The notes of the project with formatting as HTML. HtmlNotes *string `json:"html_notes,omitempty"` // Opt In. Determines if the project is a template. IsTemplate *bool `json:"is_template"` // Array of users who are members of this project. Members []*User `json:"members,omitempty"` // The time at which this project was last modified. // Note: This does not currently reflect any changes in associations such as tasks or comments // that may have been added or removed from the project. ModifiedAt *time.Time `json:"modified_at,omitempty"` // More detailed, free-form textual information associated with the project. Notes *string `json:"notes,omitempty"` // True if the project is public to the organization. If false, do not share this project with other users in // this organization without explicitly checking to see if they have access. Public *bool `json:"public"` // The day on which work for this project begins, or null if the project has no start date. // This takes a date with YYYY-MM-DD format. Note: due_on or due_at must be present in the request when setting // or unsetting the start_on parameter. Additionally, start_on and due_on cannot be the same date StartOn *string `json:"start_on,omitempty"` // Create-only. The workspace or organization this project is associated with.Once created, // projects cannot be moved to a different workspace. This attribute can only be specified at creation time. Workspace *Workspace `json:"workspace,omitempty"` // Array of Custom Fields. CustomFields []*CustomField `json:"custom_fields,omitempty"` // Array of users following this project. Followers are a subset of members who receive all notifications // for a project, the default notification setting when adding members to a project in-product. Followers []*User `json:"followers,omitempty"` // The icon for a project. Icon *string `json:"icon,omitempty"` // A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks. Owner *User `json:"owner,omitempty"` // A url that points directly to the object within Asana. PermalinkURL *string `json:"permalink_url,omitempty"` // Create-only. The team that this project is shared with. This field only exists for projects in organizations. Team *Team `json:"team,omitempty"` }
Project represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards.
func (*Project) GetArchived ¶
GetArchived returns the Archived field if it's non-nil, zero value otherwise.
func (*Project) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*Project) GetCurrentStatus ¶
func (p *Project) GetCurrentStatus() *ProjectStatus
GetCurrentStatus returns the CurrentStatus field.
func (*Project) GetDefaultView ¶
GetDefaultView returns the DefaultView field if it's non-nil, zero value otherwise.
func (*Project) GetDueDate ¶
GetDueDate returns the DueDate field if it's non-nil, zero value otherwise.
func (*Project) GetHtmlNotes ¶
GetHtmlNotes returns the HtmlNotes field if it's non-nil, zero value otherwise.
func (*Project) GetIsTemplate ¶
GetIsTemplate returns the IsTemplate field if it's non-nil, zero value otherwise.
func (*Project) GetModifiedAt ¶
GetModifiedAt returns the ModifiedAt field if it's non-nil, zero value otherwise.
func (*Project) GetPermalinkURL ¶
GetPermalinkURL returns the PermalinkURL field if it's non-nil, zero value otherwise.
func (*Project) GetPublic ¶
GetPublic returns the Public field if it's non-nil, zero value otherwise.
func (*Project) GetStartOn ¶
GetStartOn returns the StartOn field if it's non-nil, zero value otherwise.
func (*Project) GetWorkspace ¶
GetWorkspace returns the Workspace field.
func (*Project) HasCustomFieldSettings ¶
HasCustomFieldSettings checks if Project has any CustomFieldSettings.
func (*Project) HasCustomFields ¶
HasCustomFields checks if Project has any CustomFields.
func (*Project) HasFollowers ¶
HasFollowers checks if Project has any Followers.
func (*Project) HasMembers ¶
HasMembers checks if Project has any Members.
type ProjectListParams ¶
type ProjectListParams struct { // The workspace or organization to filter projects on. Workspace string `url:"workspace"` // The team to filter projects on. Team string `url:"team"` // Only return projects whose archived field takes on the value of this parameter. Archived bool `url:"archived"` }
ProjectListParams represents the query parameters available when retrieving all projects.
type ProjectRequest ¶ added in v0.1.2
type ProjectRequest struct { Color *string `json:"color"` CurrentStatus *ProjectStatus `json:"current_status,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` DefaultView string `json:"default_view,omitempty"` DueOn *string `json:"due_on"` Followers string `json:"followers,omitempty"` HTMLNotes string `json:"html_notes,omitempty"` Name string `json:"name,omitempty"` Notes string `json:"notes,omitempty"` Owner *string `json:"owner"` StartOn *string `json:"start_on"` Team string `json:"team,omitempty"` Workspace string `json:"workspace,omitempty"` Archived bool `json:"archived"` Public bool `json:"public"` IsTemplate *bool `json:"is_template,omitempty"` }
ProjectRequest represents the options available when creating or updating a Project.
func (*ProjectRequest) GetColor ¶ added in v0.1.2
func (p *ProjectRequest) GetColor() string
GetColor returns the Color field if it's non-nil, zero value otherwise.
func (*ProjectRequest) GetCurrentStatus ¶ added in v0.1.2
func (p *ProjectRequest) GetCurrentStatus() *ProjectStatus
GetCurrentStatus returns the CurrentStatus field.
func (*ProjectRequest) GetDueOn ¶ added in v0.1.2
func (p *ProjectRequest) GetDueOn() string
GetDueOn returns the DueOn field if it's non-nil, zero value otherwise.
func (*ProjectRequest) GetIsTemplate ¶ added in v0.1.2
func (p *ProjectRequest) GetIsTemplate() bool
GetIsTemplate returns the IsTemplate field if it's non-nil, zero value otherwise.
func (*ProjectRequest) GetOwner ¶ added in v0.1.2
func (p *ProjectRequest) GetOwner() string
GetOwner returns the Owner field if it's non-nil, zero value otherwise.
func (*ProjectRequest) GetStartOn ¶ added in v0.1.2
func (p *ProjectRequest) GetStartOn() string
GetStartOn returns the StartOn field if it's non-nil, zero value otherwise.
type ProjectResponse ¶
type ProjectResponse struct {
Data *Project `json:"data,omitempty"`
}
func (*ProjectResponse) GetData ¶
func (p *ProjectResponse) GetData() *Project
GetData returns the Data field.
type ProjectStatus ¶
type ProjectStatus struct { CommonResourceFields // The title of the project status update. Title *string `json:"title,omitempty"` // A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks. Author *User `json:"author,omitempty"` // The color associated with the status update. Color *string `json:"color,omitempty"` // The text content of the status update with formatting as HTML. HtmlText *string `json:"html_text,omitempty"` // The time at which this project status was last modified. // Note: This does not currently reflect any changes in associations such as comments that may have been added // or removed from the project status. ModifiedAt *string // The text content of the status update. Text *string `json:"text,omitempty"` // The time at which this resource was created. CreatedAt *time.Time `json:"created_at,omitempty"` // A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks. CreatedBy *User `json:"created_by,omitempty"` }
ProjectStatus is an update on the progress of a particular project, and is sent out to all project followers when created. These updates include both text describing the update and a color code intended to represent the overall state of the project: "green" for projects that are on track, "yellow" for projects at risk, and "red" for projects that are behind.
func (*ProjectStatus) GetAuthor ¶
func (p *ProjectStatus) GetAuthor() *User
GetAuthor returns the Author field.
func (*ProjectStatus) GetColor ¶
func (p *ProjectStatus) GetColor() string
GetColor returns the Color field if it's non-nil, zero value otherwise.
func (*ProjectStatus) GetCreatedAt ¶
func (p *ProjectStatus) GetCreatedAt() time.Time
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*ProjectStatus) GetCreatedBy ¶
func (p *ProjectStatus) GetCreatedBy() *User
GetCreatedBy returns the CreatedBy field.
func (*ProjectStatus) GetHtmlText ¶
func (p *ProjectStatus) GetHtmlText() string
GetHtmlText returns the HtmlText field if it's non-nil, zero value otherwise.
func (*ProjectStatus) GetModifiedAt ¶
func (p *ProjectStatus) GetModifiedAt() string
GetModifiedAt returns the ModifiedAt field if it's non-nil, zero value otherwise.
func (*ProjectStatus) GetText ¶
func (p *ProjectStatus) GetText() string
GetText returns the Text field if it's non-nil, zero value otherwise.
func (*ProjectStatus) GetTitle ¶
func (p *ProjectStatus) GetTitle() string
GetTitle returns the Title field if it's non-nil, zero value otherwise.
type ProjectStatusesService ¶
type ProjectStatusesService service
ProjectStatusesService handles communication with the project status related methods of the Asana API.
Asana API docs: https://developers.asana.com/docs/project-status
type ProjectsResponse ¶
type ProjectsResponse struct {
Data []*Project `json:"data,omitempty"`
}
func (*ProjectsResponse) HasData ¶
func (p *ProjectsResponse) HasData() bool
HasData checks if ProjectsResponse has any Data.
type ProjectsService ¶
type ProjectsService service
ProjectsService handles communication with the project related methods of the Asana API.
Asana API docs: https://developers.asana.com/docs/projects
func (*ProjectsService) Create ¶
func (p *ProjectsService) Create(createOpts *ProjectRequest, ioOpts *InputOutputOpts) (*ProjectResponse, *simpleresty.Response, error)
Create a new project in a workspace or team.
Every project is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization. If the workspace for your project is an organization, you must also supply a team to share the project with. Returns the full record of the newly created project.
Asana API docs: https://developers.asana.com/docs/create-a-project
func (*ProjectsService) Delete ¶
func (p *ProjectsService) Delete(id string) (*simpleresty.Response, error)
Delete a project.
Asana API docs: https://developers.asana.com/docs/delete-a-project
func (*ProjectsService) Get ¶
func (p *ProjectsService) Get(id string, params ...interface{}) (*ProjectResponse, *simpleresty.Response, error)
Get returns the complete project record for a single project.
Asana API docs: https://developers.asana.com/docs/get-a-project
func (*ProjectsService) List ¶
func (p *ProjectsService) List(params ...interface{}) (*ProjectsResponse, *simpleresty.Response, error)
List returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned.
Asana API docs: https://developers.asana.com/docs/get-multiple-projects
func (*ProjectsService) Update ¶
func (p *ProjectsService) Update(id string, updateOpts *ProjectRequest, ioOpts *InputOutputOpts) (*ProjectResponse, *simpleresty.Response, error)
Update a project.
A specific, existing project can be updated by making a PUT request on the URL for that project. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task.
Returns the complete updated project record.
Asana API docs: https://developers.asana.com/docs/update-a-project
type Team ¶
type Team struct { CommonResourceFields // The name of the team. Name *string `json:"name,omitempty"` // (Opt-in) The description of the team. Description *string `json:"description,omitempty"` // (Opt-in) The description of the team with formatting as HTML. HtmlDescription *string `json:"html_description,omitempty"` // The organization/workspace the team belongs to. Organization *Workspace `json:"organization,omitempty"` // A url that points directly to the object within Asana. PermalinkURL *string `json:"permalink_url,omitempty"` }
Team is used to group related projects and people together within an organization. Each project in an organization is associated with a team.
func (*Team) GetDescription ¶
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*Team) GetHtmlDescription ¶
GetHtmlDescription returns the HtmlDescription field if it's non-nil, zero value otherwise.
func (*Team) GetOrganization ¶
GetOrganization returns the Organization field.
func (*Team) GetPermalinkURL ¶
GetPermalinkURL returns the PermalinkURL field if it's non-nil, zero value otherwise.
type TeamsService ¶
type TeamsService service
TeamsService handles communication with the team related methods of the Asana API.
Asana API docs: https://developers.asana.com/docs/teams
type User ¶
type User struct { CommonResourceFields // Read-only except when same user as requester. The user’s name. Name *string `json:"name,omitempty"` // The user's email address. Email *string `json:"email,omitempty"` // A map of the user’s profile photo in various sizes, or null if no photo is set. // Sizes provided are 21, 27, 36, 60, and 128. Images are in PNG format. Photo *UserPhoto `json:"photo,omitempty"` // Workspaces and organizations this user may access. // Note: The API will only return workspaces and organizations that also contain the authenticated user. Workspaces []*Workspace `json:"workspaces,omitempty"` }
User represents an account in Asana that can be given access to various workspaces, projects, and tasks.
func (*User) HasWorkspaces ¶
HasWorkspaces checks if User has any Workspaces.
type UserPhoto ¶
type UserPhoto struct { Image128 *string `json:"image_128x128,omitempty"` Image21 *string `json:"image_21x21,omitempty"` Image27 *string `json:"image_27x27,omitempty"` Image36 *string `json:"image_36x36,omitempty"` Image60 *string `json:"image_60x60,omitempty"` }
UserPhoto represents a user's profile photo in various sizes, or null if no photo is set. Sizes provided are 21, 27, 36, 60, and 128. Images are in PNG format.
func (*UserPhoto) GetImage128 ¶
GetImage128 returns the Image128 field if it's non-nil, zero value otherwise.
func (*UserPhoto) GetImage21 ¶
GetImage21 returns the Image21 field if it's non-nil, zero value otherwise.
func (*UserPhoto) GetImage27 ¶
GetImage27 returns the Image27 field if it's non-nil, zero value otherwise.
func (*UserPhoto) GetImage36 ¶
GetImage36 returns the Image36 field if it's non-nil, zero value otherwise.
func (*UserPhoto) GetImage60 ¶
GetImage60 returns the Image60 field if it's non-nil, zero value otherwise.
type UsersService ¶
type UsersService service
UsersService handles communication with the user related methods of the Asana API.
Asana API docs: https://developers.asana.com/docs/user
type Workspace ¶
type Workspace struct { CommonResourceFields // The name of the workspace. Name *string `json:"name,omitempty"` // The email domains that are associated with this workspace. EmailDomains []string `json:"email_domains,omitempty"` // Whether the workspace is an organization. IsOrganization *bool `json:"is_organization"` }
Workspace is the highest-level organizational unit in Asana. All projects and tasks have an associated workspace.
func (*Workspace) GetIsOrganization ¶
GetIsOrganization returns the IsOrganization field if it's non-nil, zero value otherwise.
func (*Workspace) HasEmailDomains ¶
HasEmailDomains checks if Workspace has any EmailDomains.
type WorkspacesService ¶
type WorkspacesService service
WorkspacesService handles communication with the workspace related methods of the Asana API.
Asana API docs: https://developers.asana.com/docs/workspace