forked from brianstrauch/spotify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
objects.go
143 lines (128 loc) · 5.38 KB
/
objects.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package spotify
import "time"
// Album represents an AlbumObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-albumobject
type Album struct {
Meta
AlbumType string `json:"album_type"`
AvailableMarkets []string `json:"available_markets"`
Images []Image `json:"images"`
Label string `json:"label"`
Popularity int `json:"popularity"`
ReleaseDate string `json:"release_date"`
ReleaseDatePrecision string `json:"release_date_precision"`
TotalTracks int `json:"total_tracks"`
Tracks TrackPage `json:"tracks"`
Name string `json:"name"`
}
// Artist represents an ArtistObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-artistobject
type Artist struct {
Meta
Genres []string `json:"genres"`
Popularity int `json:"popularity"`
Name string `json:"name"`
}
// Device represents a DeviceObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-deviceobject
type Device struct {
ID string `json:"id"`
IsActive bool `json:"is_active"`
IsPrivateSession bool `json:"is_private_session"`
IsRestricted bool `json:"is_restricted"`
Name string `json:"name"`
Type string `json:"type"`
VolumePercent int `json:"volume_percent"`
}
// Error represents an ErrorObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-errorobject
type Error struct {
Status int `json:"status"`
Message string `json:"message"`
}
// ExplicitContentSettings represents a ExplicitContentSettingsObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-explicitcontentsettingsobject
type ExplicitContentSettings struct {
FilterEnabled bool `json:"filter_enabled"`
FilterLocked bool `json:"filter_locked"`
}
// Followers represents a FollowersObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-followersobject
type Followers struct {
HREF HREF `json:"href"`
Total int `json:"total"`
}
// Image represents an ImageObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-imageobject
type Image struct {
Height int `json:"height"`
URL string `json:"url"`
Width int `json:"width"`
}
// Paging represents a PagingObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-pagingobject
type Paging struct {
Albums AlbumPage `json:"albums"`
Tracks TrackPage `json:"tracks"`
}
// Playlist represents a PlaylistObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-playlistobject
type Playlist struct {
Meta
Collaborative bool `json:"collaborative"`
Description string `json:"description"`
Images []Image `json:"images"`
Name string `json:"name"`
Owner PublicUser `json:"owner"`
Public bool `json:"public"`
SnapshotID string `json:"snapshot_id"`
Tracks PlaylistTrackPage `json:"tracks"`
}
// PlaylistTrack represents a PlaylistTrackObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-playlisttrackobject
type PlaylistTrack struct {
AddedAt time.Time `json:"added_at"`
AddedBy Meta `json:"added_by"`
IsLocal bool `json:"is_local"`
Track Track `json:"track"`
URI string `json:"uri"`
}
// PrivateUser represents a PrivateUserObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-privateuserobject
type PrivateUser struct {
Meta
Country string `json:"country"`
DisplayName string `json:"display_name"`
Email string `json:"email"`
ExplicitContent ExplicitContentSettings `json:"explicit_content"`
Followers Followers `json:"followers"`
Images []*Image `json:"images"`
Product string `json:"product"`
}
// PublicUser represents a PublicUserObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-publicuserobject
type PublicUser struct {
Meta
DisplayName string `json:"display_name"`
Images []Image `json:"images"`
}
// Show represents a ShowObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-showobject
type Show struct {
Name string `json:"name"`
}
// Track represents a TrackObject in the Spotify API.
// https://developer.spotify.com/documentation/web-api/reference/#object-trackobject
type Track struct {
Meta
Album Album `json:"albumomitempty"`
Artists []Artist `json:"artists"`
AvailableMarkets []string `json:"available_markets"`
DiscNumber int `json:"disc_number"`
Duration *Duration `json:"duration_ms"`
Explicit bool `json:"explicit"`
ExternalIDs map[string]string `json:"external_ids"`
Name string `json:"name"`
Popularity int `json:"popularity"`
PreviewURL string `json:"preview_url"`
}