-
Notifications
You must be signed in to change notification settings - Fork 2
/
invoicelineitem.go
53 lines (43 loc) · 1.61 KB
/
invoicelineitem.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
package files_sdk
import (
"encoding/json"
"time"
lib "github.com/Files-com/files-sdk-go/v2/lib"
)
type InvoiceLineItem struct {
Amount string `json:"amount,omitempty" path:"amount"`
CreatedAt *time.Time `json:"created_at,omitempty" path:"created_at"`
Description string `json:"description,omitempty" path:"description"`
Type string `json:"type,omitempty" path:"type"`
ServiceEndAt *time.Time `json:"service_end_at,omitempty" path:"service_end_at"`
ServiceStartAt *time.Time `json:"service_start_at,omitempty" path:"service_start_at"`
UpdatedAt *time.Time `json:"updated_at,omitempty" path:"updated_at"`
Plan string `json:"plan,omitempty" path:"plan"`
Site string `json:"site,omitempty" path:"site"`
}
type InvoiceLineItemCollection []InvoiceLineItem
func (i *InvoiceLineItem) UnmarshalJSON(data []byte) error {
type invoiceLineItem InvoiceLineItem
var v invoiceLineItem
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, map[string]interface{}{})
}
*i = InvoiceLineItem(v)
return nil
}
func (i *InvoiceLineItemCollection) UnmarshalJSON(data []byte) error {
type invoiceLineItems InvoiceLineItemCollection
var v invoiceLineItems
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, []map[string]interface{}{})
}
*i = InvoiceLineItemCollection(v)
return nil
}
func (i *InvoiceLineItemCollection) ToSlice() *[]interface{} {
ret := make([]interface{}, len(*i))
for i, v := range *i {
ret[i] = v
}
return &ret
}