types

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package types contains various types that are used to parse responses from the API.

Index

Constants

View Source
const (
	ContactTypePerson = "Person"
	ContactTypeGroup  = "Group"
)
View Source
const (
	WsRoot   TreeScope = "WsRoot"
	RbRoot   TreeScope = "RbRoot"
	WsFolder TreeScope = "WsFolder"
	RbFolder TreeScope = "RbFolder"
	WsTask   TreeScope = "WsTask"
	RbTask   TreeScope = "RbTask"

	Green     ProjectStatus = "Green"
	Yellow    ProjectStatus = "Yellow"
	Red       ProjectStatus = "Red"
	Completed ProjectStatus = "Completed"
	OnHold    ProjectStatus = "OnHold"
	Cancelled ProjectStatus = "Cancelled"
)
View Source
const (
	ActiveTaskStatus    TaskStatus = "Active"
	CompletedTaskStatus TaskStatus = "Completed"
	DeferredTaskStatus  TaskStatus = "Deferred"
	CancelledTaskStatus TaskStatus = "Cancelled"

	HighImportance   TaskImportance = "High"
	NormalImportance TaskImportance = "Normal"
	LowImportance    TaskImportance = "Low"

	BacklogType   TaskDatesType = "Backlog"
	MilestoneType TaskDatesType = "Milestone"
	PlannedType   TaskDatesType = "Planned"

	NoneEffortMode     TaskEffortMode = "None"
	FullTimeEffortMode TaskEffortMode = "FullTime"
	BasicEffortMode    TaskEffortMode = "Basic"
	FlexibleEffortMode TaskEffortMode = "Flexible"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID             AccountID      `json:"id"`
	Name           string         `json:"name"`
	DateFormat     string         `json:"dateFormat"`
	FirstDayOfWeek string         `json:"firstDayOfWeek"`
	WorkDays       WorkDays       `json:"workDays"`
	RootFolderID   FolderID       `json:"rootFolderId"`
	RecycleBinID   FolderID       `json:"recycleBinID"`
	CreatedDate    string         `json:"createdDate"`
	Subscription   Subscription   `json:"subscription"`
	Metadata       []Metadata     `json:"metadata"`
	CustomFields   CustomFieldSet `json:"customFields"`
	JoinedDate     string         `json:"joinedDate"`
}

Account represents a Wrike account.

type AccountID

type AccountID string

type Accounts

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

Accounts represents a list of Wrike account.

func NewAccountsFromJSON

func NewAccountsFromJSON(data []byte) (*Accounts, error)

NewAccountsFromJSON parses the given JSON (as byte sequence) and returns a new Accounts.

type Attachment

type Attachment struct {
	ID                  AttachmentID `json:"id"`
	AuthorId            string       `json:"authorId"`
	Name                string       `json:"name"`
	CreatedDate         string       `json:"createdDate"`
	Version             int          `json:"version"`
	Type                string       `json:"type"`
	ContentType         string       `json:"contentType"`
	Size                int          `json:"size"`
	TaskId              string       `json:"taskId"`
	FolderId            string       `json:"folderId"`
	CommentId           string       `json:"commentId,omitempty"`
	CurrentAttachmentId string       `json:"currentAttachmentId,omitempty"`
	PreviewUrl          string       `json:"previewUrl,omitempty"`
	Url                 string       `json:"url,omitempty"`
	PlaylistUrl         string       `json:"playlistUrl,omitempty"`
	ReviewIds           []string     `json:"reviewIds,omitempty"`
	Width               int          `json:"width,omitempty"`
	Height              int          `json:"height,omitempty"`
}

type AttachmentID

type AttachmentID string

type Attachments

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

func NewAttachmentsFromJSON

func NewAttachmentsFromJSON(data []byte) (*Attachments, error)

NewTasksFromJSON parses the given JSON (as byte sequence) and returns a new Tasks.

type Contact

type Contact struct {
	ID        ContactID   `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"`
	MemberIDs []ContactID `json:"memberIds"`
	Metadata  []Metadata  `json:"metadata"`
	Phone     string      `json:"phone"`
}

Contact represents a Wrike contact.

func (*Contact) IsGroup

func (c *Contact) IsGroup() bool

IsGroup returns true if and only if the contact is a group.

func (*Contact) IsPerson

func (c *Contact) IsPerson() bool

IsPerson returns true if and only if the contact is a person.

type ContactID

type ContactID string

ContactID is a string that represents a Wrike Contact ID

type Contacts

type Contacts struct {
	Kind string    `json:"kind"`
	Data []Contact `json:"data"`
}

Contacts represents a list of Wrike contacts.

func NewContactsFromJSON

func NewContactsFromJSON(data []byte) (*Contacts, error)

NewContactsFromJSON parses the given JSON (as byte sequence) and returns a new Contacts.

type CustomField

type CustomField struct {
	ID        CustomFieldID   `json:"id"`
	AccountID AccountID       `json:"accountId"`
	Title     string          `json:"title"`
	Type      CustomFieldType `json:"type"`
	SharedIDs []ContactID     `json:"sharedIds"`
	Settings  Settings        `json:"settings"`
}

CustomField represents a custom field object, a part of account.

type CustomFieldID

type CustomFieldID string

type CustomFieldSet

type CustomFieldSet []CustomField

CustomFieldSet represents a list of custom field objects.

type CustomFieldType

type CustomFieldType string
const (
	TextType       CustomFieldType = "Text"
	DropDownType   CustomFieldType = "DropDown"
	NumericType    CustomFieldType = "Numeric"
	CurrencyType   CustomFieldType = "Currency"
	PercentageType CustomFieldType = "Percentage"
	DateType       CustomFieldType = "Date"
	DurationType   CustomFieldType = "Duration"
	CheckBoxType   CustomFieldType = "CheckBox"
	ContactsType   CustomFieldType = "Contacts"
	MultipleType   CustomFieldType = "Multiple"
)

type CustomFields

type CustomFields struct {
	Kind string        `json:"kind"`
	Data []CustomField `json:"data"`
}

CustomFields represents a list of Wrike custom fields.

func NewCustomFieldsFromJSON

func NewCustomFieldsFromJSON(data []byte) (*CustomFields, error)

NewCustomFieldsFromJSON parses the given JSON (as byte sequence) and returns a new CustomFields.

type CustomStatus

type CustomStatus struct {
	ID           CustomStatusID `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"`
}

type CustomStatusID

type CustomStatusID string

type CustomStatuses

type CustomStatuses []CustomStatus

type DependencyID

type DependencyID string

type Field

type Field string

Field represents a Wrike field.

const (
	SubscriptionField Field = "subscription"
	MetadataField     Field = "metadata"
	CustomFieldsField Field = "customFields"
)

type Folder

type Folder struct {
	ID               FolderID         `json:"id"`
	AccountID        AccountID        `json:"accountId"`
	Title            string           `json:"title"`
	CreatedDate      string           `json:"createdDate"`
	UpdatedDate      string           `json:"updatedDate"`
	BriefDescription *string          `json:"briefDescription,omitempty"`
	Description      string           `json:"description"`
	Color            *string          `json:"color,omitempty"`
	SharedIDs        []ContactID      `json:"sharedIds"`
	ParentIDs        []FolderID       `json:"parentIds"`
	ChildIDs         []FolderID       `json:"childIds"`
	SuperParentIDs   []FolderID       `json:"superParentIds"`
	Scope            TreeScope        `json:"scope"`
	HasAttachments   bool             `json:"hasAttachments"`
	AttachmentCount  *int             `json:"attachmentCount,omitempty"`
	Permalink        string           `json:"permalink"`
	WorkflowID       WorkflowID       `json:"workflowId"`
	Metadata         *[]Metadata      `json:"metadata,omitempty"`
	CustomFields     *[]CustomField   `json:"customFields,omitempty"`
	CustomColumnIDs  *[]CustomFieldID `json:"customColumnIds"`
	Project          *Project         `json:"project"`
}

type FolderEntry

type FolderEntry struct {
	ID       FolderID   `json:"id"`
	Title    string     `json:"title"`
	Color    string     `json:"color,omitempty"`
	ChildIDs []FolderID `json:"childIds,omitempty"`
	Scope    TreeScope  `json:"scope,omitempty"`
	Project  Project    `json:"project,omitempty"`
}

type FolderID

type FolderID string

type FolderTree

type FolderTree struct {
	Kind string        `json:"kind"`
	Data []FolderEntry `json:"data"`
}

func NewFolderTreeFromJSON

func NewFolderTreeFromJSON(data []byte) (*FolderTree, error)

NewFolderTreeFromJSON parses the given JSON (as byte sequence) and returns a new Groups.

type Folders

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

func NewFoldersFromJSON

func NewFoldersFromJSON(data []byte) (*Folders, error)

NewFoldersFromJSON parses the given JSON (as byte sequence) and returns a new Groups.

type Group

type Group struct {
	ID        ContactID   `json:"id"`
	AccountID AccountID   `json:"accountId"`
	Title     string      `json:"title"`
	MemberIDs []ContactID `json:"memberIds"`
	ChildIDs  []ContactID `json:"childIds"`
	ParentIDs []ContactID `json:"parentIds"`
	AvatarURL string      `json:"avatarUrl"`
	MyTeam    bool        `json:"myTeam"`
	Metadata  []Metadata  `json:"metadata"`
}

Group represents a Wrike group.

type Groups

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

Groups represents a list of Wrike group.

func NewGroupsFromJSON

func NewGroupsFromJSON(data []byte) (*Groups, error)

NewGroupsFromJSON parses the given JSON (as byte sequence) and returns a new Groups.

type Metadata

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

Metadata represents a metadata, part of other API objects.

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"`
}

Profile represents a profile, part of Contact object.

type Project

type Project struct {
	AuthorID      ContactID     `json:"authorId,omitempty"`
	OwnerIDs      []ContactID   `json:"ownerIds"`
	Status        ProjectStatus `json:"status"`
	StartDate     string        `json:"startDate,omitempty"`
	EndDate       string        `json:"endDate,omitempty"`
	CreatedDate   string        `json:"createdDate,omitempty"`
	CompletedDate string        `json:"completedDate,omitempty"`
}

type ProjectStatus

type ProjectStatus string

type Settings

type Settings struct {
	InheritanceType       string `json:"inheritanceType"`
	DecimalPlaces         int    `json:"decimalPlaces"`
	UseThousandsSeparator bool   `json:"useThousandsSeparator"`
	Aggregation           string `json:"aggregation"`
}

Settings represents a settings object, a part of account.

type Subscription

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

Subscription represents a subscription object, a part of account.

type Task

type Task struct {
	ID               TaskID         `json:"id"`
	AccountID        AccountID      `json:"accountId"`
	Title            string         `json:"title"`
	Description      string         `json:"description,omitempty"`
	BriefDescription string         `json:"briefDescription,omitempty"`
	ParentIDs        []FolderID     `json:"parentIds,omitempty"`
	SuperParentIDs   []FolderID     `json:"superParentIds,omitempty"`
	SharedIDs        []ContactID    `json:"sharedIds,omitempty"`
	ResponsibleIDs   []ContactID    `json:"responsibleIds,omitempty"`
	Status           TaskStatus     `json:"status"`
	Importance       TaskImportance `json:"importance"`
	CreatedDate      string         `json:"createdDate"`
	UpdatedDate      string         `json:"updatedDate"`
	CompletedDate    string         `json:"completedDate"`
	Dates            TaskDates      `json:"dates"`
	Scope            TreeScope      `json:"scope"`
	AuthorIDs        []ContactID    `json:"authorIds,omitempty"`
	CustomStatusID   CustomStatusID `json:"customStatusId"`
	HasAttachments   bool           `json:"hasAttachments,omitempty"`
	AttachmentCount  int            `json:"attachmentCount,omitempty"`
	Permalink        string         `json:"permalink"`
	Priority         string         `json:"priority"`
	FollowedByMe     bool           `json:"followedByMe,omitempty"`
	FollwerIDs       []ContactID    `json:"followerIds,omitempty"`
	Recurrent        bool           `json:"recurrent,omitempty"`
	SuperTaskIDs     []TaskID       `json:"superTaskIds,omitempty"`
	SubTaskIDs       []TaskID       `json:"subTaskIds,omitempty"`
	DependencyIDs    []DependencyID `json:"dependencyIds,omitempty"`
	Metadata         []Metadata     `json:"metadata,omitempty"`
	CustomFields     []CustomField  `json:"customFields,omitempty"`
	EffortAllocation TaskEffort     `json:"effortAllocation,omitempty"`
}

type TaskDates

type TaskDates struct {
	Type           TaskDatesType `json:"type"`
	Duration       int           `json:"duration"`
	Start          string        `json:"start"`
	Due            string        `json:"due"`
	WorkOnWeekends bool          `json:"workOnWeekends,omitempty"`
}

type TaskDatesType

type TaskDatesType string

type TaskEffort

type TaskEffort struct {
	Mode            TaskEffortMode `json:"mode"`
	TotalEffort     int            `json:"totalEffort,omitempty"`
	AllocatedEffort int            `json:"allocatedEffort,omitempty"`
}

type TaskEffortMode

type TaskEffortMode string

type TaskID

type TaskID string

type TaskImportance

type TaskImportance string

type TaskStatus

type TaskStatus string

type Tasks

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

Tasks represents a list of Wrike task.

func NewTasksFromJSON

func NewTasksFromJSON(data []byte) (*Tasks, error)

NewTasksFromJSON parses the given JSON (as byte sequence) and returns a new Tasks.

type TreeScope

type TreeScope string

type WorkDay

type WorkDay string
const (
	Sun WorkDay = "Sun"
	Mon WorkDay = "Mon"
	Tue WorkDay = "Tue"
	Wed WorkDay = "Wed"
	Thu WorkDay = "Thu"
	Fri WorkDay = "Fri"
	Sat WorkDay = "Sat"
)

type WorkDays

type WorkDays []WorkDay

type Workflow

type Workflow struct {
	ID             WorkflowID     `json:"id"`
	Name           string         `json:"name"`
	Standard       bool           `json:"standard"`
	Hidden         bool           `json:"hidden"`
	CustomStatuses CustomStatuses `json:"customStatuses"`
}

Workflow represents a Wrike workflow.

type WorkflowID

type WorkflowID string

type Workflows

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

Workflows represents a list of Wrike workflow.

func NewWorkflowsFromJSON

func NewWorkflowsFromJSON(data []byte) (*Workflows, error)

NewWorkflowsFromJSON parses the given JSON (as byte sequence) and returns a new Workflows.

Jump to

Keyboard shortcuts

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