44 lines
849 B
Go
44 lines
849 B
Go
|
package events
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
)
|
||
|
|
||
|
type EventsResponse struct {
|
||
|
Page int `json:"_page"`
|
||
|
Links struct {
|
||
|
Self struct {
|
||
|
Href string `json:"href"`
|
||
|
} `json:"self"`
|
||
|
Next struct {
|
||
|
Href string `json:"href"`
|
||
|
} `json:"next"`
|
||
|
} `json:"_links"`
|
||
|
|
||
|
Embedded struct{
|
||
|
Events []Event `json:"events"`
|
||
|
} `json:"_embedded"`
|
||
|
}
|
||
|
|
||
|
//type Events []Event
|
||
|
|
||
|
type Event struct {
|
||
|
Id string `json:"id"`
|
||
|
Type string `json:"type"`
|
||
|
EntityId int `json:"entity_id"`
|
||
|
EntityType string `json:"entity_type"`
|
||
|
CreatedBy int64 `json:"created_by"`
|
||
|
CreatedAt int64 `json:"created_at"`
|
||
|
ValueAfter []Value `json:"value_after"`
|
||
|
ValueBefore []Value `json:"value_before,omitempty"`
|
||
|
AccountId int `json:"account_id"`
|
||
|
Embedded struct {
|
||
|
} `json:"_embedded"`
|
||
|
}
|
||
|
|
||
|
func (e Event) String() string {
|
||
|
bts, _ := json.MarshalIndent(e, "", "\t")
|
||
|
return string(bts)
|
||
|
}
|
||
|
|