-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathestimates.go
73 lines (67 loc) · 3.93 KB
/
estimates.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
package invoiced
import (
"encoding/json"
)
type EstimateRequest struct {
Approved *string `json:"approved,omitempty"`
Attachments []*int64 `json:"attachments,omitempty"`
CalculateTax *bool `json:"calculate_taxes,omitempty"`
Closed *bool `json:"closed,omitempty"`
Currency *string `json:"currency,omitempty"`
Customer *int64 `json:"customer,omitempty"`
Date *int64 `json:"date,omitempty"`
Deposit *float64 `json:"deposit,omitempty"`
DepositPaid *bool `json:"deposit_paid,omitempty"`
DisabledPaymentMethods []*string `json:"disabled_payment_methods,omitempty"`
Discounts []*DiscountRequest `json:"discounts,omitempty"`
Draft *bool `json:"draft,omitempty"`
ExpirationDate *int64 `json:"expiration_date,omitempty"`
Items []*LineItemRequest `json:"items,omitempty"`
Metadata *map[string]interface{} `json:"metadata,omitempty"`
Name *string `json:"name,omitempty"`
Notes *string `json:"notes,omitempty"`
Number *string `json:"number,omitempty"`
PaymentTerms *string `json:"payment_terms,omitempty"`
PurchaseOrder *string `json:"purchase_order,omitempty"`
ShipTo *string `json:"ship_to,omitempty"`
Taxes []*TaxRequest `json:"taxes,omitempty"`
UpdatedAt *int64 `json:"updated_at,omitempty"`
}
type Estimate struct {
Approved string `json:"approved"`
Attachments []int64 `json:"attachments"`
Closed bool `json:"closed"`
CreatedAt int64 `json:"created_at"`
Currency string `json:"currency"`
Customer int64 `json:"customer"`
Date int64 `json:"date"`
Deposit float64 `json:"deposit"`
DepositPaid bool `json:"deposit_paid"`
DisabledPaymentMethods []string `json:"disabled_payment_methods"`
Discounts []Discount `json:"discounts"`
Draft bool `json:"draft"`
ExpirationDate int64 `json:"expiration_date"`
Id int64 `json:"id"`
Invoice int64 `json:"invoice"`
Items []LineItem `json:"items"`
Metadata map[string]interface{} `json:"metadata"`
Name string `json:"name"`
Notes string `json:"notes"`
Number string `json:"number"`
Object string `json:"object"`
PaymentTerms string `json:"payment_terms"`
PdfUrl string `json:"pdf_url"`
PurchaseOrder string `json:"purchase_order"`
ShipTo string `json:"ship_to"`
Status string `json:"status"`
Subtotal float64 `json:"subtotal"`
Taxes []Tax `json:"taxes"`
Total float64 `json:"total"`
UpdatedAt int64 `json:"updated_at"`
Url string `json:"url"`
}
type Estimates []*Estimate
func (i *Estimate) String() string {
b, _ := json.MarshalIndent(i, "", " ")
return string(b)
}