forked from fox-one/mixin-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollectible_collection.go
30 lines (25 loc) · 1.02 KB
/
collectible_collection.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
package mixin
import (
"context"
"time"
)
type CollectibleCollection struct {
CollectionID string `json:"collection_id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
IconUrl string `json:"icon_url,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
// ReadCollectibleCollection request collectible collection
func (c *Client) ReadCollectibleCollection(ctx context.Context, collectionID string) (*CollectibleCollection, error) {
var collection CollectibleCollection
if err := c.Get(ctx, "/collectibles/collections/"+collectionID, nil, &collection); err != nil {
return nil, err
}
return &collection, nil
}
// ReadCollectibleCollection request collectible collection with accessToken
func ReadCollectibleCollection(ctx context.Context, accessToken, collectionID string) (*CollectibleCollection, error) {
return NewFromAccessToken(accessToken).ReadCollectibleCollection(ctx, collectionID)
}