-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.go
121 lines (107 loc) · 4.43 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Copyright 2014 - anova r&d bvba. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package freckle
// Shared type definitions for API input/output
type Entry struct {
Id int `json:"id,omitempty"`
Date string `json:"date,omitempty"`
User Participant `json:"user,omitempty"`
Billable bool `json:"billable,omitempty"`
Minutes int `json:"minutes,omitempty"`
Description string `json:"description,omitempty"`
Project ProjectSummary `json:"project,omitempty"`
Tags []Tag `json:"tags,omitempty"`
SourceUrl string `json:"source_url,omitempty"`
InvoicedAt string `json:"invoiced_at,omitempty"`
Invoice Invoice `json:"invoice,omitempty"`
Import Import `json:"import,omitempty"`
Url string `json:"url,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
type EntriesPage struct {
links map[string]string
freckle *Freckle
Entries []Entry
}
type Import struct {
Id int `json:"id,omitempty"`
Url string `json:"url,omitempty"`
}
type Invoice struct {
Id int `json:"id,omitempty"`
Reference string `json:"reference,omitempty"`
InvoiceDate string `json:"invoice_date,omitempty"`
State string `json:"state,omitempty"`
TotalAmount float64 `json:"total_amount,omitempty"`
Url string `json:"url,omitempty"`
}
// Error type returned by Freckle API
type FreckleError struct {
Message string `json:"message,omitempty"`
Errors []FreckleErrorDetail `json:"errors,omitempty"`
}
type FreckleErrorDetail struct {
Code string `json:"code,omitempty"`
Field string `json:"field,omitempty"`
Resource string `json:"resource,omitempty"`
}
type Participant struct {
Id int `json:"id,omitempty"`
Email string `json:"email,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
ProfileImageUrl string `json:"profile_image_url,omitempty"`
Url string `json:"url,omitempty"`
}
type Project struct {
Id int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
BillingIncrement int `json:"billing_increment,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Billable bool `json:"billable,omitempty"`
Color string `json:"color,omitempty"`
Url string `json:"url,omitempty"`
Group ProjectGroup `json:"group, omitempty"`
Minutes int `json:"minutes,omitempty"`
BillableMinutes int `json:"billable_minutes,omitempty"`
UnbillableMinutes int `json:"unbillable_minutes,omitempty"`
InvoicedMinutes int `json:"invoiced_minutes,omitempty"`
RemainingMinutes int `json:"remaining_minutes,omitempty"`
BudgetMinutes int `json:"budget_minutes,omitempty"`
Import Import `json:"import,omitempty"`
Invoices []Invoice `json:"invoices,omitempty"`
Participants []Participant `json:"participants,omitempty"`
Entries int `json:"entries,omitempty"`
EntriesUrl string `json:"entries_url,omitempty"`
Expenses int `json:"expenses,omitempty"`
ExpensesUrl string `json:"expenses_url,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
type ProjectsPage struct {
links map[string]string
freckle *Freckle
Projects []Project
}
type ProjectGroup struct {
Id int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Url string `json:"url,omitempty"`
}
type ProjectSummary struct {
Id int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
BillingIncrement int `json:"billing_increment,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Billable bool `json:"billable,omitempty"`
Color string `json:"color,omitempty"`
Url string `json:"url,omitempty"`
}
type Tag struct {
Id int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Billable bool `json:"billable,omitempty"`
Url string `json:"url,omitempty"`
}