wrike

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

README

go-wrike [WIP]

Build Status

A Wrike API client for Go

Documentation

Index

Constants

View Source
const (
	CommentsPath = "/comments"
)

Variables

View Source
var GetApproval = getApprovals(approvalPath)
View Source
var GetCategoryTimeLogs = getTimeLogs(categoryTimelogsPath)

GetCategoryTimeLogs GetCategoryTimeLogs Get all timelog records with specific timelog category.

View Source
var GetContactTimeLogs = getTimeLogs(contactTimelogsPath)

GetContactTimeLogs Get all timelog records that were created by the user.

View Source
var GetFolderApproval = getApprovals(folderApprovalsPath)
View Source
var GetFolderComments = getComments(folderCommentsPath)
View Source
var GetFolderTasks = getTasks(folderTasksPath)
View Source
var GetFolderTimeLogs = getTimeLogs(folderTimelogsPath)

GetFolderTimeLogs Get all timelog records for a folder.

View Source
var GetSpaceTasks = getTasks(spaceTasksPath)
View Source
var GetTask = getTasks(taskPath)
View Source
var GetTaskComments = getComments(taskCommentsPath)
View Source
var GetTaskTimeLogs = getTimeLogs(taskTimelogsPath)

GetTaskTimeLogs Get all timelog records for a task.

View Source
var GetTaskrApproval = getApprovals(taskApprovalsPath)
View Source
var GetTimeLog = getTimeLogs(timelogPath)

GetTimeLog Get timelog record by IDs.

Functions

func CreateFolderTask added in v0.0.6

func CreateFolderTask(ctx context.Context, folderID string, update TaskUpdate, resp *ResponseTasks) (err error)

func CreateTaskAttachment

func CreateTaskAttachment(ctx context.Context, taskID string, filename string, body io.ReadCloser) error

func CreateTaskComment

func CreateTaskComment(ctx context.Context, taskID string, text string, response *ResponseComments) (err error)

func DownloadAttachment

func DownloadAttachment(ctx context.Context, attachID string) (body io.ReadCloser, err error)

func GetAccount

func GetAccount(ctx context.Context, response *ResponseAccount) (err error)

func GetApprovals

func GetApprovals(ctx context.Context, values url.Values, response *ResponseApprovals) (err error)

func GetBookings

func GetBookings(ctx context.Context, values url.Values, response *ResponseBookings) (err error)

func GetComments

func GetComments(ctx context.Context, response *ResponseComments) (err error)

func GetContact

func GetContact(ctx context.Context, contactID string, response *ResponseUsers) (err error)

func GetContacts

func GetContacts(ctx context.Context, response *ResponseUsers) (err error)

func GetCustomField

func GetCustomField(ctx context.Context, customFieldID string, response *ResponseCustomFields) (err error)

func GetCustomFields

func GetCustomFields(ctx context.Context, response *ResponseCustomFields) (err error)

func GetFolderAttachments

func GetFolderAttachments(ctx context.Context, folderID string, response *ResponseAttachments) (err error)

func GetFolders

func GetFolders(ctx context.Context, response *ResponseFolders) error

func GetGroup

func GetGroup(ctx context.Context, groupID string, response *ResponseGroups) (err error)

func GetGroups

func GetGroups(ctx context.Context, response *ResponseGroups) (err error)

func GetInvitation

func GetInvitation(ctx context.Context, contactID string, response *ResponseInvitations) (err error)

func GetInvitations

func GetInvitations(ctx context.Context, response *ResponseInvitations) (err error)

func GetJobRole

func GetJobRole(ctx context.Context, id string, response *ResponseJobRoles) error

func GetJobRoles

func GetJobRoles(ctx context.Context, values url.Values, response *ResponseJobRoles) (err error)

func GetSpaceFolders

func GetSpaceFolders(ctx context.Context, spaceId string, response *ResponseFolders) error

func GetSubFolders

func GetSubFolders(ctx context.Context, folderId string, response *ResponseFolders) error

func GetTaskAttachments

func GetTaskAttachments(ctx context.Context, taskID string, response *ResponseAttachments) (err error)

func GetTasks

func GetTasks(ctx context.Context, values url.Values, response *ResponseTasks) (err error)

func GetTimeLogs

func GetTimeLogs(ctx context.Context, response *ResponseTimeLogs) error

func GetUser

func GetUser(ctx context.Context, userId string, response *ResponseUsers) error

func GetWorkSchedule

func GetWorkSchedule(ctx context.Context, scheduleID string, response *ResponseWorkSchedules) (err error)

func GetWorkSchedules

func GetWorkSchedules(ctx context.Context, values url.Values, response *ResponseWorkSchedules) (err error)

func GetWorkflows

func GetWorkflows(ctx context.Context, response *ResponseWorkflows) (err error)

func Request

func Request(ctx context.Context, method string, url string, reader io.ReadCloser,
	head map[string]string) (body io.ReadCloser, header http.Header, err error)

Request Request

func UpdateTask added in v0.0.6

func UpdateTask(ctx context.Context, taskID string, update TaskUpdate, resp *ResponseTasks) (err error)

Types

type Account

type Account struct {
	ID             string               `json:"id"`
	Name           string               `json:"name"`
	DateFormat     string               `json:"dateFormat"`
	FirstDayOfWeek string               `json:"firstDayOfWeek"`
	WorkDays       []string             `json:"workDays"`
	RootFolderID   string               `json:"rootFolderId"`
	RecycleBinID   string               `json:"recycleBinId"`
	CreatedDate    time.Time            `json:"createdDate"`
	Subscription   Subscription         `json:"subscription"`
	Metadata       Metadatas            `json:"metadata"`
	CustomFields   []AccountCustomField `json:"customFields"`
	JoinedDate     time.Time            `json:"joinedDate"`
}

type AccountCustomField

type AccountCustomField struct {
	ID        string        `json:"id"`
	AccountID string        `json:"accountId"`
	Title     string        `json:"title"`
	Type      string        `json:"type"`
	SharedIds []interface{} `json:"sharedIds"`
	Settings  struct {
		InheritanceType       string `json:"inheritanceType"`
		DecimalPlaces         int    `json:"decimalPlaces"`
		UseThousandsSeparator bool   `json:"useThousandsSeparator"`
		Aggregation           string `json:"aggregation"`
		ReadOnly              bool   `json:"readOnly"`
	} `json:"settings,omitempty"`
	Settings0 struct {
		InheritanceType string `json:"inheritanceType"`
		ReadOnly        bool   `json:"readOnly"`
	} `json:"settings,omitempty"`
	Settings1 struct {
		InheritanceType string `json:"inheritanceType"`
		ReadOnly        bool   `json:"readOnly"`
	} `json:"settings,omitempty"`
}

type Approval

type Approval struct {
	TaskID              string      `json:"taskId,omitempty"`
	AuthorID            string      `json:"authorId"`
	Title               string      `json:"title"`
	Description         string      `json:"description"`
	UpdatedDate         time.Time   `json:"updatedDate"`
	DueDate             string      `json:"dueDate"`
	Decisions           []Decisions `json:"decisions"`
	ReviewID            string      `json:"reviewId"`
	AttachmentIds       []string    `json:"attachmentIds"`
	Type                string      `json:"type"`
	AutoFinishOnApprove bool        `json:"autoFinishOnApprove"`
	AutoFinishOnReject  bool        `json:"autoFinishOnReject"`
	Finished            bool        `json:"finished"`
	ID                  string      `json:"id"`
	Status              string      `json:"status"`
	FolderID            string      `json:"folderId,omitempty"`
}

type Attachment

type Attachment struct {
	ID                  string    `json:"id"`
	AuthorID            string    `json:"authorId"`
	Name                string    `json:"name"`
	CreatedDate         time.Time `json:"createdDate"`
	Version             int       `json:"version"`
	Type                string    `json:"type"`
	ContentType         string    `json:"contentType"`
	Size                int       `json:"size"`
	TaskID              string    `json:"taskId,omitempty"`
	CurrentAttachmentID string    `json:"currentAttachmentId,omitempty"`
	FolderID            string    `json:"folderId,omitempty"`
}

type Booking

type Booking struct {
	ID               string                  `json:"id"`
	FolderID         string                  `json:"folderId"`
	ResponsibleID    string                  `json:"responsibleId"`
	BookingDates     BookingDates            `json:"bookingDates"`
	EffortAllocation BookingEffortAllocation `json:"effortAllocation"`
}

type BookingDates

type BookingDates struct {
	Duration       int    `json:"duration"`
	StartDate      string `json:"startDate"`
	FinishDate     string `json:"finishDate"`
	WorkOnWeekends bool   `json:"workOnWeekends"`
}

type BookingEffortAllocation

type BookingEffortAllocation struct {
	ResponsibleAllocation []ResponsibleAllocation `json:"responsibleAllocation"`
	Mode                  string                  `json:"mode"`
	TotalEffort           int                     `json:"totalEffort"`
}

type Comment

type Comment struct {
	ID          string    `json:"id"`
	AuthorID    string    `json:"authorId"`
	Text        string    `json:"text"`
	UpdatedDate time.Time `json:"updatedDate"`
	CreatedDate time.Time `json:"createdDate"`
	TaskID      string    `json:"taskId,omitempty"`
	FolderID    string    `json:"folderId,omitempty"`
}

type Customfield

type Customfield struct {
	ID        string        `json:"id"`
	AccountID string        `json:"accountId"`
	Title     string        `json:"title"`
	Type      string        `json:"type"`
	SharedIds []interface{} `json:"sharedIds"`
	Settings  struct {
		InheritanceType       string `json:"inheritanceType"`
		DecimalPlaces         int    `json:"decimalPlaces"`
		UseThousandsSeparator bool   `json:"useThousandsSeparator"`
		Aggregation           string `json:"aggregation"`
		ReadOnly              bool   `json:"readOnly"`
	} `json:"settings,omitempty"`
	Settings0 struct {
		InheritanceType string `json:"inheritanceType"`
		ReadOnly        bool   `json:"readOnly"`
	} `json:"settings,omitempty"`
	Settings1 struct {
		InheritanceType string `json:"inheritanceType"`
		ReadOnly        bool   `json:"readOnly"`
	} `json:"settings,omitempty"`
}

type Decisions

type Decisions struct {
	ApproverID  string    `json:"approverId"`
	Comment     string    `json:"comment"`
	Status      string    `json:"status"`
	UpdatedDate time.Time `json:"updatedDate"`
}

type Dependence

type Dependence struct {
	ID            string `json:"id"`
	PredecessorID string `json:"predecessorId"`
	SuccessorID   string `json:"successorId"`
	RelationType  string `json:"relationType"`
}

type EffortAllocation

type EffortAllocation struct {
	// contains filtered or unexported fields
}

type Field

type Field struct {
	ID    string  `json:"id"`
	Value *string `json:"value"`
}

type Fields

type Fields []Field

func (Fields) ToBytes

func (Fields Fields) ToBytes() []byte

type Folder

type Folder struct {
	ID       string   `json:"id"`
	Title    string   `json:"title"`
	Children []string `json:"children"`
	ChildIds []string `json:"childIds"`
	Scope    string   `json:"scope"`
	Project  Project  `json:"project,omitempty"`
}

type Group

type Group struct {
	ID        string   `json:"id"`
	AccountID string   `json:"accountId"`
	Title     string   `json:"title"`
	MemberIds []string `json:"memberIds"`
	ChildIds  []string `json:"childIds"`
	ParentIds []string `json:"parentIds"`
	AvatarURL string   `json:"avatarUrl"`
}

type Invitation

type Invitation struct {
	ID             string    `json:"id"`
	AccountID      string    `json:"accountId"`
	Email          string    `json:"email"`
	Status         string    `json:"status"`
	InviterUserID  string    `json:"inviterUserId"`
	InvitationDate time.Time `json:"invitationDate"`
	ResolvedDate   time.Time `json:"resolvedDate"`
	Role           string    `json:"role"`
	External       bool      `json:"external"`
	FirstName      string    `json:"firstName,omitempty"`
	LastName       string    `json:"lastName,omitempty"`
}

type JobRole

type JobRole struct {
	ID         string `json:"id"`
	Title      string `json:"title"`
	ShortTitle string `json:"shortTitle"`
	AvatarURL  string `json:"avatarUrl"`
	IsDeleted  bool   `json:"isDeleted"`
}

type Metadata

type Metadata struct {
	Key   string  `json:"key"`
	Value *string `json:"value"`
}

type Metadatas

type Metadatas []Metadata

func (Metadatas) ToBytes

func (Metadatas Metadatas) ToBytes() []byte

type Profile

type Profile struct {
	AccountID string `json:"accountId"`
	Email     string `json:"email"`
	Role      string `json:"role"`
	External  bool   `json:"external"`
	Admin     bool   `json:"admin"`
	Owner     bool   `json:"owner"`
}

type Project

type Project struct {
	AuthorID       string   `json:"authorId"`
	OwnerIds       []string `json:"ownerIds"`
	Status         string   `json:"status"`
	CustomStatusID string   `json:"customStatusId"`
	StartDate      string   `json:"startDate"`
	EndDate        string   `json:"endDate"`
	CreatedDate    string   `json:"createdDate"`
	CompletedDate  string   `json:"completedDate"`
}

type ResponseAccount

type ResponseAccount struct {
	Kind string    `json:"kind"`
	Data []Account `json:"data"`
}

type ResponseApprovals

type ResponseApprovals struct {
	Kind string     `json:"kind"`
	Data []Approval `json:"data"`
}

type ResponseAttachments

type ResponseAttachments struct {
	Kind string       `json:"kind"`
	Data []Attachment `json:"data"`
}

type ResponseBookings

type ResponseBookings struct {
	Kind string    `json:"kind"`
	Data []Booking `json:"data"`
}

type ResponseComments

type ResponseComments struct {
	Kind string    `json:"kind"`
	Data []Comment `json:"data"`
}

type ResponseCustomFields

type ResponseCustomFields struct {
	Kind string        `json:"kind"`
	Data []Customfield `json:"data"`
}

type ResponseDependence

type ResponseDependence struct {
	Kind string       `json:"kind"`
	Data []Dependence `json:"data"`
}

type ResponseFolders

type ResponseFolders struct {
	Kind string   `json:"kind"`
	Data []Folder `json:"data"`
}

type ResponseGroups

type ResponseGroups struct {
	Kind string  `json:"kind"`
	Data []Group `json:"data"`
}

type ResponseInvitations

type ResponseInvitations struct {
	Kind string       `json:"kind"`
	Data []Invitation `json:"data"`
}

type ResponseJobRoles

type ResponseJobRoles struct {
	Kind string    `json:"kind"`
	Data []JobRole `json:"data"`
}

type ResponseTasks

type ResponseTasks struct {
	Kind string `json:"kind"`
	Data []Task `json:"data"`
}

type ResponseTimeLogs

type ResponseTimeLogs struct {
	Kind string    `json:"kind"`
	Data []TimeLog `json:"data"`
}

type ResponseUsers

type ResponseUsers struct {
	Kind string `json:"kind"`
	Data []User `json:"data"`
}

type ResponseWorkSchedules

type ResponseWorkSchedules struct {
	Kind string         `json:"kind"`
	Data []WorkSchedule `json:"data"`
}

type ResponseWorkflows

type ResponseWorkflows struct {
	Kind string     `json:"kind"`
	Data []Workflow `json:"data"`
}

type ResponsibleAllocation

type ResponsibleAllocation struct {
	UserID          string        `json:"userId"`
	DailyAllocation []interface{} `json:"dailyAllocation"`
}

type Subscription

type Subscription struct {
	Type      string `json:"type"`
	Suspended bool   `json:"suspended"`
	Paid      bool   `json:"paid"`
	UserLimit int    `json:"userLimit"`
}

type Task

type Task struct {
	ID               string        `json:"id"`
	AccountID        string        `json:"accountId"`
	Title            string        `json:"title"`
	Description      string        `json:"description"`
	BriefDescription string        `json:"briefDescription"`
	ParentIds        []string      `json:"parentIds"`
	SuperParentIds   []interface{} `json:"superParentIds"`
	SharedIds        []string      `json:"sharedIds"`
	ResponsibleIds   []string      `json:"responsibleIds"`
	Status           string        `json:"status"`
	Importance       string        `json:"importance"`
	CreatedDate      time.Time     `json:"createdDate"`
	UpdatedDate      time.Time     `json:"updatedDate"`
	Dates            TaskDate      `json:"dates"`
	Scope            string        `json:"scope"`
	AuthorIds        []string      `json:"authorIds"`
	CustomStatusID   string        `json:"customStatusId"`
	HasAttachments   bool          `json:"hasAttachments"`
	Permalink        string        `json:"permalink"`
	Priority         string        `json:"priority"`
	FollowedByMe     bool          `json:"followedByMe"`
	FollowerIds      []string      `json:"followerIds"`
	SuperTaskIds     []interface{} `json:"superTaskIds"`
	SubTaskIds       []string      `json:"subTaskIds"`
	DependencyIds    []string      `json:"dependencyIds"`
	Metadata         Metadatas     `json:"metadata"`
	CustomFields     Fields        `json:"customFields"`
}

type TaskDate

type TaskDate struct {
	Type     string  `json:"type"`
	Duration *int    `json:"duration"`
	Start    *string `json:"start"`
	Due      *string `json:"due"`
}

type TaskUpdate added in v0.0.6

type TaskUpdate struct {
	Title            string            `json:"title"`
	Description      *string           `json:"description"`
	Status           *string           `json:"status"`
	СustomStatus     *string           `json:"customStatus"`
	Importance       *string           `json:"importance"`
	Dates            *TaskDate         `json:"dates"`
	BillingType      string            `json:"billingType"`
	Shareds          []string          `json:"shareds"`
	Parents          []string          `json:"parents"`
	Responsibles     []string          `json:"responsibles"`
	Followers        []string          `json:"followers"`
	Follow           bool              `json:"follow"`
	PriorityBefore   *string           `json:"priorityBefore"`
	PriorityAfter    *string           `json:"priorityAfter"`
	SuperTasks       *string           `json:"superTasks"`
	Metadata         Metadatas         `json:"metadata"`
	CustomFields     Fields            `json:"customFields"`
	EffortAllocation *EffortAllocation `json:"effortAllocation"`
}

func (TaskUpdate) ToRequest added in v0.0.6

func (t TaskUpdate) ToRequest() (r string, err error)

type TimeLog

type TimeLog struct {
	ID          string    `json:"id"`
	TaskID      string    `json:"taskId"`
	UserID      string    `json:"userId"`
	CategoryID  string    `json:"categoryId,omitempty"`
	Hours       int       `json:"hours"`
	CreatedDate time.Time `json:"createdDate"`
	UpdatedDate time.Time `json:"updatedDate"`
	TrackedDate string    `json:"trackedDate"`
	Comment     string    `json:"comment"`
}

type User

type User struct {
	ID        string    `json:"id"`
	FirstName string    `json:"firstName"`
	LastName  string    `json:"lastName"`
	Type      string    `json:"type"`
	Profiles  []Profile `json:"profiles"`
	AvatarURL string    `json:"avatarUrl"`
	Timezone  string    `json:"timezone"`
	Locale    string    `json:"locale"`
	Deleted   bool      `json:"deleted"`
	Me        bool      `json:"me"`
	Phone     string    `json:"phone"`
}

type WorkSchedule

type WorkSchedule struct {
	ID           string `json:"id"`
	ScheduleType string `json:"scheduleType"`
	Title        string `json:"title"`
	Workweek     []struct {
		WorkDays        []string `json:"workDays"`
		CapacityMinutes int      `json:"capacityMinutes"`
	} `json:"workweek"`
}

type Workflow

type Workflow struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	Standard       bool   `json:"standard"`
	Hidden         bool   `json:"hidden"`
	CustomStatuses []struct {
		ID           string `json:"id"`
		Name         string `json:"name"`
		StandardName bool   `json:"standardName"`
		Color        string `json:"color"`
		Standard     bool   `json:"standard"`
		Group        string `json:"group"`
		Hidden       bool   `json:"hidden"`
	} `json:"customStatuses"`
}

Jump to

Keyboard shortcuts

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