openapi

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ObjectTypeAlbums = "albums"
View Source
const ObjectTypeArtists = "artists"
View Source
const ObjectTypeArtworks = "artworks"
View Source
const ObjectTypeLyrics = "lyrics"
View Source
const ObjectTypePlaylists = "playlists"
View Source
const ObjectTypeSearchResult = "searchResult"
View Source
const ObjectTypeTracks = "tracks"
View Source
const ObjectTypeUserCollections = "userCollections"

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album Response[AlbumData]

type AlbumAttributes

type AlbumAttributes struct {
	AccessType   string   `json:"accessType"`
	Availability []string `json:"availability"`
	BarcodeID    string   `json:"barcodeId"`
	Copyright    struct {
		Text string `json:"text"`
	}
	Duration        Duration            `json:"duration"`
	Explicit        bool                `json:"explicit"`
	ExternalLinks   []AlbumExternalLink `json:"externalLinks"`
	MediaTags       []string            `json:"media_tags"`
	NumberOfItems   int                 `json:"numberOfItems"`
	NumberOfVolumes int                 `json:"numberOfVolumes"`
	Popularity      float64             `json:"popularity"`
	ReleaseDate     helper.TimeDateOnly `json:"releaseDate"`
	Title           string              `json:"title"`
	Type            string              `json:"type"`
}

type AlbumData

type AlbumData struct {
	Attributes    AlbumAttributes    `json:"attributes"`
	ID            string             `json:"id"`
	Relationships AlbumRelationships `json:"relationships"`
	Type          string             `json:"type"`
}
type AlbumExternalLink struct {
	Href string `json:"href"`
	Meta struct {
		Type AlbumExternalLinkType `json:"type"`
	} `json:"meta"`
}

type AlbumExternalLinkType

type AlbumExternalLinkType string
const (
	AlbumExternalLinkTypeTidalSharing AlbumExternalLinkType = "TIDAL_SHARING"
)

type AlbumRelationships

type AlbumRelationships struct {
	Artists            Response[[]Relationship] `json:"artists"`
	CoverArt           Response[[]Relationship] `json:"coverArt"`
	Genres             Response[[]Relationship] `json:"genres"`
	Items              Response[[]Relationship] `json:"items"`
	Owners             Response[[]Relationship] `json:"owners"`
	Providers          Response[[]Relationship] `json:"providers"`
	SimilarAlbums      Response[[]Relationship] `json:"similarAlbums"`
	SuggestedCoverArts Response[[]Relationship] `json:"suggestedCoverArts"`
}

type Artist

type Artist Response[ArtistData]

type ArtistAttributes

type ArtistAttributes struct {
	ContributionsEnabled bool                 `json:"contributionsEnabled"`
	ExternalLinks        []ArtistExternalLink `json:"externalLinks"`
	Name                 string               `json:"name"`
	Popularity           float64              `json:"popularity"`
	Spotlighted          bool                 `json:"spotlighted"`
}

type ArtistData

type ArtistData struct {
	Attributes    ArtistAttributes    `json:"attributes"`
	ID            string              `json:"id"`
	Relationships ArtistRelationships `json:"relationships"`
	Type          string              `json:"type"`
}
type ArtistExternalLink struct {
	Href string `json:"href"`
	Meta struct {
		Type ArtistExternalLinkType `json:"type"`
	} `json:"meta"`
}

type ArtistExternalLinkType

type ArtistExternalLinkType string
const (
	ArtistExternalLinkTypeTidalSharing ArtistExternalLinkType = "TIDAL_SHARING"
)

type ArtistRelationships

type ArtistRelationships struct {
	Albums         Response[[]Relationship] `json:"albums"`
	Biography      Response[[]Relationship] `json:"biography"`
	Followers      Response[[]Relationship] `json:"followers"`
	Following      Response[[]Relationship] `json:"following"`
	Owners         Response[[]Relationship] `json:"owners"`
	ProfileArt     Response[[]Relationship] `json:"profileArt"`
	Radio          Response[[]Relationship] `json:"radio"`
	Roles          Response[[]Relationship] `json:"roles"`
	SimilarArtists Response[[]Relationship] `json:"similarArtists"`
	TrackProviders Response[[]Relationship] `json:"trackProviders"`
	Tracks         Response[[]Relationship] `json:"tracks"`
	Videos         Response[[]Relationship] `json:"videos"`
}

type Artwork

type Artwork Response[ArtworkData]

type ArtworkAttributes

type ArtworkAttributes struct {
	Files     ArtworkFiles     `json:"files"`
	MediaType ArtworkMediaType `json:"mediaType"`
}

func (ArtworkAttributes) IsPicture

func (a ArtworkAttributes) IsPicture() bool

type ArtworkData

type ArtworkData struct {
	Attributes   ArtworkAttributes    `json:"attributes"`
	ID           string               `json:"id"`
	Relationship ArtworkRelationships `json:"relationships"`
	Type         string               `json:"type"`
}

type ArtworkFile

type ArtworkFile struct {
	Href string `json:"href"`
	Meta struct {
		Height int `json:"height"`
		Width  int `json:"width"`
	} `json:"meta"`
}

type ArtworkFiles

type ArtworkFiles []ArtworkFile

func (ArtworkFiles) AtLeast

func (files ArtworkFiles) AtLeast(size int) ArtworkFile

type ArtworkMediaType

type ArtworkMediaType string
const (
	ArtworkMediaTypeImage ArtworkMediaType = "IMAGE"
	ArtworkMediaTypeVideo ArtworkMediaType = "VIDEO"
)

type ArtworkRelationships

type ArtworkRelationships struct {
	Owners Response[[]Relationship] `json:"owners"`
}

type Artworks added in v1.1.0

type Artworks []ArtworkData

func (Artworks) AtLeast added in v1.1.0

func (artworks Artworks) AtLeast(size int) string

type DateTime

type DateTime struct {
	time.Time
}

func (*DateTime) MarshalJSON

func (r *DateTime) MarshalJSON() ([]byte, error)

func (*DateTime) UnmarshalJSON

func (d *DateTime) UnmarshalJSON(b []byte) error

type Duration

type Duration struct {
	time.Duration
}

func (*Duration) MarshalJSON

func (r *Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type IncludedObject

type IncludedObject struct {
	ID   string `json:"id"`
	Type string `json:"type"`
	Raw  json.RawMessage
}

func (*IncludedObject) UnmarshalJSON

func (i *IncludedObject) UnmarshalJSON(b []byte) error

type IncludedObjects

type IncludedObjects []IncludedObject

func (IncludedObjects) Albums

func (i IncludedObjects) Albums(relationships ...Relationship) (responses []Album)

func (IncludedObjects) Artists

func (i IncludedObjects) Artists(relationships ...Relationship) (responses []Artist)

func (IncludedObjects) FromRelationships

func (i IncludedObjects) FromRelationships(relationships []Relationship, t string) IncludedObjects

func (IncludedObjects) FromType

func (i IncludedObjects) FromType(t string) IncludedObjects

func (IncludedObjects) Lyrics

func (i IncludedObjects) Lyrics(relationships ...Relationship) (responses []Lyrics)

func (IncludedObjects) PlainAlbums

func (i IncludedObjects) PlainAlbums(relationships ...Relationship) []AlbumData

func (IncludedObjects) PlainArtists

func (i IncludedObjects) PlainArtists(relationships ...Relationship) []ArtistData

func (IncludedObjects) PlainArtworks

func (i IncludedObjects) PlainArtworks(relationships ...Relationship) Artworks

func (IncludedObjects) PlainLyrics

func (i IncludedObjects) PlainLyrics(relationships ...Relationship) []LyricsData

func (IncludedObjects) PlainPlaylists

func (i IncludedObjects) PlainPlaylists(relationships ...Relationship) []PlaylistData

func (IncludedObjects) PlainTracks

func (i IncludedObjects) PlainTracks(relationships ...Relationship) []TrackData

func (IncludedObjects) Playlists

func (i IncludedObjects) Playlists(relationships ...Relationship) (responses []Playlist)

func (IncludedObjects) Tracks

func (i IncludedObjects) Tracks(relationships ...Relationship) (responses []Track)

func (*IncludedObjects) UnmarshalJSON

func (i *IncludedObjects) UnmarshalJSON(b []byte) error
type Links struct {
	// A collection of metadata about the response
	Meta *LinksMeta `json:"meta,omitempty"`

	// A link to the next page of results
	Next *string `json:"next,omitempty"`

	// A link to the current page including the query parameters
	Self string
}

type LinksMeta

type LinksMeta struct {
	// Value to be passed to the next request to retrieve the next page of results
	NextCursor *string `json:"nextCursor,omitempty"`
}

type Lyrics

type Lyrics Response[LyricsData]

type LyricsAttributes

type LyricsAttributes struct {
	Direction       LyricsDirection          `json:"direction"`
	LRCText         string                   `json:"lrcText"`
	Provider        LyricsAttributesProvider `json:"provider"`
	TechnicalStatus string                   `json:"technicalStatus"`
	Text            string                   `json:"text"`
}

type LyricsAttributesProvider

type LyricsAttributesProvider struct {
	CommonTrackID string                         `json:"commonTrackId"`
	LyricsID      string                         `json:"lyricsId"`
	Name          string                         `json:"name"`
	Source        LyricsAttributesProviderSource `json:"source"`
}

type LyricsAttributesProviderSource

type LyricsAttributesProviderSource string
const (
	LyricsAttributesProviderSourceThirdParty LyricsAttributesProviderSource = "THIRD_PARTY"
)

type LyricsData

type LyricsData struct {
	Attributes    LyricsAttributes    `json:"attributes"`
	ID            string              `json:"id"`
	Relationships LyricsRelationships `json:"relationships"`
	Type          string              `json:"type"`
}

type LyricsDirection

type LyricsDirection string
const (
	LyricsDirectionLTR LyricsDirection = "LEFT_TO_RIGHT"
	LyricsDirectionRTL LyricsDirection = "RIGHT_TO_LEFT"
)

type LyricsRelationships

type LyricsRelationships struct {
	Owners Response[[]Relationship] `json:"owners"`
	Track  Response[Relationship]   `json:"track"`
}

type ObjectType

type ObjectType string

type Playlist

type Playlist Response[PlaylistData]

type PlaylistAttributes

type PlaylistAttributes struct {
	AccessType        string                 `json:"accessType"`
	Bounded           bool                   `json:"bounded"`
	CreatedAt         DateTime               `json:"createdAt"`
	Description       string                 `json:"description"`
	Duration          *Duration              `json:"duration,omitempty"`
	ExternalLinks     []PlaylistExternalLink `json:"externalLinks"`
	LastModifiedAt    DateTime               `json:"lastModifiedAt"`
	Name              string                 `json:"name"`
	NumberOfFollowers int                    `json:"numberOfFollowers"`
	NumberOfItems     int                    `json:"numberOfItems"`
	PlaylistType      PlaylistType           `json:"playlistType"`
}

type PlaylistData

type PlaylistData struct {
	Attributes    PlaylistAttributes    `json:"attributes"`
	ID            string                `json:"id"`
	Relationships PlaylistRelationships `json:"relationships"`
	Type          string                `json:"type"`
}
type PlaylistExternalLink struct {
	Href string `json:"href"`
	Meta struct {
		Type PlaylistExternalLinkType `json:"type"`
	} `json:"meta"`
}

type PlaylistExternalLinkType

type PlaylistExternalLinkType string
const (
	PlaylistExternalLinkTypeTidalSharing         PlaylistExternalLinkType = "TIDAL_SHARING"
	PlaylistExternalLinkTypeTidalAutoplayAndroid PlaylistExternalLinkType = "TIDAL_AUTOPLAY_ANDROID"
	PlaylistExternalLinkTypeTidalAutoplayIOS     PlaylistExternalLinkType = "TIDAL_AUTOPLAY_IOS"
	PlaylistExternalLinkTypeTidalAutoplayWeb     PlaylistExternalLinkType = "TIDAL_AUTOPLAY_WEB"
)

type PlaylistRelationships

type PlaylistRelationships struct {
	CoverArt      Response[[]Relationship] `json:"coverArt"`
	Items         Response[[]Relationship] `json:"items"`
	OwnerProfiles Response[[]Relationship] `json:"ownerProfiles"`
	Owners        Response[[]Relationship] `json:"owners"`
}

type PlaylistType

type PlaylistType string
const (
	PlaylistTypeEditorial PlaylistType = "EDITORIAL"
	PlaylistTypeMix       PlaylistType = "MIX"
	PlaylistTypeUser      PlaylistType = "USER"
)

type Relationship

type Relationship struct {
	ID   string         `json:"id"`
	Meta map[string]any `json:"meta,omitempty"`
	Type string         `json:"type"`
}

type Response

type Response[DataType any] struct {
	Data     DataType        `json:"data"`
	Included IncludedObjects `json:"included,omitempty"`
	Links    Links           `json:"links"`
}

type SearchResult

type SearchResult Response[SearchResultData]

type SearchResultAttributes

type SearchResultAttributes struct {
	TrackingID string `json:"trackingId"`
}

type SearchResultData

type SearchResultData struct {
	Attributes    SearchResultAttributes    `json:"attributes"`
	ID            string                    `json:"id"`
	Relationships SearchResultRelationships `json:"relationships"`
	Type          string                    `json:"type"`
}

type SearchResultRelationships

type SearchResultRelationships struct {
	Albums    Response[[]Relationship] `json:"albums"`
	Artists   Response[[]Relationship] `json:"artists"`
	Playlists Response[[]Relationship] `json:"playlists"`
	TopHits   Response[[]Relationship] `json:"topHits"`
	Tracks    Response[[]Relationship] `json:"tracks"`
	Videos    Response[[]Relationship] `json:"videos"`
}

type Track

type Track Response[TrackData]

func (Track) GetID added in v1.0.1

func (t Track) GetID() string

type TrackAttributes

type TrackAttributes struct {
	AccessType   string              `json:"accessType"`
	Availability []TrackAvailability `json:"availability"`
	BPM          float64             `json:"bpm"`
	Copyright    struct {
		Text string `json:"text"`
	}
	CreatedAt     DateTime               `json:"createdAt"`
	Duration      helper.DurationISO8601 `json:"duration"`
	Explicit      bool                   `json:"explicit"`
	ExternalLinks []TrackExternalLink    `json:"externalLinks"`
	ISRC          string                 `json:"isrc"`
	Key           string                 `json:"key"`
	KeyScale      string                 `json:"keyScale"`
	MediaTags     []string               `json:"media_tags"`
	Popularity    float64                `json:"popularity"`
	Spotlighted   bool                   `json:"spotlighted"`
	Title         string                 `json:"title"`
	ToneTags      []string               `json:"toneTags"`
	Version       any                    `json:"version"`
}

type TrackAvailability

type TrackAvailability string
const (
	TrackAvailabilityDJ     TrackAvailability = "DJ"
	TrackAvailabilityStream TrackAvailability = "STREAM"
)

type TrackData

type TrackData struct {
	Attributes    TrackAttributes    `json:"attributes"`
	ID            string             `json:"id"`
	Relationships TrackRelationships `json:"relationships"`
	Type          string             `json:"type"`
}
type TrackExternalLink struct {
	Href string `json:"href"`
	Meta struct {
		Type TrackExternalLinkType `json:"type"`
	} `json:"meta"`
}

type TrackExternalLinkType

type TrackExternalLinkType string
const (
	TrackExternalLinkTypeTidalSharing TrackExternalLinkType = "TIDAL_SHARING"
)

type TrackRelationships

type TrackRelationships struct {
	Albums          Response[[]Relationship] `json:"albums"`
	Artists         Response[[]Relationship] `json:"artists"`
	Genres          Response[[]Relationship] `json:"genres"`
	Lyrics          Response[[]Relationship] `json:"lyrics"`
	Owners          Response[[]Relationship] `json:"owners"`
	Providers       Response[[]Relationship] `json:"providers"`
	Radio           Response[[]Relationship] `json:"radio"`
	Shares          Response[[]Relationship] `json:"shares"`
	SimilarTracks   Response[[]Relationship] `json:"similarTracks"`
	SourceFile      Response[[]Relationship] `json:"sourceFile"`
	TrackStatistics Response[[]Relationship] `json:"trackStatistics"`
}

type UserAttributes

type UserAttributes struct {
	Country       string `json:"country"`
	Email         string `json:"email"`
	EmailVerified bool   `json:"emailVerified"`
	FirstName     string `json:"firstName"`
	LastName      string `json:"lastName"`
	Username      string `json:"username"`
}

type UserCollection

type UserCollection Response[UserCollectionData]

type UserCollectionAttributes

type UserCollectionAttributes struct{}

type UserCollectionData

type UserCollectionData struct {
	Attributes    UserCollectionAttributes    `json:"attributes"`
	ID            string                      `json:"id"`
	Relationships UserCollectionRelationships `json:"relationships"`
	Type          string                      `json:"type"`
}

type UserCollectionRelationships

type UserCollectionRelationships struct {
	Albums    Response[[]Relationship] `json:"albums"`
	Artists   Response[[]Relationship] `json:"artists"`
	Owners    Response[[]Relationship] `json:"owners"`
	Playlists Response[[]Relationship] `json:"playlists"`
	Tracks    Response[[]Relationship] `json:"tracks"`
	Videos    Response[[]Relationship] `json:"videos"`
}

type UserData

type UserData struct {
	Attributes UserAttributes `json:"attributes"`
	ID         string         `json:"id"`
	Type       string         `json:"type"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL