harvest

package
v0.0.0-...-66f9686 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	Client  *ClientService
	People  *PersonService
	Project *ProjectService
	Invoice *InvoiceService
	Account *AccountService
	// contains filtered or unexported fields
}

func NewAPIClientWithAuthToken

func NewAPIClientWithAuthToken(token, subdomain string) (c *APIClient)

func NewAPIClientWithBasicAuth

func NewAPIClientWithBasicAuth(username, password, subdomain string) (c *APIClient)

func (*APIClient) GetJSON

func (c *APIClient) GetJSON(path string) (err error, jsonResponse []byte)

type Account

type Account struct {
	Company Company
	Person  Person
}

type AccountService

type AccountService struct {
	Service
}

func (*AccountService) Find

func (a *AccountService) Find() (err error, account Account)

type Client

type Client struct {
	Name                    string    `json:"name"`
	Currency                string    `json:"currency"`
	Active                  bool      `json:"active"`
	Id                      int       `json:"id"`
	HighriseId              int       `json:"highrise_id"`
	CreatedAt               time.Time `json:"created_at"`
	UpdatedAt               time.Time `json:"created_at"`
	Details                 string    `json:"details"`
	DefaultInvoiceTimeframe string    `json:"default_invoice_timeframe"`
	LastInvoiceKind         string    `json:"last_invoice_kind"`
}

type ClientResponse

type ClientResponse struct {
	Client Client
}

type ClientService

type ClientService struct {
	Service
}

func (*ClientService) Find

func (c *ClientService) Find(clientID int) (err error, client Client)

func (*ClientService) List

func (c *ClientService) List() (err error, clients []Client)

type Company

type Company struct {
	BaseURI            string  `json:"base_uri"`
	FullDomain         string  `json:"full_domain"`
	Name               string  `json:"name"`
	Active             bool    `json:"active"`
	WeekStartDay       string  `json:"week_start_day"`
	TimeFormat         string  `json:"hours_minutes"`
	Clock              string  `json:"clock"`
	DecimalSymbol      string  `json:"decimal_symbol"`
	ColorScheme        string  `json:"color_scheme"`
	Modules            Modules `json:"modules"`
	ThousandsSeperator string  `json:"thousands_seperator"`
}

type HarvestDate

type HarvestDate struct {
	time.Time
}

func (*HarvestDate) UnmarshalJSON

func (harvestDate *HarvestDate) UnmarshalJSON(input []byte) (err error)

type Invoice

type Invoice struct {
	Id                 int         `json:"id"`
	Amount             float32     `json:"amount"`
	DueAmount          float32     `json:"due_amount"`
	DueAt              HarvestDate `json:"due_at"`
	DueAtHumanFormat   string      `json:"due_at_human_format"`
	PeriodEnd          HarvestDate `json:"period_end"`
	PeriodStart        HarvestDate `json:"period_start"`
	ClientId           int         `json:"client_id"`
	Subject            string      `json:"subject"`
	Currency           string      `json:"currency"`
	IssuedAt           HarvestDate `json:"issued_at"`
	CreatedById        int         `json:"created_by_id"`
	Notes              string      `json:"notes"`
	Number             string      `json:"number"`
	PurchaseOrder      string      `json:"purchase_order"`
	ClientKey          string      `json:"client_key"`
	State              string      `json:"state"`
	Tax                float32     `json:"tax"`
	Tax2               float32     `json:"tax2"`
	TaxAmount          float32     `json:"tax_amount"`
	TaxAmount2         float32     `json:"tax_amount2"`
	DiscountAmount     float32     `json:"discount_amount"`
	Discount           float32     `json:"discount"`
	RecurringInvoiceId int         `json:"recurring_invoice_id"`
	EstimateId         int         `json:"estimate_id"`
	RetainerId         int         `json:"retainer_id"`
	UpdatedAt          time.Time   `json:"updated_at"`
	CreatedAt          time.Time   `json:"created_at"`
}

type InvoiceResponse

type InvoiceResponse struct {
	Invoice Invoice `json:"invoices"`
}

type InvoiceService

type InvoiceService struct {
	Service
}

func (*InvoiceService) Find

func (i *InvoiceService) Find(invoiceID int) (err error, invoice Invoice)

func (*InvoiceService) List

func (i *InvoiceService) List() (err error, invoices []Invoice)

type Modules

type Modules struct {
	Expenses  bool `json:"expenses"`
	Invoices  bool `json:"invoices"`
	Estimates bool `json:"estimates"`
	Approval  bool `json:"approval"`
}

type Person

type Person struct {
	Id                           int
	DefaultExpenseCategoryId     int
	DefaultExpenseProjectId      int
	DefaultTaskId                int
	DefaultTimeProjectId         int
	DefaultHourlyRate            float32
	FirstName                    string
	LastName                     string
	Email                        string
	IdentityUrl                  string
	OpensocialIdentifier         string
	Telephone                    string
	Timezone                     string
	CostRate                     string
	WeeklyDigestSentOn           string
	Department                   string
	IsContractor                 bool
	IsAdmin                      bool
	IsActive                     bool
	HasAccessToAllFutureProjects bool
	WantsNewsletter              bool
	WantsWeeklyDigest            bool
	CreatedAt                    time.Time
	UpdatedAt                    time.Time
}

type PersonResponse

type PersonResponse struct {
	Person Person `json:"user"`
}

type PersonService

type PersonService struct {
	Service
}

func (*PersonService) Find

func (c *PersonService) Find(personID int) (err error, person Person)

func (*PersonService) List

func (c *PersonService) List() (err error, people []Person)

type Project

type Project struct {
	Id                               int         `json:"id"`
	ClientId                         int         `json:"client_id"`
	Name                             string      `json:"name"`
	Code                             string      `json:"code"`
	Notes                            string      `json:"notes"`
	BillBy                           string      `json:"bill_by"`
	BudgetBy                         string      `json:"budget_by"`
	Active                           bool        `json:"active"`
	CostBudgetIncludeExpenses        bool        `json:"cost_budget_include_expenses"`
	Billable                         bool        `json:"billable"`
	ShowBudgetToAll                  bool        `json:"show_budget_to_all"`
	CostBudget                       float32     `json:"cost_budget"`
	HourlyRate                       float32     `json:"hourly_rate"`
	Budget                           float32     `json:"budget"`
	NotifyWhenOverBudget             float32     `json:"notify_when_overbudget"`
	OverBudgetNotificationPercentage float32     `json:"over_budget_notification_percentage"`
	OverBudgetNotifiedAt             HarvestDate `json:"over_budget_notified_at"`
	CreatedAt                        HarvestDate `json:"created_at"`
	UpdateAt                         HarvestDate `json:"updated_at"`
	HintEarliestRecordAt             HarvestDate `json:"hint_earliest_record_at"`
	HintLatestRecordAt               HarvestDate `json:"hint_latest_record_at"`
}

type ProjectResponse

type ProjectResponse struct {
	Project Project
}

type ProjectService

type ProjectService struct {
	Service
}

func (*ProjectService) Find

func (c *ProjectService) Find(projectID int) (err error, project Project)

func (*ProjectService) List

func (c *ProjectService) List() (err error, projects []Project)

type Service

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

Jump to

Keyboard shortcuts

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