forked from labd/commercetools-go-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types_custom_object.go
53 lines (46 loc) · 1.62 KB
/
types_custom_object.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
// Automatically generated, do not edit
package commercetools
import (
"encoding/json"
"time"
)
// CustomObject is of type BaseResource
type CustomObject struct {
Version int `json:"version"`
Value interface{} `json:"value"`
LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"`
LastModifiedAt time.Time `json:"lastModifiedAt"`
Key string `json:"key"`
ID string `json:"id"`
CreatedBy *CreatedBy `json:"createdBy,omitempty"`
CreatedAt time.Time `json:"createdAt"`
Container string `json:"container"`
}
// CustomObjectDraft is a standalone struct
type CustomObjectDraft struct {
Version int `json:"version,omitempty"`
Value interface{} `json:"value"`
Key string `json:"key"`
Container string `json:"container"`
}
// CustomObjectPagedQueryResponse is a standalone struct
type CustomObjectPagedQueryResponse struct {
Total int `json:"total,omitempty"`
Results []CustomObject `json:"results"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Count int `json:"count"`
}
// CustomObjectReference implements the interface Reference
type CustomObjectReference struct {
ID string `json:"id"`
Obj *CustomObject `json:"obj,omitempty"`
}
// MarshalJSON override to set the discriminator value
func (obj CustomObjectReference) MarshalJSON() ([]byte, error) {
type Alias CustomObjectReference
return json.Marshal(struct {
TypeID string `json:"typeId"`
*Alias
}{TypeID: "key-value-document", Alias: (*Alias)(&obj)})
}