-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtrack.go
67 lines (63 loc) · 3.06 KB
/
track.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package soundcloud
type TrackService service
type Track struct {
ArtworkURL string `json:"artwork_url,omitempty"`
Bpm int `json:"bpm,omitempty"`
CommentCount int `json:"comment_count,omitempty"`
Commentable bool `json:"commentable,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Description string `json:"description,omitempty"`
DownloadCount int `json:"download_count,omitempty"`
DownloadURL string `json:"download_url,omitempty"`
Downloadable bool `json:"downloadable,omitempty"`
Duration int `json:"duration,omitempty"`
EmbeddableBy string `json:"embeddable_by,omitempty"`
FavoritingsCount int `json:"favoritings_count,omitempty"`
Genre string `json:"genre,omitempty"`
ID int `json:"id,omitempty"`
ISRC string `json:"isrc,omitempty"`
KeySignature string `json:"key_signature,omitempty"`
Kind string `json:"kind,omitempty"`
LabelID int `json:"label_id,omitempty"`
LabelName string `json:"label_name,omitempty"`
LastModified string `json:"last_modified,omitempty"`
License string `json:"license,omitempty"`
MonetizationModel string `json:"monetization_model,omitempty"`
OriginalContentSize int `json:"original_content_size,omitempty"`
OriginalFormat string `json:"original_format,omitempty"`
Permalink string `json:"permalink,omitempty"`
PermalinkURL string `json:"permalink_url,omitempty"`
PlaybackCount int `json:"playback_count,omitempty"`
Policy string `json:"policy,omitempty"`
PurchaseTitle string `json:"purchase_title,omitempty"`
PurchaseURL string `json:"purchase_url,omitempty"`
Release int `json:"release,omitempty"`
ReleaseDay int `json:"release_day,omitempty"`
ReleaseMonth int `json:"release_month,omitempty"`
ReleaseYear int `json:"release_year,omitempty"`
RepostsCount int `json:"reposts_count,omitempty"`
Sharing string `json:"sharing,omitempty"`
State string `json:"state,omitempty"`
StreamURL string `json:"stream_url,omitempty"`
Streamable bool `json:"streamable,omitempty"`
TagList string `json:"tag_list,omitempty"`
Title string `json:"title,omitempty"`
TrackType string `json:"track_type,omitempty"`
URI string `json:"uri,omitempty"`
User *User `json:"user,omitempty"`
UserID int `json:"user_id,omitempty"`
VideoURL string `json:"video_url,omitempty"`
WaveformURL string `json:"waveform_url,omitempty"`
}
func (s *TrackService) List() ([]Track, error) {
var err error
tracks := new([]Track)
s.client.base.Get("/tracks").Receive(tracks, err)
return *tracks, err
}
func (s *TrackService) Get(ID string) (*Track, error) {
var err error
track := new(Track)
s.client.base.Path("tracks/").Get(ID).Receive(track, err)
return track, err
}