jsonapi/node.go

32 lines
968 B
Go
Raw Normal View History

package jsonapi
type OnePayload struct {
Data *Node `json:"data"`
Included []*Node `json:"included,omitempty"`
Links *map[string]string `json:"links,omitempty"`
}
type ManyPayload struct {
Data []*Node `json:"data"`
Included []*Node `json:"included,omitempty"`
2015-07-07 12:52:38 -04:00
Links *map[string]string `json:"links,omitempty"`
}
type Node struct {
Type string `json:"type"`
2016-07-05 21:32:15 -04:00
ID string `json:"id"`
ClientID string `json:"client-id,omitempty"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
Relationships map[string]interface{} `json:"relationships,omitempty"`
}
type RelationshipOneNode struct {
Data *Node `json:"data"`
Links *map[string]string `json:"links,omitempty"`
}
type RelationshipManyNode struct {
Data []*Node `json:"data"`
Links *map[string]string `json:"links,omitempty"`
}