-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_balance.go
43 lines (36 loc) · 1.03 KB
/
model_balance.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
/*
* GENERATED. Do not modify. Your changes might be overwritten!
*/
package resources
import "encoding/json"
type Balance struct {
Key
Attributes BalanceAttributes `json:"attributes"`
}
type BalanceResponse struct {
Data Balance `json:"data"`
Included Included `json:"included"`
}
type BalanceListResponse struct {
Data []Balance `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
Meta json.RawMessage `json:"meta,omitempty"`
}
func (r *BalanceListResponse) PutMeta(v interface{}) (err error) {
r.Meta, err = json.Marshal(v)
return err
}
func (r *BalanceListResponse) GetMeta(out interface{}) error {
return json.Unmarshal(r.Meta, out)
}
// MustBalance - returns Balance from include collection.
// if entry with specified key does not exist - returns nil
// if entry with specified key exists but type or ID mismatches - panics
func (c *Included) MustBalance(key Key) *Balance {
var balance Balance
if c.tryFindEntry(key, &balance) {
return &balance
}
return nil
}