-
Notifications
You must be signed in to change notification settings - Fork 1
/
my_store.go
28 lines (26 loc) · 911 Bytes
/
my_store.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
package picnic
type MyStore struct {
Type string `json:"type"`
Catalog []Category `json:"catalog"`
Content []DisplayPositionContent `json:"content"`
User User `json:"user"`
FirstTimeUser bool `json:"first_time_user"`
LandingPageHit string `json:"landing_page_hit"`
Id string `json:"id"`
Links []Link `json:"links"`
}
// GetMyStore query to retrieve the MyStore for the current authenticated user
//
// Method requires client to be authenticated
func (c *Client) GetMyStore() (*MyStore, error) {
if !c.IsAuthenticated() {
return nil, authenticationError()
}
myStoreUrl := c.baseURL + "/my_store"
var myStore MyStore
err := c.get(myStoreUrl, &myStore)
if err != nil {
return nil, err
}
return &myStore, nil
}