Documentation ¶
Index ¶
- Constants
- func NewAPIError(code int, body []byte) error
- type APIError
- type APIKeyAuth
- type Auth
- type BasicAuth
- type BillableType
- type BudgetType
- type Client
- type ClientId
- type Entries
- type EntriesAPI
- type EntriesListParams
- type EntriesTexts
- type EntriesTextsAPI
- type EntriesTextsListParams
- type EntriesTextsMode
- type EntriesTextsSort
- type Entry
- func NewLumpsumServiceEntry(customersId int, lumpsumServicesId int, lumpsumServicesAmount float64, ...) Entry
- func NewLumpsumValueEntry(customersId int, servicesId int, lumpsum float64, billable BillableType, ...) Entry
- func NewTimeEntry(customersId int, servicesId int, billable BillableType, timeSince ISO8601UTC, ...) Entry
- type EntryType
- type ErrorBody
- type ErrorDetail
- type HTTPClientOption
- type ISO8601UTC
- type Paging
- type SingleEntry
Constants ¶
View Source
const (
BaseURL = "https://my.clockodo.com"
)
Variables ¶
This section is empty.
Functions ¶
func NewAPIError ¶
Types ¶
type APIKeyAuth ¶
type APIKeyAuth struct { ClientId // contains filtered or unexported fields }
func (APIKeyAuth) NewRequest ¶
type BillableType ¶
type BillableType uint8
const ( NotBillable BillableType = iota Billable AlreadyBilled )
type BudgetType ¶
type BudgetType string
const ( Strict BudgetType = "strict" StrictCompleted BudgetType = "strict-completed" StrictIncomplete BudgetType = "strict-incomplete" Soft BudgetType = "soft" SoftCompleted BudgetType = "soft-completed" SoftIncomplete BudgetType = "soft-incomplete" Without BudgetType = "without" WithoutStrict BudgetType = "without-strict" )
type Client ¶
type Client struct { Entries *EntriesAPI EntriesTexts *EntriesTextsAPI // contains filtered or unexported fields }
func NewClient ¶
func NewClient(auth Auth, opts ...HTTPClientOption) *Client
type EntriesAPI ¶
type EntriesAPI struct {
// contains filtered or unexported fields
}
func (EntriesAPI) Delete ¶
func (api EntriesAPI) Delete(id int) error
func (EntriesAPI) List ¶
func (api EntriesAPI) List(q EntriesListParams) (*Entries, error)
type EntriesListParams ¶
type EntriesListParams struct { TimeSince ISO8601UTC `url:"time_since"` TimeUntil ISO8601UTC `url:"time_until"` FilterUsersId int `url:"filter[users_id],omitempty"` FilterCustomersId int `url:"filter[customers_id],omitempty"` FilterProjectsId int `url:"filter[projects_id],omitempty"` FilterServicesId int `url:"filter[services_id],omitempty"` FilterLumpsumServicesId int `url:"filter[lumpsum_services_id],omitempty"` FilterBillable BillableType `url:"filter[billable],omitempty"` FilterText string `url:"filter[text],omitempty"` FilterTextsId int `url:"filter[texts_id],omitempty"` FilterBudgetType BudgetType `url:"filter[budget_type],omitempty"` CalcAlsoRevenuesForProjectsWithHardBudget bool `url:"calc_also_revenues_for_projects_with_hard_budget,omitempty"` EnhancedList bool `url:"enhanced_list,omitempty"` Page int `url:"page,omitempty"` }
type EntriesTexts ¶
type EntriesTexts struct { Paging `json:"paging"` Filter interface{} `json:"filter"` Mode EntriesTextsMode `json:"mode"` Sort EntriesTextsSort `json:"sort"` TextsRaw interface{} `json:"texts"` Texts map[string]string `json:"-"` }
type EntriesTextsAPI ¶
type EntriesTextsAPI struct {
// contains filtered or unexported fields
}
func (EntriesTextsAPI) List ¶
func (api EntriesTextsAPI) List(q EntriesTextsListParams) (*EntriesTexts, error)
type EntriesTextsListParams ¶
type EntriesTextsListParams struct { Text string `url:"text"` Mode EntriesTextsMode `url:"mode,omitempty"` Sort EntriesTextsSort `url:"sort,omitempty"` FilterTimeSince *ISO8601UTC `url:"filter[time_since],omitempty"` FilterTimeUntil *ISO8601UTC `url:"filter[time_until],omitempty"` FilterUsersId int `url:"filter[users_id],omitempty"` FilterCustomersId int `url:"filter[customers_id],omitempty"` FilterProjectsId int `url:"filter[projects_id],omitempty"` FilterServicesId int `url:"filter[services_id],omitempty"` FilterLumpsumServicesId int `url:"filter[lumpsum_services_id],omitempty"` FilterBillable BillableType `url:"filter[billable],omitempty"` Page int `url:"page,omitempty"` }
type EntriesTextsMode ¶
type EntriesTextsMode string
const ( ExactMatch EntriesTextsMode = "exact_match" StartsWith EntriesTextsMode = "starts_with" EndsWith EntriesTextsMode = "ends_with" Contains EntriesTextsMode = "contains" )
const ( TextAsc EntriesTextsMode = "text_asc" TextDesc EntriesTextsMode = "text_desc" TimeAsc EntriesTextsMode = "time_asc" TimeDesc EntriesTextsMode = "time_desc" )
type EntriesTextsSort ¶
type EntriesTextsSort string
type Entry ¶
type Entry struct { Id *int `json:"id" url:"-"` CustomersId int `json:"customers_id" url:"customers_id"` ProjectsId *int `json:"projects_id" url:"projects_id,omitempty"` UsersId *int `json:"users_id" url:"users_id,omitempty"` Billable *BillableType `json:"billable" url:"billable"` TextsId *int `json:"texts_id" url:"-"` TimeSince ISO8601UTC `json:"time_since" url:"time_since"` TimeUntil *ISO8601UTC `json:"time_until" url:"time_until,omitempty"` TimeInsert *ISO8601UTC `json:"time_insert" url:"-"` TimeLastChange *ISO8601UTC `json:"time_last_change" url:"-"` CustomersName *string `json:"customers_name" url:"-"` ProjectsName *string `json:"projects_name" url:"-"` UsersName *string `json:"users_name" url:"-"` Text *string `json:"text" url:"text,omitempty"` Revenue *float64 `json:"revenue" url:"-"` Type EntryType `json:"type" url:"type"` ServicesId *int `json:"services_id" url:"services_id,omitempty"` Duration *int `json:"duration" url:"duration,omitempty"` Offset *int `json:"offset" url:"-"` Clocked *bool `json:"clocked" url:"-"` ClockedOffline *bool `json:"clocked_offline" url:"-"` TimeClockedSince *ISO8601UTC `json:"time_clocked_since" url:"-"` TimeLastChangeWorktime *ISO8601UTC `json:"time_last_change_worktime" url:"-"` HourlyRate *float64 `json:"hourly_rate" url:"hourly_rate,omitempty"` ServicesName *string `json:"services_name" url:"-"` Lumpsum *float64 `json:"lumpsum" url:"lumpsum,omitempty"` LumpsumServicesId *int `json:"lumpsum_services_id" url:"lumpsum_services_id,omitempty"` LumpsumServicesAmount *float64 `json:"lumpsum_services_amount" url:"lumpsum_services_amount,omitempty"` LumpsumServicesPrice *float64 `json:"lumpsum_services_price" url:"-"` }
func NewLumpsumServiceEntry ¶
func NewLumpsumServiceEntry(customersId int, lumpsumServicesId int, lumpsumServicesAmount float64, billable BillableType, timeSince ISO8601UTC) Entry
func NewLumpsumValueEntry ¶
func NewLumpsumValueEntry(customersId int, servicesId int, lumpsum float64, billable BillableType, timeSince ISO8601UTC) Entry
func NewTimeEntry ¶
func NewTimeEntry(customersId int, servicesId int, billable BillableType, timeSince ISO8601UTC, timeUntil ISO8601UTC) Entry
type ErrorBody ¶
type ErrorBody struct {
Error ErrorDetail `json:"error"`
}
type ErrorDetail ¶
type ErrorDetail struct { Message string `json:"message"` Fields interface{} `json:"fields"` }
type HTTPClientOption ¶
func WithTimeout ¶
func WithTimeout(timout time.Duration) HTTPClientOption
type ISO8601UTC ¶
func (ISO8601UTC) EncodeValues ¶
func (t ISO8601UTC) EncodeValues(key string, v *url.Values) error
func (ISO8601UTC) MarshalJSON ¶
func (t ISO8601UTC) MarshalJSON() ([]byte, error)
func (ISO8601UTC) String ¶
func (t ISO8601UTC) String() string
func (ISO8601UTC) Time ¶
func (t ISO8601UTC) Time() time.Time
func (*ISO8601UTC) UnmarshalJSON ¶
func (t *ISO8601UTC) UnmarshalJSON(b []byte) error
type SingleEntry ¶
type SingleEntry struct {
Entry `json:"entry"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.