Documentation ¶
Index ¶
- Constants
- func CheckResponse(r *http.Response) error
- type Activities
- type Activity
- type ActivityAttributes
- type ActivityRelationships
- type Album
- type AlbumAttributes
- type AlbumRelationships
- type Albums
- type AppleCurators
- type Artist
- type ArtistAttributes
- type ArtistRelationships
- type Artists
- type Artwork
- type CatalogService
- func (s *CatalogService) GetActivitiesByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Activities, *Response, error)
- func (s *CatalogService) GetActivity(ctx context.Context, storefront, id string, opt *Options) (*Activities, *Response, error)
- func (s *CatalogService) GetAlbum(ctx context.Context, storefront, id string, opt *Options) (*Albums, *Response, error)
- func (s *CatalogService) GetAlbumsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Albums, *Response, error)
- func (s *CatalogService) GetAllCharts(ctx context.Context, storefront string, opt *ChartsOptions) (*Charts, *Response, error)
- func (s *CatalogService) GetAllGenres(ctx context.Context, storefront string, opt *PageOptions) (*Genres, *Response, error)
- func (s *CatalogService) GetAppleCurator(ctx context.Context, storefront, id string, opt *Options) (*AppleCurators, *Response, error)
- func (s *CatalogService) GetAppleCuratorsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*AppleCurators, *Response, error)
- func (s *CatalogService) GetArtist(ctx context.Context, storefront, id string, opt *Options) (*Artists, *Response, error)
- func (s *CatalogService) GetArtistsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Artists, *Response, error)
- func (s *CatalogService) GetCurator(ctx context.Context, storefront, id string, opt *Options) (*Curators, *Response, error)
- func (s *CatalogService) GetCuratorsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Curators, *Response, error)
- func (s *CatalogService) GetGenre(ctx context.Context, storefront, id string, opt *Options) (*Genres, *Response, error)
- func (s *CatalogService) GetGenresByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Genres, *Response, error)
- func (s *CatalogService) GetMusicVideo(ctx context.Context, storefront, id string, opt *Options) (*MusicVideos, *Response, error)
- func (s *CatalogService) GetMusicVideosByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*MusicVideos, *Response, error)
- func (s *CatalogService) GetPlaylist(ctx context.Context, storefront, id string, opt *Options) (*Playlists, *Response, error)
- func (s *CatalogService) GetPlaylistsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Playlists, *Response, error)
- func (s *CatalogService) GetSong(ctx context.Context, storefront, id string, opt *Options) (*Songs, *Response, error)
- func (s *CatalogService) GetSongsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Songs, *Response, error)
- func (s *CatalogService) GetSongsByIsrcs(ctx context.Context, storefront string, isrcs []string, opt *Options) (*Songs, *Response, error)
- func (s *CatalogService) GetStation(ctx context.Context, storefront, id string, opt *Options) (*Stations, *Response, error)
- func (s *CatalogService) GetStationsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Stations, *Response, error)
- func (s *CatalogService) Search(ctx context.Context, storefront string, opt *SearchOptions) (*Search, *Response, error)
- func (s *CatalogService) SearchHints(ctx context.Context, storefront string, opt *SearchHintsOptions) (*SearchHints, *Response, error)
- type ChartAlbums
- type ChartMusicVideos
- type ChartPlaylists
- type ChartResults
- type ChartSongs
- type Charts
- type ChartsOptions
- type Client
- type CreateLibraryPlaylist
- type CreateLibraryPlaylistAttributes
- type CreateLibraryPlaylistRelationships
- type CreateLibraryPlaylistTrack
- type CreateLibraryPlaylistTrackData
- type Curator
- type CuratorAttributes
- type CuratorRelationships
- type Curators
- type EditorialNotes
- type Error
- type ErrorResponse
- type Genre
- type GenreAttributes
- type Genres
- type HistoryHeavyRotation
- type IdsOptions
- type IsrcOptions
- type LibraryMusicVideo
- type LibraryMusicVideoAttributes
- type LibraryMusicVideos
- type LibraryPlaylist
- type LibraryPlaylistAttributes
- type LibraryPlaylistRelationships
- type LibraryPlaylistTracks
- type LibraryPlaylists
- type LibraryPlaylistsByIdsOptions
- type LibrarySong
- type LibrarySongAttributes
- type LibrarySongs
- type MeService
- func (s *MeService) AddLibraryTracksToPlaylist(ctx context.Context, playlistId string, body CreateLibraryPlaylistTrackData) (*Response, error)
- func (s *MeService) CreateLibraryPlaylist(ctx context.Context, body CreateLibraryPlaylist, opt *Options) (*LibraryPlaylists, *Response, error)
- func (s *MeService) GetAllLibraryMusicVideos(ctx context.Context, opt *PageOptions) (*LibraryMusicVideos, *Response, error)
- func (s *MeService) GetAllLibraryPlaylists(ctx context.Context, opt *PageOptions) (*LibraryPlaylists, *Response, error)
- func (s *MeService) GetAllLibrarySongs(ctx context.Context, opt *PageOptions) (*LibrarySongs, *Response, error)
- func (s *MeService) GetHistoryHeavyRotation(ctx context.Context, opt *PageOptions) (*HistoryHeavyRotation, *Response, error)
- func (s *MeService) GetLibraryPlaylist(ctx context.Context, id string, opt *Options) (*LibraryPlaylists, *Response, error)
- func (s *MeService) GetLibraryPlaylistTracks(ctx context.Context, id string, opt *Options) ([]Song, error)
- func (s *MeService) GetLibraryPlaylistsByIds(ctx context.Context, opt *LibraryPlaylistsByIdsOptions) (*LibraryPlaylists, *Response, error)
- func (s *MeService) GetStorefront(ctx context.Context, opt *PageOptions) (*Storefronts, *Response, error)
- type MusicVideo
- type MusicVideoAttributes
- type MusicVideoRelationships
- type MusicVideos
- type Options
- type PageOptions
- type PlayParameters
- type Playlist
- type PlaylistAttributes
- type PlaylistRelationships
- type PlaylistType
- type Playlists
- type Preview
- type Resource
- type Response
- type Search
- type SearchHints
- type SearchHintsOptions
- type SearchHintsResults
- type SearchOptions
- type SearchResults
- type Song
- type SongAttributes
- type SongRelationships
- type Songs
- type Source
- type Station
- type StationAttributes
- type Stations
- type Storefront
- type StorefrontAttributes
- type Storefronts
- type StorefrontsService
- func (s *StorefrontsService) Get(ctx context.Context, id string, opt *Options) (*Storefronts, *Response, error)
- func (s *StorefrontsService) GetAll(ctx context.Context, opt *PageOptions) (*Storefronts, *Response, error)
- func (s *StorefrontsService) GetByIds(ctx context.Context, ids []string, opt *Options) (*Storefronts, *Response, error)
- type TooManyRequestsError
- type Tracks
- type Transport
- type UnauthorizedError
Constants ¶
const ( PlaylistType("user-shared") // PlaylistTypeEditorial is a playlist created by an Apple Music curator. PlaylistTypeEditorial = PlaylistType("editorial") // PlaylistTypeExternal is a playlist created by an non-Apple curator or brand. PlaylistTypeExternal = PlaylistType("external") // PlaylistTypePersonalMix is a personalized playlist for an Apple Music user. PlaylistTypePersonalMix = PlaylistType("personal-mix") )PlaylistTypeUserShared =
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors.
Types ¶
type Activities ¶
type Activities struct { Data []Activity `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
Activities represents a list of activities.
type Activity ¶
type Activity struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes ActivityAttributes `json:"attributes"` Relationships ActivityRelationships `json:"relationships"` }
Activity represents an activity.
type ActivityAttributes ¶
type ActivityAttributes struct { URL string `json:"url"` Name string `json:"name"` Artwork Artwork `json:"artwork"` EditorialNotes *EditorialNotes `json:"editorialNotes,omitempty"` }
ActivityAttributes represents the attributes of the resource.
type ActivityRelationships ¶
type ActivityRelationships struct {
Playlists Playlists `json:"playlists"` // Default inclusion: Identifiers only
}
ActivityRelationships represents a to-one or to-many relationship from one resource object to others.
type Album ¶
type Album struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes AlbumAttributes `json:"attributes"` Relationships AlbumRelationships `json:"relationships"` }
Album represents an album.
type AlbumAttributes ¶
type AlbumAttributes struct { ArtistName string `json:"artistName"` Artwork Artwork `json:"artwork"` ContentRating string `json:"contentRating,omitempty"` Copyright string `json:"copyright"` EditorialNotes *EditorialNotes `json:"editorialNotes,omitempty"` GenreNames []string `json:"genreNames"` IsComplete bool `json:"isComplete"` IsSingle bool `json:"isSingle"` Name string `json:"name"` RecordLabel string `json:"recordLabel"` ReleaseDate string `json:"releaseDate"` PlayParams *PlayParameters `json:"playParams,omitempty"` TrackCount int64 `json:"trackCount"` URL string `json:"url"` }
AlbumAttributes represents the attributes of the resource.
type AlbumRelationships ¶
type AlbumRelationships struct { Artists Artists `json:"artists"` // Default inclusion: Identifiers only Genres *Genres `json:"genres,omitempty"` // Default inclusion: None Tracks Tracks `json:"tracks"` // The songs and music videos on the album. Default inclusion: Objects }
AlbumRelationships represents a to-one or to-many relationship from one resource object to others.
type Albums ¶
type Albums struct { Data []Album `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
Albums represents a list of albums.
type AppleCurators ¶
type AppleCurators struct { Data []Curator `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
AppleCurators represents a list of apple curators.
type Artist ¶
type Artist struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes ArtistAttributes `json:"attributes"` Relationships ArtistRelationships `json:"relationships"` }
Artist represents an artist of an album.
type ArtistAttributes ¶
type ArtistAttributes struct { GenreNames []string `json:"genreNames"` EditorialNotes *EditorialNotes `json:"editorialNotes,omitempty"` Name string `json:"name"` URL string `json:"url"` }
ArtistAttributes represents the attributes of the resource.
type ArtistRelationships ¶
type ArtistRelationships struct { Albums Albums `json:"albums"` Genres *Genres `json:"genres,omitempty"` MusicVideos *MusicVideos `json:"music-videos,omitempty"` Playlists *Playlists `json:"playlists,omitempty"` }
ArtistRelationships represents a to-one or to-many relationship from one resource object to others.
type Artists ¶
type Artists struct { Data []Artist `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
Artists represents a list of artists.
type Artwork ¶
type Artwork struct { Width int `json:"width"` Height int `json:"height"` URL string `json:"url"` BgColor string `json:"bgColor"` TextColor1 string `json:"textColor1"` TextColor2 string `json:"textColor2"` TextColor3 string `json:"textColor3"` TextColor4 string `json:"textColor4"` IsMosaic bool `json:"isMosaic,omitempty"` // Undocumented, Used in Playlists. }
Artwork represents an artwork.
type CatalogService ¶
type CatalogService service
CatalogService handles communication with the catalog related methods of the Apple Music API.
func (*CatalogService) GetActivitiesByIds ¶
func (s *CatalogService) GetActivitiesByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Activities, *Response, error)
GetActivitiesByIds fetches one or more activities using their identifiers.
func (*CatalogService) GetActivity ¶
func (s *CatalogService) GetActivity(ctx context.Context, storefront, id string, opt *Options) (*Activities, *Response, error)
GetActivity fetches an activity using its identifier.
func (*CatalogService) GetAlbum ¶
func (s *CatalogService) GetAlbum(ctx context.Context, storefront, id string, opt *Options) (*Albums, *Response, error)
GetAlbum fetches an album using its identifier.
func (*CatalogService) GetAlbumsByIds ¶
func (s *CatalogService) GetAlbumsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Albums, *Response, error)
GetAlbumsByIds fetches one or more albums using their identifiers.
func (*CatalogService) GetAllCharts ¶
func (s *CatalogService) GetAllCharts(ctx context.Context, storefront string, opt *ChartsOptions) (*Charts, *Response, error)
GetAllCharts fetches one or more charts.
func (*CatalogService) GetAllGenres ¶
func (s *CatalogService) GetAllGenres(ctx context.Context, storefront string, opt *PageOptions) (*Genres, *Response, error)
GetAllGenres fetches all genres for the current top charts.
func (*CatalogService) GetAppleCurator ¶
func (s *CatalogService) GetAppleCurator(ctx context.Context, storefront, id string, opt *Options) (*AppleCurators, *Response, error)
GetAppleCurator fetches an apple curator using its identifier.
func (*CatalogService) GetAppleCuratorsByIds ¶
func (s *CatalogService) GetAppleCuratorsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*AppleCurators, *Response, error)
GetAppleCuratorsByIds fetches one or more apple curators using their identifiers.
func (*CatalogService) GetArtist ¶
func (s *CatalogService) GetArtist(ctx context.Context, storefront, id string, opt *Options) (*Artists, *Response, error)
GetArtist fetches a artist using its identifier.
func (*CatalogService) GetArtistsByIds ¶
func (s *CatalogService) GetArtistsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Artists, *Response, error)
GetArtistsByIds fetches one or more artists using their identifiers.
func (*CatalogService) GetCurator ¶
func (s *CatalogService) GetCurator(ctx context.Context, storefront, id string, opt *Options) (*Curators, *Response, error)
GetCurator fetches an curator using its identifier.
func (*CatalogService) GetCuratorsByIds ¶
func (s *CatalogService) GetCuratorsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Curators, *Response, error)
GetCuratorsByIds fetches one or more curators using their identifiers.
func (*CatalogService) GetGenre ¶
func (s *CatalogService) GetGenre(ctx context.Context, storefront, id string, opt *Options) (*Genres, *Response, error)
GetGenre fetches a genre using its identifier.
func (*CatalogService) GetGenresByIds ¶
func (s *CatalogService) GetGenresByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Genres, *Response, error)
GetGenresByIds fetches one or more genres.
func (*CatalogService) GetMusicVideo ¶
func (s *CatalogService) GetMusicVideo(ctx context.Context, storefront, id string, opt *Options) (*MusicVideos, *Response, error)
GetMusicVideo fetches a music video using its identifier.
func (*CatalogService) GetMusicVideosByIds ¶
func (s *CatalogService) GetMusicVideosByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*MusicVideos, *Response, error)
GetMusicVideosByIds fetches one or more music videos using their identifiers.
func (*CatalogService) GetPlaylist ¶
func (s *CatalogService) GetPlaylist(ctx context.Context, storefront, id string, opt *Options) (*Playlists, *Response, error)
GetPlaylist fetches a playlist using its identifier.
func (*CatalogService) GetPlaylistsByIds ¶
func (s *CatalogService) GetPlaylistsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Playlists, *Response, error)
GetPlaylistsByIds fetches one or more playlists using their identifiers.
func (*CatalogService) GetSong ¶
func (s *CatalogService) GetSong(ctx context.Context, storefront, id string, opt *Options) (*Songs, *Response, error)
GetSong fetches a song using its identifier.
func (*CatalogService) GetSongsByIds ¶
func (s *CatalogService) GetSongsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Songs, *Response, error)
GetSongsByIds fetches one or more songs using their identifiers.
func (*CatalogService) GetSongsByIsrcs ¶
func (s *CatalogService) GetSongsByIsrcs(ctx context.Context, storefront string, isrcs []string, opt *Options) (*Songs, *Response, error)
GetSongsByIsrcs fetches one or more songs using their ISRC identifiers.
func (*CatalogService) GetStation ¶
func (s *CatalogService) GetStation(ctx context.Context, storefront, id string, opt *Options) (*Stations, *Response, error)
GetStation fetches a station using its identifier.
func (*CatalogService) GetStationsByIds ¶
func (s *CatalogService) GetStationsByIds(ctx context.Context, storefront string, ids []string, opt *Options) (*Stations, *Response, error)
GetStationsByIds fetches one or more stations using their identifiers.
func (*CatalogService) Search ¶
func (s *CatalogService) Search(ctx context.Context, storefront string, opt *SearchOptions) (*Search, *Response, error)
Search searches the catalog using a query.
func (*CatalogService) SearchHints ¶
func (s *CatalogService) SearchHints(ctx context.Context, storefront string, opt *SearchHintsOptions) (*SearchHints, *Response, error)
SearchHints fetches the search term results for a hint.
type ChartAlbums ¶
ChartAlbums represents a chart of albums.
type ChartMusicVideos ¶
type ChartMusicVideos struct { Name string `json:"name"` Chart string `json:"chart"` MusicVideos }
ChartMusicVideos represents a chart of music videos.
type ChartPlaylists ¶
ChartPlaylists represent a chart of playlists.
type ChartResults ¶
type ChartResults struct { Albums *[]ChartAlbums `json:"albums,omitempty"` Songs *[]ChartSongs `json:"songs,omitempty"` MusicVideos *[]ChartMusicVideos `json:"music-videos,omitempty"` Playlists *[]ChartPlaylists `json:"playlists,omitempty"` }
ChartResults represents a results, that contains chart collections.
type ChartSongs ¶
ChartSongs represents a chart of songs.
type Charts ¶
type Charts struct {
Results ChartResults `json:"results"`
}
Charts represents the result of one or more charts.
type ChartsOptions ¶
type ChartsOptions struct { // A list of the types of charts to include in the results. // The possible values are albums, songs, and music-videos. Types string `url:"types"` // (Optional) The localization to use, specified by a language tag. // The possible values are in the supportedLanguageTags array belonging to the Storefront object specified by storefront. // Otherwise, the storefront’s defaultLanguageTag is used. Language string `url:"l,omitempty"` // (Optional) The chart to fetch for the specified types. // For possible values, get all the charts by sending this endpoint without the chart parameter. // The possible values for this parameter are the chart attributes of the Chart objects in the response. Chart string `url:"chart,omitempty"` // (Optional) The identifier for the genre to use in the chart results. To get the genre identifiers. Genre string `url:"genre,omitempty"` // (Optional) The number of resources to include per chart. // The default value is 20 and the maximum value is 50. Limit int `url:"limit,omitempty"` // (Optional; only with chart specified) The next page or group of objects to fetch. Offset int `url:"offset,omitempty"` }
ChartsOptions specifies the parameters to fetch charts.
type Client ¶
type Client struct { BaseURL *url.URL UserAgent string // Services used for talking to different parts of the Apple Music API. Storefront *StorefrontsService Catalog *CatalogService Me *MeService // contains filtered or unexported fields }
A Client manages communication with the Apple Music API.
type CreateLibraryPlaylist ¶
type CreateLibraryPlaylist struct { Attributes CreateLibraryPlaylistAttributes `json:"attributes"` Relationships *CreateLibraryPlaylistRelationships `json:"relationships,omitempty"` }
type CreateLibraryPlaylistRelationships ¶
type CreateLibraryPlaylistRelationships struct {
Tracks CreateLibraryPlaylistTrackData `json:"tracks"`
}
type CreateLibraryPlaylistTrackData ¶
type CreateLibraryPlaylistTrackData struct {
Data []CreateLibraryPlaylistTrack `json:"data"`
}
type Curator ¶
type Curator struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes CuratorAttributes `json:"attributes"` Relationships CuratorRelationships `json:"relationships"` }
Curator represents a curator of resources.
type CuratorAttributes ¶
type CuratorAttributes struct { URL string `json:"url"` Name string `json:"name"` Artwork Artwork `json:"artwork"` EditorialNotes *EditorialNotes `json:"editorialNotes,omitempty"` }
CuratorAttributes represents the attributes of the resource.
type CuratorRelationships ¶
type CuratorRelationships struct {
Playlists Playlists `json:"playlists"` // Default inclusion: Identifiers only
}
CuratorRelationships represents a to-one or to-many relationship from one resource object to others.
type Curators ¶
type Curators struct { Data []Curator `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
Curators represents a list of curators.
type EditorialNotes ¶
type EditorialNotes struct { Standard string `json:"standard"` Name string `json:"name,omitempty"` // Undocumented Short string `json:"short"` }
EditorialNotes represents notes.
type Error ¶
type Error struct { Id string `json:"id"` About string `json:"about"` Status string `json:"status"` Code string `json:"code"` Title string `json:"title"` Detail string `json:"detail"` Source Source `json:"source"` Meta interface{} `json:"meta"` }
Error contains information about an error that occurred while processing a request.
type ErrorResponse ¶
ErrorResponse reports one or more errors caused by an API request.
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Genre ¶
type Genre struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes GenreAttributes `json:"attributes"` }
Genre represents a genre for resources.
type GenreAttributes ¶
type GenreAttributes struct {
Name string `json:"name"`
}
GenreAttributes represents the attributes of the resource.
type Genres ¶
type Genres struct { Data []Genre `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
Genres represents a list of genres.
type HistoryHeavyRotation ¶
type HistoryHeavyRotation struct { Data []Resource `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
HistoryHeavyRotation represents a list of heavy rotation content.
type IdsOptions ¶
type IsrcOptions ¶
type LibraryMusicVideo ¶
type LibraryMusicVideo struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href,omitempty"` Attributes LibraryMusicVideoAttributes `json:"attributes,omitempty"` }
LibraryMusicVideo represents a Resource object that represents a library music video.
type LibraryMusicVideoAttributes ¶
type LibraryMusicVideoAttributes struct { AlbumName string `json:"albumName"` ArtistName string `json:"artistName"` Artwork Artwork `json:"artwork"` ContentRating string `json:"contentRating,omitempty"` DurationInMillis int64 `json:"durationInMillis,omitempty"` Name string `json:"name"` PlayParams PlayParameters `json:"playParams,omitempty"` TrackNumber int `json:"trackNumber,omitempty"` }
LibraryMusicVideoAttributes represents the attributes of library music video object.
type LibraryMusicVideos ¶
type LibraryMusicVideos struct { Data []LibraryMusicVideo `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
LibraryMusicVideos represents a list of library music video.
type LibraryPlaylist ¶
type LibraryPlaylist struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes LibraryPlaylistAttributes `json:"attributes"` Relationships LibraryPlaylistRelationships `json:"relationships"` }
LibraryPlaylist represents a library playlist.
type LibraryPlaylistAttributes ¶
type LibraryPlaylistAttributes struct { Artwork *Artwork `json:"artwork"` Description *EditorialNotes `json:"description"` Name string `json:"name"` PlayParams *PlayParameters `json:"playParams"` CanDelete bool `json:"canDelete"` CanEdit bool `json:"canEdit"` }
LibraryPlaylistAttributes represents the attributes of library playlist.
type LibraryPlaylistRelationships ¶
type LibraryPlaylistRelationships struct {
Tracks Tracks `json:"tracks"` // The library songs and library music videos included in the playlist. Only available when fetching single library playlist resource by ID.
}
LibraryPlaylistRelationships represents a to-one or to-many relationship from one resource object to others.
type LibraryPlaylistTracks ¶
type LibraryPlaylists ¶
type LibraryPlaylists struct { Data []LibraryPlaylist `json:"data"` Next string `json:"next,omitempty"` }
LibraryPlaylists represents a list of library playlist.
type LibraryPlaylistsByIdsOptions ¶
LibraryPlaylistsByIdsOptions specifies the optional parameters to the MeService.GetLibraryPlaylistsByIds method.
type LibrarySong ¶
type LibrarySong struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href,omitempty"` Attributes LibrarySongAttributes `json:"attributes,omitempty"` }
LibrarySong represents a Resource object that represents a library song.
type LibrarySongAttributes ¶
type LibrarySongAttributes struct { AlbumName string `json:"albumName"` ArtistName string `json:"artistName"` Artwork Artwork `json:"artwork"` ContentRating string `json:"contentRating,omitempty"` DiscNumber int `json:"discNumber"` DurationInMillis int64 `json:"durationInMillis,omitempty"` Name string `json:"name"` PlayParams PlayParameters `json:"playParams,omitempty"` TrackNumber int `json:"trackNumber"` }
LibrarySongAttributes represents the attributes of library song object.
type LibrarySongs ¶
type LibrarySongs struct { Data []LibrarySong `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
LibrarySongs represents a list of library songs.
type MeService ¶
type MeService service
MeService handles communication with the me related methods of the Apple Music API.
func (*MeService) AddLibraryTracksToPlaylist ¶
func (*MeService) CreateLibraryPlaylist ¶
func (s *MeService) CreateLibraryPlaylist(ctx context.Context, body CreateLibraryPlaylist, opt *Options) (*LibraryPlaylists, *Response, error)
func (*MeService) GetAllLibraryMusicVideos ¶
func (s *MeService) GetAllLibraryMusicVideos(ctx context.Context, opt *PageOptions) (*LibraryMusicVideos, *Response, error)
GetAllLibraryMusicVideos fetches all the library music videos in alphabetical order.
func (*MeService) GetAllLibraryPlaylists ¶
func (s *MeService) GetAllLibraryPlaylists(ctx context.Context, opt *PageOptions) (*LibraryPlaylists, *Response, error)
GetAllLibraryPlaylists fetches all the library playlists in alphabetical order.
func (*MeService) GetAllLibrarySongs ¶
func (s *MeService) GetAllLibrarySongs(ctx context.Context, opt *PageOptions) (*LibrarySongs, *Response, error)
GetAllLibrarySongs fetches all the library songs in alphabetical order.
func (*MeService) GetHistoryHeavyRotation ¶
func (s *MeService) GetHistoryHeavyRotation(ctx context.Context, opt *PageOptions) (*HistoryHeavyRotation, *Response, error)
GetHistoryHeavyRotation fetches the resources in heavy rotation for the user.
func (*MeService) GetLibraryPlaylist ¶
func (s *MeService) GetLibraryPlaylist(ctx context.Context, id string, opt *Options) (*LibraryPlaylists, *Response, error)
GetLibraryPlaylist fetches a library playlist using its identifier.
func (*MeService) GetLibraryPlaylistTracks ¶
func (s *MeService) GetLibraryPlaylistTracks(ctx context.Context, id string, opt *Options) ([]Song, error)
GetLibraryPlaylist fetches a library playlist using its identifier.
func (*MeService) GetLibraryPlaylistsByIds ¶
func (s *MeService) GetLibraryPlaylistsByIds(ctx context.Context, opt *LibraryPlaylistsByIdsOptions) (*LibraryPlaylists, *Response, error)
GetLibraryPlaylistsByIds fetches one or more library playlists using their identifiers.
func (*MeService) GetStorefront ¶
func (s *MeService) GetStorefront(ctx context.Context, opt *PageOptions) (*Storefronts, *Response, error)
GetStorefront fetches a user’s storefront.
type MusicVideo ¶
type MusicVideo struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes MusicVideoAttributes `json:"attributes"` Relationships MusicVideoRelationships `json:"relationships"` }
MusicVideo represents a music video.
type MusicVideoAttributes ¶
type MusicVideoAttributes struct { URL string `json:"url"` Name string `json:"name"` GenreNames []string `json:"genreNames"` ISRC string `json:"isrc"` ArtistName string `json:"artistName"` ReleaseDate string `json:"releaseDate"` Artwork Artwork `json:"artwork"` PlayParams *PlayParameters `json:"playParams,omitempty"` DurationInMillis int64 `json:"durationInMillis,omitempty"` ContentRating string `json:"contentRating,omitempty"` EditorialNotes *EditorialNotes `json:"editorialNotes,omitempty"` TrackNumber int `json:"trackNumber,omitempty"` VideoSubType string `json:"videoSubType,omitempty"` }
MusicVideoAttributes represents the attributes of the resource.
type MusicVideoRelationships ¶
type MusicVideoRelationships struct { Albums Albums `json:"albums"` // Default inclusion: Identifiers only Artists Artists `json:"artists"` // Default inclusion: Identifiers only Genres *Genres `json:"genres,omitempty"` // Default inclusion: None }
MusicVideoRelationships represents a to-one or to-many relationship from one resource object to others.
type MusicVideos ¶
type MusicVideos struct { Data []MusicVideo `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
MusicVideos represents a list of music videos.
type Options ¶
type Options struct { // The localization to use, specified by a language tag. // Any supported language tag may be used here, if one is not specified then en-us is used. Language string `url:"l,omitempty"` // Additional relationships to include in the fetch. Include string `url:"include,omitempty"` }
Options specifies the optional parameters to support language tag and relationships.
type PageOptions ¶
type PageOptions struct { // The limit on the number of objects, or number of objects in the specified relationship, that are returned. Limit int `url:"limit,omitempty"` // The next page or group of objects to fetch. Offset int `url:"offset,omitempty"` Options }
PageOptions specifies the optional parameters to support pagination of the objects.
type PlayParameters ¶
type PlayParameters struct { Id string `json:"id"` Kind string `json:"kind"` IsLibrary bool `json:"isLibrary,omitempty"` // Undocumented, Used in LibraryPlaylist. CatalogId string `json:"catalogId,omitempty"` // Undocumented, Used in LibraryPlaylist. }
PlayParameters represents play parameters for resources.
type Playlist ¶
type Playlist struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes PlaylistAttributes `json:"attributes"` Relationships PlaylistRelationships `json:"relationships,omitempty"` }
Playlist represents a playlist.
type PlaylistAttributes ¶
type PlaylistAttributes struct { Artwork *Artwork `json:"artwork,omitempty"` CuratorName string `json:"curatorName,omitempty"` Description *EditorialNotes `json:"description,omitempty"` LastModifiedDate string `json:"lastModifiedDate"` Name string `json:"name"` PlaylistType PlaylistType `json:"playlistType"` PlayParams *PlayParameters `json:"playParams,omitempty"` URL string `json:"url"` }
PlaylistAttributes represents the attributes of the resource.
type PlaylistRelationships ¶
type PlaylistRelationships struct { Curator Curators `json:"curator"` // Default inclusion: Identifiers only Tracks Tracks `json:"tracks"` // The songs and music videos included in the playlist. Default inclusion: Objects }
PlaylistRelationships represents a to-one or to-many relationship from one resource object to others.
type Playlists ¶
type Playlists struct { Data []Playlist `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
Playlists represents a list of playlists.
type Preview ¶
type Preview struct {
Url string `json:"url"`
}
Preview represents an audio preview for resources.
type Resource ¶
type Resource struct {
json.RawMessage `json:",inline"`
}
Resource represents a resource—such as an album, song, or playlist—in the Apple Music catalog or iCloud Music Library.
type Search ¶
type Search struct {
Results SearchResults `json:"results"`
}
Search represents the result of search for resources.
type SearchHints ¶
type SearchHints struct {
Results SearchHintsResults `json:"results"`
}
SearchHints represents the result of search hints.
type SearchHintsOptions ¶
type SearchHintsOptions struct { Term string `url:"term"` Language string `url:"l,omitempty"` Limit int `url:"limit,omitempty"` // (Optional) The number of search terms to be returned. The default value is 10. Types string `url:"types,omitempty"` }
SearchHintsOptions specifies the parameters to search hints.
type SearchHintsResults ¶
type SearchHintsResults struct {
Terms []string `json:"terms"`
}
SearchHintsResults represents a results, that contains terms array.
type SearchOptions ¶
type SearchOptions struct { // The entered text for the search with ‘+’ characters between each word, // to replace spaces (for example term=james+br). Term string `url:"term"` // (Optional) The localization to use, specified by a language tag. // The possible values are in the supportedLanguageTags array belonging to the Storefront object specified by storefront. // Otherwise, the storefront’s defaultLanguageTag is used. Language string `url:"l,omitempty"` // (Optional) The limit on the number of objects, or number of objects in the specified relationship, that are returned. // The default value is 5 and the maximum value is 25. Limit int `url:"limit,omitempty"` // (Optional; valid only with types specified) The next page or group of objects to fetch. Offset int `url:"offset,omitempty"` // (Optional) The list of the types of resources to include in the results. Types string `url:"types,omitempty"` }
SearchOptions specifies the parameters to search the catalog.
type SearchResults ¶
type SearchResults struct { Activities *Activities `json:"activities,omitempty"` Albums *Albums `json:"albums,omitempty"` AppleCurators *AppleCurators `json:"apple-curators,omitempty"` Artists *Artists `json:"artists,omitempty"` Curators *Curators `json:"curators,omitempty"` MusicVideos *MusicVideos `json:"music-videos,omitempty"` Playlists *Playlists `json:"playlists,omitempty"` Stations *Stations `json:"stations,omitempty"` Songs *Songs `json:"songs,omitempty"` }
SearchResults represents a results, that contains a map of search results. The members of the results object are the types of resources and the value for each is a Response Root object.
type Song ¶
type Song struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes SongAttributes `json:"attributes"` Relationships SongRelationships `json:"relationships"` }
Song represents a song.
type SongAttributes ¶
type SongAttributes struct { Artwork Artwork `json:"artwork"` ArtistName string `json:"artistName"` URL string `json:"url"` DiscNumber int `json:"discNumber"` GenreNames []string `json:"genreNames"` ISRC string `json:"isrc"` DurationInMillis int64 `json:"durationInMillis,omitempty"` ReleaseDate string `json:"releaseDate"` Name string `json:"name"` PlayParams *PlayParameters `json:"playParams,omitempty"` TrackNumber int `json:"trackNumber,omitempty"` ComposerName string `json:"composerName,omitempty"` ContentRating string `json:"contentRating,omitempty"` EditorialNotes *EditorialNotes `json:"editorialNotes,omitempty"` MovementCount int `json:"movementCount,omitempty"` MovementName string `json:"movementName,omitempty"` MovementNumber int `json:"movementNumber,omitempty"` WorkName string `json:"workName,omitempty"` Previews *[]Preview `json:"previews,omitempty"` AlbumName string `json:"albumName"` }
SongAttributes represents the attributes of the resource.
type SongRelationships ¶
type SongRelationships struct { Albums Albums `json:"albums"` // Default inclusion: Identifiers only Artists Artists `json:"artists"` // Default inclusion: Identifiers only Genres *Genres `json:"genres,omitempty"` // Default inclusion: None }
SongRelationships represents a to-one or to-many relationship from one resource object to others.
type Songs ¶
type Songs struct { Data []Song `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
Songs represents a list of songs.
type Source ¶
type Source struct { Parameter string `json:"parameter"` Pointer interface{} `json:"pointer"` // JSON pointer, A pointer to the associated entry in the request document. }
Source represents the source of an error.
type Station ¶
type Station struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes StationAttributes `json:"attributes"` }
Station represents a station.
type StationAttributes ¶
type StationAttributes struct { URL string `json:"url"` Name string `json:"name"` Artwork Artwork `json:"artwork"` PlayParams PlayParameters `json:"playParams"` // Undocumented EditorialNotes *EditorialNotes `json:"editorialNotes,omitempty"` IsLive bool `json:"isLive"` DurationInMillis int64 `json:"durationInMillis,omitempty"` EpisodeNumber string `json:"episodeNumber,omitempty"` }
StationAttributes represents the attributes of the resource.
type Stations ¶
type Stations struct { Data []Station `json:"data"` Href string `json:"href,omitempty"` Next string `json:"next,omitempty"` }
Stations represents a list of stations.
type Storefront ¶
type Storefront struct { Id string `json:"id"` Type string `json:"type"` Href string `json:"href"` Attributes StorefrontAttributes `json:"attributes"` }
Storefront represents a storefront, an iTunes Store territory that the content is available in.
type StorefrontAttributes ¶
type StorefrontAttributes struct { DefaultLanguageTag string `json:"defaultLanguageTag"` Name string `json:"name"` SupportedLanguageTags []string `json:"supportedLanguageTags"` }
StorefrontAttributes represents a to-one or to-many relationship from one resource object to others.
type Storefronts ¶
type Storefronts struct { Data []Storefront `json:"data"` Next string `json:"next,omitempty"` }
Storefronts represents a list of storefronts.
type StorefrontsService ¶
type StorefrontsService service
StorefrontsService handles communication with the storefront related methods of the Apple Music API.
func (*StorefrontsService) Get ¶
func (s *StorefrontsService) Get(ctx context.Context, id string, opt *Options) (*Storefronts, *Response, error)
Get fetches a single storefront using its identifier.
func (*StorefrontsService) GetAll ¶
func (s *StorefrontsService) GetAll(ctx context.Context, opt *PageOptions) (*Storefronts, *Response, error)
GetAll fetches all the storefronts in alphabetical order.
func (*StorefrontsService) GetByIds ¶
func (s *StorefrontsService) GetByIds(ctx context.Context, ids []string, opt *Options) (*Storefronts, *Response, error)
GetByIds fetches multiple storefronts by ids.
type TooManyRequestsError ¶
type TooManyRequestsError errorMessageResponse
TooManyRequestsError represents the Too Many Requests (429) error when the server exceeds its capacity.
func (*TooManyRequestsError) Error ¶
func (e *TooManyRequestsError) Error() string
type Transport ¶
type Transport struct { Token string // Apple Music developer token MusicUserToken string // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
Transport is an http.RoundTripper.
type UnauthorizedError ¶
type UnauthorizedError errorMessageResponse
UnauthorizedError occurs when server denied the request.
func (*UnauthorizedError) Error ¶
func (e *UnauthorizedError) Error() string
Source Files ¶
- applemusic.go
- catalog.go
- catalog_activities.go
- catalog_albums.go
- catalog_apple_curators.go
- catalog_artists.go
- catalog_charts.go
- catalog_curators.go
- catalog_genres.go
- catalog_music_videos.go
- catalog_playlists.go
- catalog_search.go
- catalog_songs.go
- catalog_stations.go
- me.go
- me_history.go
- me_library.go
- me_library_music_videos.go
- me_library_playlists.go
- me_library_songs.go
- me_storefront.go
- resource.go
- storefronts.go