Documentation
¶
Overview ¶
Package teamworkapi provides utilities to interface with the Teamwork API.
Index ¶
- Constants
- func CalculateEstimateError(estimate float64, actual float64) float64
- func DurationInDays(from string, to string) (int, error)
- func InitLog(conf *LogConfig) error
- func SendEmail()
- func TotalAndAvgHours(e []*TimeEntry) (map[string]float64, error)
- type CalendarEvent
- type CalendarEventQueryParams
- type CalendarEventQueryParamsV3
- type CalendarEventResponseHandler
- type CalendarEventsJSON
- type CalendarEventsJSONV3
- type CalendarEventsV3JSON
- type Comment
- type CommentJSON
- type CommentResponseHandler
- type CompaniesJSON
- type Company
- type Connection
- func (conn *Connection) DeleteRequest(endpoint string, resHandler ResponseHandler) error
- func (conn *Connection) DeleteTimeEntry(ID string) error
- func (conn *Connection) GetCalendarEvents(queryParams CalendarEventQueryParams) ([]*CalendarEvent, error)
- func (conn *Connection) GetCalendarEventsV3(queryParams CalendarEventQueryParamsV3) ([]*CalendarEventsV3JSON, error)
- func (conn *Connection) GetCompanies() ([]*Company, error)
- func (conn *Connection) GetPeople(queryParams PeopleQueryParams) ([]*Person, error)
- func (conn *Connection) GetPeopleByCompany(companyID string) ([]*Person, error)
- func (conn *Connection) GetPersonByID(ID string) (*Person, error)
- func (conn *Connection) GetProjectV3(projectId string) (*ProjectV3, error)
- func (conn *Connection) GetProjects(queryParams *ProjectQueryParams) ([]*Project, error)
- func (conn *Connection) GetRequest(endpoint string, params QueryParams) ([]byte, error)
- func (conn *Connection) GetRequestV3(endpoint string, params QueryParamsV3) ([]byte, error)
- func (conn *Connection) GetSubtaskV3(parentTaskID string) (*TasksV3Res, error)
- func (conn Connection) GetTags() ([]*Tag, error)
- func (conn *Connection) GetTaskByID(ID string) (*Task, error)
- func (conn *Connection) GetTaskByIDV3(ID string) (*TaskVersion3, error)
- func (conn *Connection) GetTaskHours(taskID string) (*TimeTotals, error)
- func (conn *Connection) GetTasks(queryParams TaskQueryParams) ([]*Task, error)
- func (conn *Connection) GetTimeEntries(queryParams *TimeQueryParams) ([]*TimeEntry, error)
- func (conn Connection) GetTimeEntriesByPerson(personID string, fromDate string, toDate string) ([]*TimeEntry, error)
- func (conn *Connection) GetTimeEntriesByTask(ID string) ([]*TimeEntry, error)
- func (conn *Connection) GetTimeEntriesV3(queryParams *TimeQueryParamsV3) ([]*TimeLogV3, error)
- func (conn *Connection) PatchFile(fileID string, patchData FileVersion3) (*FileResponseHandlerV3, error)
- func (conn *Connection) PatchRequest(endpoint string, data []byte, resHandler ResponseHandler) error
- func (conn *Connection) PatchTask(taskID string, putData TaskPatchV3JSON) (int, error)
- func (conn *Connection) PostComment(ResourceId string, postData CommentJSON) (string, error)
- func (conn *Connection) PostNewFileVersion(existingFileID string, postData FileVersionBody) (*FileVersionRes, error)
- func (conn *Connection) PostRequest(endpoint string, data []byte, resHandler ResponseHandler) error
- func (conn *Connection) PostSubTask(parentTaskID string, postData TaskV3JSON) (int, error)
- func (conn *Connection) PostTask(taskListID string, postData TaskV3JSON) (int, error)
- func (conn *Connection) PostTimeEntry(entry *TimeEntry) (string, error)
- type EventType
- type FileConnection
- type FileResponse
- type FileResponseHandlerV3
- type FileVersion3
- type FileVersionBody
- type FileVersionRes
- type GeneralResponse
- type LogConfig
- type PeopleJSON
- type PeopleQueryParams
- type Person
- type PersonJSON
- type PreSignedRes
- type Project
- type ProjectDataV3
- type ProjectQueryParams
- type ProjectV3
- type ProjectsJSON
- type QueryParams
- type QueryParamsV3
- type ResponseHandler
- type TWAPIConf
- type Tag
- type TagJSON
- type TagsJSON
- type Task
- type TaskJSON
- type TaskPatchAttachments
- type TaskPatchPendingFiles
- type TaskPatchV3JSON
- type TaskQueryParams
- type TaskRes
- type TaskResponseHandlerV3
- type TaskResponseV3
- type TaskTimeTotalJSON
- type TaskTimeTotalsJSON
- type TaskV3
- type TaskV3JSON
- type TaskVersion3
- type TasksJSON
- type TasksV3
- type TasksV3Res
- type TimeEntriesJSON
- type TimeEntry
- type TimeEntryJSON
- type TimeLogJSON
- type TimeLogV3
- type TimeQueryParams
- type TimeQueryParamsV3
- type TimeResponseHandler
- type TimeResponseHandlerV3
- type TimeTotals
Constants ¶
const ( // Replace [email protected] with your "From" address. // This address must be verified with Amazon SES. Sender = "[email protected]" // Replace [email protected] with a "To" address. If your account // is still in the sandbox, this address must be verified. Recipient = "[email protected]" // The subject line for the email. Subject = "Amazon SES Test (AWS SDK for Go)" // The HTML body for the email. HtmlBody = "<h1>Amazon SES Test Email (AWS SDK for Go)</h1><p>This email was sent with " + "<a href='https://aws.amazon.com/ses/'>Amazon SES</a> using the " + "<a href='https://aws.amazon.com/sdk-for-go/'>AWS SDK for Go</a>.</p>" //The email body for recipients with non-HTML email clients. TextBody = "This email was sent with Amazon SES using the AWS SDK for Go." // The character encoding for the email. CharSet = "UTF-8" )
const TeamworkDateFormatLong = "2006-01-02T15:04:05Z"
TeamworkDateFormatLong is the long-form of a date/time used by Teamwork.
const TeamworkDateFormatMed = "2006-01-02T15:04"
TeamworkDateFormatMed is the medium-form of a date/time used by Teamwork.
const TeamworkDateFormatShort = "20060102"
TeamworkDateFormatShort is the short-form of a date used by Teamwork.
Variables ¶
This section is empty.
Functions ¶
func CalculateEstimateError ¶
CalculateEstimateError determines the percent error of a time estimate.
func DurationInDays ¶
DurationInDays gets the number of days between the specified dates.
Types ¶
type CalendarEvent ¶
type CalendarEvent struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Start string `json:"start"`
End string `json:"end"`
AllDay bool `json:"all-day"`
Type *EventType `json:"type"`
AttendeeIDs string `json:"attending-user-ids"`
Status string `json:"status"`
}
CalendarEvent models a Teamwork Calendar event.
type CalendarEventQueryParams ¶
type CalendarEventQueryParams struct {
UserID string `url:"userId,omitempty"`
From string `url:"startdate,omitempty"`
To string `url:"endDate,omitempty"`
EventTypeID string `url:"eventTypeId,omitempty"`
}
CalendarEventQueryParams defines valid query parameters for this resource.
func (CalendarEventQueryParams) FormatQueryParams ¶
func (qp CalendarEventQueryParams) FormatQueryParams() (string, error)
FormatQueryParams formats query parameters for this resource.
type CalendarEventQueryParamsV3 ¶
type CalendarEventQueryParamsV3 struct {
EndDate string `url:"endDate,omitempty"`
StartDate string `url:"startDate,omitempty"`
ProjectID string `url:"projectId,omitempty"`
PageSize string `url:"pageSize,omitempty"`
}
func (CalendarEventQueryParamsV3) FormatQueryParamsV3 ¶
func (qp CalendarEventQueryParamsV3) FormatQueryParamsV3() (string, error)
type CalendarEventResponseHandler ¶
type CalendarEventResponseHandler struct {
Status string `json:"STATUS"`
Message string `json:"MESSAGE"`
}
CalendarEventResponseHandler models a http response for a Calendar Event operation.
type CalendarEventsJSON ¶
type CalendarEventsJSON struct {
Events []*CalendarEvent `json:"events"`
}
CalendarEventsJSON models the parent JSON structure of an array of CalendarEvent and facilitates unmarshalling.
type CalendarEventsJSONV3 ¶
type CalendarEventsJSONV3 struct {
Events []*CalendarEventsV3JSON `json:"calendarEvents"`
}
type CalendarEventsV3JSON ¶
type Comment ¶
type Comment struct {
Comment CommentJSON `json:"comment"`
}
type CommentJSON ¶
type CommentResponseHandler ¶
type CommentResponseHandler struct {
Status string `json:"STATUS"`
Message string `json:"MESSAGE"`
}
func (*CommentResponseHandler) ParseResponse ¶
func (resMsg *CommentResponseHandler) ParseResponse(httpMethod string, rawRes []byte) error
type ResponseHandler struct {
Status string `json:"STATUS"`
Message string `json:"MESSAGE"`
}
type CompaniesJSON ¶
type CompaniesJSON struct {
Companies []*Company `json:"companies"`
}
CompaniesJSON models the parent JSON structure of an array of Companys and facilitates unmarshalling.
type Connection ¶
type Connection struct {
APIKey string `json:"apiKey"`
SiteName string `json:"siteName"`
DataPreference string `json:"dataPreference"`
APIVersion string `json:"apiVersion`
URL string
RequestURL string
}
Connection stores info needed to establish Teamwork API Connection
func NewConnection ¶
func NewConnection(apiKey string, siteName string, dataPreference string, apiVersion string) (*Connection, error)
NewConnection initializes a new instance used to generate Teamwork API calls. If dataPreference is empty string (""), it will default to json.
func NewConnectionFromJSON ¶
func NewConnectionFromJSON(pathToJSONFile string) (*Connection, error)
NewConnectionFromJSON initializes a new instance based on json file.
func (*Connection) DeleteRequest ¶
func (conn *Connection) DeleteRequest(endpoint string, resHandler ResponseHandler) error
DeleteRequest submits a DELETE request to Teamwork API. The ResponseHandler is used to properly interpret the http response and store the response content ([]byte) for further processing. If ResponseHandler is nil, the GeneralResponse will be used.
func (*Connection) DeleteTimeEntry ¶
func (conn *Connection) DeleteTimeEntry(ID string) error
DeleteTimeEntry deletes a time entry with the specified ID.
func (*Connection) GetCalendarEvents ¶
func (conn *Connection) GetCalendarEvents(queryParams CalendarEventQueryParams) ([]*CalendarEvent, error)
GetCalendarEvents returns an array of tasks based on one or more query parameters.
func (*Connection) GetCalendarEventsV3 ¶
func (conn *Connection) GetCalendarEventsV3(queryParams CalendarEventQueryParamsV3) ([]*CalendarEventsV3JSON, error)
func (*Connection) GetCompanies ¶
func (conn *Connection) GetCompanies() ([]*Company, error)
GetCompanies retrieves all companies from Teamwork.
func (*Connection) GetPeople ¶
func (conn *Connection) GetPeople(queryParams PeopleQueryParams) ([]*Person, error)
GetPeople retrieves people based on query parameters.
func (*Connection) GetPeopleByCompany ¶
func (conn *Connection) GetPeopleByCompany(companyID string) ([]*Person, error)
GetPeopleByCompany retrieves all people from the company specified by companyID.
func (*Connection) GetPersonByID ¶
func (conn *Connection) GetPersonByID(ID string) (*Person, error)
GetPersonByID retrieves a specific person based on ID.
func (*Connection) GetProjectV3 ¶
func (conn *Connection) GetProjectV3(projectId string) (*ProjectV3, error)
GetProjects retrieve projects specified by queryParams.
func (*Connection) GetProjects ¶
func (conn *Connection) GetProjects(queryParams *ProjectQueryParams) ([]*Project, error)
GetProjects retrieve projects specified by queryParams.
func (*Connection) GetRequest ¶
func (conn *Connection) GetRequest(endpoint string, params QueryParams) ([]byte, error)
GetRequest performs a HTTP GET on the desired endpoint, with the specific query parameters.
func (*Connection) GetRequestV3 ¶
func (conn *Connection) GetRequestV3(endpoint string, params QueryParamsV3) ([]byte, error)
func (*Connection) GetSubtaskV3 ¶
func (conn *Connection) GetSubtaskV3(parentTaskID string) (*TasksV3Res, error)
func (*Connection) GetTaskByID ¶
func (conn *Connection) GetTaskByID(ID string) (*Task, error)
GetTaskByID retrieves a specific task based on ID.
func (*Connection) GetTaskByIDV3 ¶
func (conn *Connection) GetTaskByIDV3(ID string) (*TaskVersion3, error)
GetTaskByID retrieves a specific task based on ID.
func (*Connection) GetTaskHours ¶
func (conn *Connection) GetTaskHours(taskID string) (*TimeTotals, error)
GetTaskHours returns actual and estimated hours, and percent error in estimated hours for the specified task.
func (*Connection) GetTasks ¶
func (conn *Connection) GetTasks(queryParams TaskQueryParams) ([]*Task, error)
GetTasks returns an array of tasks based on one or more query parameters.
func (*Connection) GetTimeEntries ¶
func (conn *Connection) GetTimeEntries(queryParams *TimeQueryParams) ([]*TimeEntry, error)
GetTimeEntries retrieve time entries specified by queryParams.
func (Connection) GetTimeEntriesByPerson ¶
func (conn Connection) GetTimeEntriesByPerson(personID string, fromDate string, toDate string) ([]*TimeEntry, error)
GetTimeEntriesByPerson retrieves time entries for a specific Teamwork user, for the specified time period.
func (*Connection) GetTimeEntriesByTask ¶
func (conn *Connection) GetTimeEntriesByTask(ID string) ([]*TimeEntry, error)
GetTimeEntriesByTask retrieves all time entries for the specified Task.
func (*Connection) GetTimeEntriesV3 ¶
func (conn *Connection) GetTimeEntriesV3(queryParams *TimeQueryParamsV3) ([]*TimeLogV3, error)
func (*Connection) PatchFile ¶
func (conn *Connection) PatchFile(fileID string, patchData FileVersion3) (*FileResponseHandlerV3, error)
func (*Connection) PatchRequest ¶
func (conn *Connection) PatchRequest(endpoint string, data []byte, resHandler ResponseHandler) error
PatchRequest submits a POST request to Teamwork API. The ResponseHandler is used to properly interpret the http response and store the response content ([]byte) for further processing. If ResponseHandler is nil, the GeneralResponse will be used.
func (*Connection) PatchTask ¶
func (conn *Connection) PatchTask(taskID string, putData TaskPatchV3JSON) (int, error)
func (*Connection) PostComment ¶
func (conn *Connection) PostComment(ResourceId string, postData CommentJSON) (string, error)
func (*Connection) PostNewFileVersion ¶
func (conn *Connection) PostNewFileVersion(existingFileID string, postData FileVersionBody) (*FileVersionRes, error)
func (*Connection) PostRequest ¶
func (conn *Connection) PostRequest(endpoint string, data []byte, resHandler ResponseHandler) error
PostRequest submits a POST request to Teamwork API. The ResponseHandler is used to properly interpret the http response and store the response content ([]byte) for further processing. If ResponseHandler is nil, the GeneralResponse will be used.
func (*Connection) PostSubTask ¶
func (conn *Connection) PostSubTask(parentTaskID string, postData TaskV3JSON) (int, error)
Creates a subtask given the parent's task ID
func (*Connection) PostTask ¶
func (conn *Connection) PostTask(taskListID string, postData TaskV3JSON) (int, error)
Creates a Task given the task list Id
func (*Connection) PostTimeEntry ¶
func (conn *Connection) PostTimeEntry(entry *TimeEntry) (string, error)
PostTimeEntry posts an individual time entry to the specified task. The time entry is posted to the task ID found in the entry parameter.
type EventType ¶
type EventType struct {
ID string `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
}
EventType models a Teamwork Calendar Event Type.
type FileConnection ¶
func NewFileConnection ¶
func NewFileConnection(SiteName string, FileName string, FullPathToFile string, APIKey string) (*FileConnection, error)
Used for initially uploading a file
func (*FileConnection) PutFile ¶
func (fc *FileConnection) PutFile() (string, error)
type FileResponse ¶
type FileResponseHandlerV3 ¶
type FileResponseHandlerV3 struct {
Status string `json:"STATUS"`
Message string `json:"MESSAGE"`
File FileResponse `json:"file`
}
func (*FileResponseHandlerV3) ParseResponse ¶
func (resMsg *FileResponseHandlerV3) ParseResponse(httpMethod string, rawRes []byte) error
type FileVersion3 ¶
type FileVersion3 struct {
File struct {
Id int `json:"id,omitempty"`
CategoryId int `json:"categoryId,omitempty"`
} `json:"file"`
}
models a file from TW, add addional fields as needed
type FileVersionBody ¶
type FileVersionRes ¶
type FileVersionRes struct {
FileVersion struct {
FileVersionId int `json:"fileVersionId"`
Status string `json:"STATUS"`
Message string `json:"MESSAGE"`
} `json:"fileversion"`
}
func (*FileVersionRes) ParseResponse ¶
func (resMsg *FileVersionRes) ParseResponse(httpMethod string, rawRes []byte) error
type GeneralResponse ¶
GeneralResponse implements the ResponseHandler interface to interpret a general response that includes a Status and optionally, a Message
func (*GeneralResponse) ParseResponse ¶
func (resMsg *GeneralResponse) ParseResponse(httpMethod string, rawRes []byte) error
ParseResponse interprets a general http response for a POST, PUT, UPDATE, etc.
type LogConfig ¶
LogConfig models a logrus log configuration.
func LoadLogConfig ¶
LoadLogConfig loads log configuration from json file specified by path.
type PeopleJSON ¶
type PeopleJSON struct {
People []*Person `json:"people"`
}
PeopleJSON models the parent JSON structure of an array of Persons and facilitates unmarshalling.
type PeopleQueryParams ¶
type PeopleQueryParams struct {
ProjectID string `url:"projectId,omitempty"`
UserID string `url:"userIds,omitempty"`
CompanyID string `url:"companyId,omitempty"`
}
PeopleQueryParams defines valid query parameters for this resource.
func (PeopleQueryParams) FormatQueryParams ¶
func (qp PeopleQueryParams) FormatQueryParams() (string, error)
FormatQueryParams formats query parameters for this resource.
type Person ¶
type Person struct {
ID string `json:"id"`
FirstName string `json:"first-name"`
LastName string `json:"last-name"`
CompanyName string `json:"company-name"`
Email string `json:"user-name"`
}
Person models an individual Teamwork user.
type PersonJSON ¶
type PersonJSON struct {
Person *Person `json:"person"`
}
PersonJSON is a wrapper to facilitate marshalling of Person data to json.
type PreSignedRes ¶
type Project ¶
type Project struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
Company Company `json:"company"`
}
Project models a Teamwork project.
type ProjectDataV3 ¶
type ProjectQueryParams ¶
type ProjectQueryParams struct {
CompanyID string `url:"companyId,omitempty"`
Status string `url:"status,omitempty"`
PageSize string `url:"pageSize,omitempty"`
}
ProjectQueryParams defines valid query parameters for this resource.
func (*ProjectQueryParams) FormatQueryParams ¶
func (qp *ProjectQueryParams) FormatQueryParams() (string, error)
FormatQueryParams formats query parameters for this resource.
type ProjectV3 ¶
type ProjectV3 struct {
Project ProjectDataV3 `json:"project"`
}
type ProjectsJSON ¶
type ProjectsJSON struct {
Projects []*Project `json:"projects"`
}
ProjectsJSON provides a wrapper around TimeEntry to properly marshal json daProjectsosting to API.
type QueryParams ¶
QueryParams is a generic interface to be implemented by a resource (e.g. Projects, Tasks, People, etc.) to format url query parameters.
type QueryParamsV3 ¶
type ResponseHandler ¶
ResponseHandler is a generic interface to be implemented by a resource (e.g. Projects, Tasks, People, etc.) to properly interpret a http response.
type TWAPIConf ¶
type TWAPIConf struct {
APIKey string `json:"apiKey"`
SiteName string `json:"siteName"`
APIVersion string `json:"apiVersion`
PreSignedURL string `json:"preSignedUrl"`
}
General TW API Configurations. This is not tied to any function(s).
type Tag ¶
type Tag struct {
IDBuff interface{} `json:"id"` // ID can show up as int or string in API response
Name string `json:"name"`
Color string `json:"color"`
}
Tag models an individual tag in Teamwork.
type TagJSON ¶
type TagJSON struct {
Tag *Tag `json:"tag"`
}
TagJSON provides a wrapper around Tag to properly marshal json data when posting to API.
type TagsJSON ¶
type TagsJSON struct {
Tags []*Tag `json:"tags"`
}
TagsJSON models the parent JSON structure of an array of Tags and facilitates unmarshalling.
type Task ¶
type Task struct {
ID int `json:"id"`
Title string `json:"content"`
Description string `json:"description"`
ProjectID int `json:"project-id"`
TaskListID int `json:"todo-list-id"`
Status string `json:"status"`
CompanyID int `json:"company-id"`
DueDate string `json:"due-date"`
CreatedOn string `json:"created-on"`
CompletedOn string `json:"completed_on"`
EstimatedMin int `json:"estimated-minutes"`
Priority string `json:"priority"`
AssignedUserID string `json:"responsible-party-id"`
TimeTotals *TimeTotals
Tags []Tag `json:"tags"`
}
Task models a specific task in Teamwork.
type TaskJSON ¶
type TaskJSON struct {
Task *Task `json:"todo-item"`
}
TaskJSON models the parent JSON structure of an individual task and facilitates unmarshalling.
type TaskPatchAttachments ¶
type TaskPatchAttachments struct {
PendingFiles []TaskPatchPendingFiles `json:"pendingFiles"`
}
type TaskPatchPendingFiles ¶
type TaskPatchV3JSON ¶
type TaskPatchV3JSON struct {
Attachments TaskPatchAttachments `json:"attachments,omitempty"`
Task struct {
Description string `json:"description,omitempty"`
} `json:"task"`
}
type TaskQueryParams ¶
type TaskQueryParams struct {
AssignedUserID string `url:"responsible-party-ids,omitempty"`
FromDate string `url:"startDate,omitempty"`
ToDate string `url:"endDate,omitempty"`
IncludeCompleted bool `url:"includeCompletedTasks,omitempty"`
Include string `url:"include,omitempty"`
ProjectIDs string `url:"projectIds,omitempty"`
PageSize string `url:"pageSize,omitempty"`
CompletedBefore string `url:"completedBefore"`
CompletedAfter string `url:"completedAfter"`
}
TaskQueryParams defines valid query parameters for this resource.
func (TaskQueryParams) FormatQueryParams ¶
func (qp TaskQueryParams) FormatQueryParams() (string, error)
FormatQueryParams formats query parameters for this resource.
type TaskResponseHandlerV3 ¶
type TaskResponseHandlerV3 struct {
Status string `json:"STATUS"`
Message string `json:"MESSAGE"`
Task TaskResponseV3 `json:"task`
}
TaskResponseHandlerV3 models a http response for a Task operation using version 3 of teamwork api.
func (*TaskResponseHandlerV3) ParseResponse ¶
func (resMsg *TaskResponseHandlerV3) ParseResponse(httpMethod string, rawRes []byte) error
type TaskResponseV3 ¶
type TaskResponseV3 struct {
ID int `json:"id"`
}
type TaskTimeTotalJSON ¶
type TaskTimeTotalJSON struct {
Tasklist struct {
Task struct {
TimeEstimates struct {
EstimatedHours string `json:"total-hours-estimated"`
} `json:"time-estimates"`
TimeTotals struct {
ActualHours string `json:"total-hours-sum"`
} `json:"time-totals"`
} `json:"task"`
} `json:"tasklist"`
}
TaskTimeTotalJSON is used to unmarshal the json response provided by call to Teamwork API endpoint /tasks/{id}/time/total.json.
type TaskTimeTotalsJSON ¶
type TaskTimeTotalsJSON struct {
Data []*TaskTimeTotalJSON `json:"projects"`
}
TaskTimeTotalsJSON is used to unmarshal the json response provided by call to Teamwork API endpoint /tasks/{id}/time/total.json.
type TaskV3 ¶
type TaskV3 struct {
Id int `json:"id"`
Description string `json:"description"`
EstimatedMinutes int `json:"estimatedMinutes"`
Name string `json:"name"`
Private bool `json:"private"`
ParentTaskID int `json:"parentTaskId"`
Assignees map[string][]int64 `json:"assignees"`
DueAt string `json:"dueAt"`
StartAt string `json:"startAt"`
}
type TaskV3JSON ¶
type TaskV3JSON struct {
Task TaskV3 `json:"task"`
}
type TaskVersion3 ¶
type TaskVersion3 struct {
Task struct {
Id int `json:"id"`
Description string `json:"description"`
Status string `json:"status"`
EstimatedMinutes int `json:"estimatedMinutes"`
Name string `json:"name"`
Private bool `json:"private"`
ParentTaskID int `json:"parentTaskId"`
Assigness []struct {
ID int `json:"id"`
Type string `json:"type"`
} `json:"assignees"`
Attachments []struct {
ID int `json:"id"`
Type string `json:"type"`
} `json:"attachments"`
} `json:"task"`
}
Task models a specific task in Teamwork for Version 3. Refer to TW API docs to add additonal fields as requried.
type TasksJSON ¶
type TasksJSON struct {
Tasks []*Task `json:"todo-items"`
}
TasksJSON models the parent JSON structure of an array of tasks and facilitates unmarshalling.
type TasksV3 ¶
type TasksV3 struct {
Status string `json:"STATUS"`
Message string `json:"MESSAGE"`
Tasks []TaskResponseV3 `json:"tasks`
}
type TasksV3Res ¶
type TasksV3Res struct {
Tasks []TaskRes `json:"tasks"`
}
type TimeEntriesJSON ¶
type TimeEntriesJSON struct {
TimeEntries []*TimeEntry `json:"time-entries"`
}
TimeEntriesJSON models the parent JSON structure of an array of TimeEntrys and facilitates unmarshalling.
type TimeEntry ¶
type TimeEntry struct {
ID string `json:"id"`
PersonID string `json:"person-id"`
Lastname string `json:"person-last-name"`
Firstname string `json:"person-first-name"`
Description string `json:"description"`
Hours string `json:"hours"`
Minutes string `json:"minutes"`
Date string `json:"date"` // expected format is YYYYMMDD
IsBillable string `json:"isbillable"`
ProjectID string `json:"project-id"`
TaskID string `json:"todo-item-id"`
}
TimeEntry models an individual time entry.
type TimeEntryJSON ¶
type TimeEntryJSON struct {
Entry *TimeEntry `json:"time-entry"`
}
TimeEntryJSON provides a wrapper around TimeEntry to properly marshal json data when posting to API.
type TimeLogJSON ¶
type TimeLogJSON struct {
TimeLog []*TimeLogV3 `json:"timelogs"`
}
type TimeQueryParams ¶
type TimeQueryParams struct {
UserID string `url:"userId,omitempty"`
FromDate string `url:"fromdate,omitempty"`
ToDate string `url:"todate,omitempty"`
PageSize string `url:"pageSize,omitempty"`
}
TimeQueryParams defines valid query parameters for this resource.
func (*TimeQueryParams) FormatQueryParams ¶
func (qp *TimeQueryParams) FormatQueryParams() (string, error)
FormatQueryParams formats query parameters for this resource.
type TimeQueryParamsV3 ¶
type TimeQueryParamsV3 struct {
EndDate string `url:"endDate,omitempty"`
StartDate string `url:"startDate,omitempty"`
AssignedToUserIds []string `url:"assignedToUserIds,omitempty"`
ProjectID string `url:"projectId,omitempty"`
PageSize string `url:"pageSize,omitempty"`
}
func (*TimeQueryParamsV3) FormatQueryParamsV3 ¶
func (qp *TimeQueryParamsV3) FormatQueryParamsV3() (string, error)
type TimeResponseHandler ¶
type TimeResponseHandler struct {
Status string `json:"STATUS"`
Message string `json:"MESSAGE"`
TimeEntryID string `json:"timeLogId"`
}
TimeResponseHandler models a http response for a TimeEntry operation.
func (*TimeResponseHandler) ParseResponse ¶
func (resMsg *TimeResponseHandler) ParseResponse(httpMethod string, rawRes []byte) error
ParseResponse interprets a http response for a TimeEntry operation such as POST, PUT, UPDATE
type TimeResponseHandlerV3 ¶
type TimeTotals ¶
TimeTotals summarizes actual and estimated hours for a specific task.