2015-07-06 12:24:35 -04:00
|
|
|
package jsonapi
|
|
|
|
|
2015-07-07 12:52:38 -04:00
|
|
|
type JsonApiOnePayload struct {
|
2015-07-06 14:57:20 -04:00
|
|
|
Data *JsonApiNode `json:"data"`
|
|
|
|
Included []*JsonApiNode `json:"included,omitempty"`
|
|
|
|
Links *map[string]string `json:"links,omitempty"`
|
2015-07-06 12:24:35 -04:00
|
|
|
}
|
|
|
|
|
2015-07-07 12:52:38 -04:00
|
|
|
type JsonApiManyPayload struct {
|
|
|
|
Data []*JsonApiNode `json:"data"`
|
|
|
|
Included []*JsonApiNode `json:"included,omitempty"`
|
|
|
|
Links *map[string]string `json:"links,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Models interface {
|
|
|
|
GetData() []interface{}
|
|
|
|
}
|
|
|
|
|
2015-07-06 12:24:35 -04:00
|
|
|
type JsonApiNode struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Id string `json:"id"`
|
|
|
|
Attributes map[string]interface{} `json:"attributes,omitempty"`
|
2015-07-08 12:34:37 -04:00
|
|
|
Relationships map[string]interface{} `json:"relationships,omitempty"`
|
2015-07-06 12:24:35 -04:00
|
|
|
}
|
2015-07-06 20:04:26 -04:00
|
|
|
|
2015-07-07 12:52:38 -04:00
|
|
|
type JsonApiRelationshipOneNode struct {
|
2015-07-06 20:04:26 -04:00
|
|
|
Data *JsonApiNode `json:"data"`
|
|
|
|
Links *map[string]string `json:"links,omitempty"`
|
|
|
|
}
|
|
|
|
|
2015-07-07 12:52:38 -04:00
|
|
|
type JsonApiRelationshipManyNode struct {
|
2015-07-06 20:04:26 -04:00
|
|
|
Data []*JsonApiNode `json:"data"`
|
|
|
|
Links *map[string]string `json:"links,omitempty"`
|
|
|
|
}
|