Documentation ¶
Index ¶
- type API
- func (api *API) Account() (*Account, error)
- func (api *API) Assignments() (Assignments, error)
- func (api *API) Clients() (Clients, error)
- func (api *API) FutureScheduledHours(from string) (FutureScheduledHours, error)
- func (api *API) FutureScheduledHoursForProject(from string, projectid int) (FutureScheduledHours, error)
- func (api *API) Milestones() (Milestones, error)
- func (api *API) People() (People, error)
- func (api *API) Person(id int) (*Person, error)
- func (api *API) Projects() (Projects, error)
- func (api *API) RemainingBudgetedHours() (RemainingBudgetedHours, error)
- func (api *API) RepeatedAssignmentSet(id int) (*RepeatedAssignmentSet, error)
- func (api *API) RepeatedAssignmentSets() (RepeatedAssignmentSets, error)
- func (api *API) Subscription() (*Subscription, error)
- func (api *API) UserConnections() (UserConnections, error)
- func (api *API) WhoAmI() (*CurrentUser, error)
- type Account
- type Assignment
- type Assignments
- type Client
- type Clients
- type CurrentUser
- type FutureScheduledHours
- type FutureScheduledHoursItem
- type Milestone
- type Milestones
- type People
- type Person
- type Project
- type Projects
- type RemainingBudgetedHours
- type RemainingBudgetedHoursItem
- type RepeatedAssignmentSet
- type RepeatedAssignmentSets
- type Subscription
- type UserConnection
- type UserConnections
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API provides access to the forecastapp.com API
func (*API) Assignments ¶
func (api *API) Assignments() (Assignments, error)
Assignments retrieves all assignments for the Forecast account
func (*API) FutureScheduledHours ¶
func (api *API) FutureScheduledHours(from string) (FutureScheduledHours, error)
FutureScheduledHours returns all future scheduled hours using the supplied date as the starting point
func (*API) FutureScheduledHoursForProject ¶
func (api *API) FutureScheduledHoursForProject(from string, projectid int) (FutureScheduledHours, error)
FutureScheduledHoursForProject returns all future scheduled hours for the given project using the supplied date as the starting point
func (*API) Milestones ¶
func (api *API) Milestones() (Milestones, error)
Milestones returns all milestones in the Forecast account
func (*API) RemainingBudgetedHours ¶
func (api *API) RemainingBudgetedHours() (RemainingBudgetedHours, error)
RemainingBudgetedHours returns the remaining budgeted hours for all Forecast projects
func (*API) RepeatedAssignmentSet ¶
func (api *API) RepeatedAssignmentSet(id int) (*RepeatedAssignmentSet, error)
RepeatedAssignmentSet returns the repeated assignment set for the given id
func (*API) RepeatedAssignmentSets ¶
func (api *API) RepeatedAssignmentSets() (RepeatedAssignmentSets, error)
RepeatedAssignmentSets returns a list of repeated assignment sets
func (*API) Subscription ¶
func (api *API) Subscription() (*Subscription, error)
Subscription returns information about the Forecast account subscription
func (*API) UserConnections ¶
func (api *API) UserConnections() (UserConnections, error)
UserConnections returns all current user connections
func (*API) WhoAmI ¶
func (api *API) WhoAmI() (*CurrentUser, error)
WhoAmI returns the CurrentUser for the logged in Forecast user
type Account ¶
type Account struct { ID int `json:"id"` Name string `json:"name"` WeeklyCapacity int `json:"weekly_capacity"` ColorLabels []struct { Name string `json:"name"` Label string `json:"label"` } `json:"color_labels"` HarvestSubdomain string `json:"harvest_subdomain"` HarvestName string `json:"harvest_name"` }
Account is a Forecast account
type Assignment ¶
type Assignment struct { ID int `json:"id"` StartDate string `json:"start_date"` EndDate string `json:"end_date"` Allocation int `json:"allocation"` Notes string `json:"notes"` UpdatedAt time.Time `json:"updated_at"` UpdatedByID int `json:"updated_by_id"` ProjectID int `json:"project_id"` PersonID int `json:"person_id"` PlaceholderID int `json:"placeholder_id"` RepeatedAssignmentSetID int `json:"repeated_assignment_set_id"` }
Assignment is a Forecast assignment
func (*Assignment) Weekdays ¶ added in v1.1.0
func (a *Assignment) Weekdays() int
Weekdays returns the number of working days between the start date and end date of the assignment
type Client ¶
type Client struct { ID int `json:"id"` Name string `json:"name"` HarvestID int `json:"harvest_id"` Archived bool `json:"archived"` UpdatedAt time.Time `json:"updated_at"` UpdatedByID int `json:"updated_by_id"` }
Client is a client may have one or more projects
type CurrentUser ¶
CurrentUser contains information about the current Forecast user
type FutureScheduledHours ¶
type FutureScheduledHours []FutureScheduledHoursItem
FutureScheduledHours is a list of future scheduled hours items
type FutureScheduledHoursItem ¶
type FutureScheduledHoursItem struct { ProjectID int `json:"project_id"` PersonID int `json:"person_id"` Allocation float64 `json:"allocation"` }
FutureScheduledHoursItem is a representation of the future scheduled hours for a project
type Milestone ¶
type Milestone struct { ID int `json:"id"` Name string `json:"name"` Date string `json:"date"` UpdatedAt time.Time `json:"updated_at"` UpdatedByID int `json:"updated_by_id"` ProjectID int `json:"project_id"` }
Milestone is a Forecast milestone
type Person ¶
type Person struct { ID int `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Email string `json:"email"` Login string `json:"login"` Admin bool `json:"admin"` Archived bool `json:"archived"` Subscribed bool `json:"subscribed"` AvatarURL string `json:"avatar_url"` Teams []string `json:"teams"` UpdatedAt time.Time `json:"updated_at"` UpdatedByID int `json:"updated_by_id"` HarvestUserID int `json:"harvest_user_id"` WeeklyCapacity int `json:"weekly_capacity"` WorkingDays struct { Monday bool `json:"monday"` Tuesday bool `json:"tuesday"` Wednesday bool `json:"wednesday"` Thursday bool `json:"thursday"` Friday bool `json:"friday"` } `json:"working_days"` ColorBlind bool `json:"color_blind"` }
Person is a person who is being scheduled in Forecast
type Project ¶
type Project struct { ID int `json:"id"` Name string `json:"name"` Color string `json:"color"` Code string `json:"code"` Notes string `json:"notes"` StartDate string `json:"start_date"` EndDate string `json:"end_date"` HarvestID int `json:"harvest_id"` Archived bool `json:"archived"` UpdatedAt time.Time `json:"updated_at"` UpdatedByID int `json:"updated_by_id"` ClientID int `json:"client_id"` Tags []string `json:"tags"` }
Project is a Forecast project
type RemainingBudgetedHours ¶
type RemainingBudgetedHours []RemainingBudgetedHoursItem
RemainingBudgetedHours is a list of remaining budgeted hours items
type RemainingBudgetedHoursItem ¶
type RemainingBudgetedHoursItem struct { ProjectID int `json:"project_id"` BudgetBy string `json:"budget_by"` Hours float64 `json:"hours"` ResponseCode int `json:"response_code"` }
RemainingBudgetedHoursItem is an aggregate representing the remaining budgeted hours for the given Forecast project
type RepeatedAssignmentSet ¶
type RepeatedAssignmentSet struct { ID int `json:"id"` FirstStartDate string `json:"first_start_date"` LastEndDate string `json:"last_end_date"` AssignmentIds []int `json:"assignment_ids"` }
RepeatedAssignmentSet is a repeated assignment set
type RepeatedAssignmentSets ¶
type RepeatedAssignmentSets []RepeatedAssignmentSet
RepeatedAssignmentSets is a list of repeated assignment sets
type Subscription ¶
type Subscription struct { NextBillingDate string `json:"next_billing_date"` Amount int `json:"amount"` AmountPerPerson int `json:"amount_per_person"` ReceiptRecipient string `json:"receipt_recipient"` Status string `json:"status"` PurchasedPeople int `json:"purchased_people"` Interval string `json:"interval"` Discounts struct { MonthlyPercentage int `json:"monthly_percentage"` YearlyPercentage int `json:"yearly_percentage"` } `json:"discounts"` Card struct { Brand string `json:"brand"` LastFour string `json:"last_four"` ExpiryMonth int `json:"expiry_month"` ExpiryYear int `json:"expiry_year"` } `json:"card"` Address struct { Line1 string `json:"line_1"` Line2 string `json:"line_2"` City string `json:"city"` State string `json:"state"` PostalCode string `json:"postal_code"` Country string `json:"country"` } `json:"address"` }
Subscription describes the Forecast subscription
type UserConnection ¶
type UserConnection struct { ID int `json:"id"` PersonID int `json:"person_id"` LastActiveAt time.Time `json:"last_active_at"` }
UserConnection includes information about currently connected users
type UserConnections ¶
type UserConnections []UserConnection
UserConnections is a list of UserConnection items