Struct MusicRequestBuilder

Source
pub struct MusicRequestBuilder<'a, BuilderType, Data = ()> { /* private fields */ }
Expand description

A request builder

Implementations§

Source§

impl<'a, BuilderType, Data> MusicRequestBuilder<'a, BuilderType, Data>

Source

pub fn override_storefront(self, storefront: Country) -> Self

Override storefront for this request

Source

pub fn override_localization(self, localization: &'a str) -> Self

Override localization for this request

Source

pub fn extend(self, extension: impl ExtensionTrait) -> Self

Extend resource attributes

Source

pub fn include(self, relationship: impl RelationshipTrait) -> Self

Include a relationship

This will fetch the full object for the relationship data

Source

pub fn include_lazy(self, relationship: impl RelationshipTrait) -> Self

Lazily include a relationship

This will only fetch the identifiers for the relationship data

Source

pub fn view(self, view: impl ViewTrait) -> Self

Add a relationship view

Source§

impl<'a> MusicRequestBuilder<'a, ActivityRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<Activity>, Error>

Fetch one catalog activity by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<Activity>, Error>

Fetch multiple activities by id

Source§

impl<'a> MusicRequestBuilder<'a, AlbumRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<Album>, Error>

Fetch one album by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], upc: bool, ) -> Result<Vec<Album>, Error>

Fetch multiple albums by id

§Params
  • upc - if the ids are UPCs or album ids, false means album ids, true means UPCs
Source§

impl<'a> MusicRequestBuilder<'a, ArtistRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<Artist>, Error>

Fetch one artist by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<Artist>, Error>

Fetch multiple artists by id

Source§

impl<'a> MusicRequestBuilder<'a, AppleCuratorRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<AppleCurator>, Error>

Fetch one apple curator by id

Source

pub async fn main( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<AppleCurator>, Error>

Fetch multiple apple curators by id

Source§

impl<'a> MusicRequestBuilder<'a, CuratorRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<Curator>, Error>

Fetch one curator by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<Curator>, Error>

Fetch multiple curators by id

Source§

impl<'a> MusicRequestBuilder<'a, MusicVideoRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<MusicVideo>, Error>

Fetch one music video by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], isrc: bool, ) -> Result<Vec<MusicVideo>, Error>

Fetch multiple music videos by id

§Params
  • isrc - if the ids are ISRCs or music video ids, false means music video ids, true means ISRCs
Source§

impl<'a> MusicRequestBuilder<'a, PlaylistRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<Playlist>, Error>

Fetch one playlist by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<Playlist>, Error>

Fetch many playlists by id

Source

pub async fn chart( self, client: &ApiClient, storefront: &str, ) -> Result<Vec<Playlist>, Error>

Fetch chart playlists by storefront value

Source§

impl<'a> MusicRequestBuilder<'a, RecordLabelRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<RecordLabel>, Error>

Fetch one record label by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<RecordLabel>, Error>

Fetch many record labels by id

Source§

impl<'a> MusicRequestBuilder<'a, SongRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<Song>, Error>

Fetch one song by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], isrc: bool, ) -> Result<Vec<Song>, Error>

Fetch multiple songs by id

§Params
  • isrc - if the ids are ISRCs or song ids, false means song ids, true means ISRCs
Source§

impl<'a> MusicRequestBuilder<'a, StationRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<Station>, Error>

Fetch one station by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<Station>, Error>

Fetch multiple stations by id

Source

pub async fn live(self, client: &ApiClient) -> Result<Vec<Station>, Error>

Fetch live radio stations

Source

pub async fn personal( self, client: &ApiClient, ) -> Result<Option<Station>, Error>

Fetch user’s current personal station

Source§

impl<'a> MusicRequestBuilder<'a, StationGenreRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<StationGenre>, Error>

Fetch one station genre by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<StationGenre>, Error>

Fetch multiple station genres by id

Source

pub fn all( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<StationGenre, Error>>

Fetch all station genres

§Params
  • limit - limit of entries per query

  • offset - query offset

Source§

impl<'a> MusicRequestBuilder<'a, GenreRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<Genre>, Error>

Fetch one genre by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<Genre>, Error>

Fetch multiple genres by id

Source

pub async fn top_charts( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<Genre, Error>>

Fetch all genres for the current top charts

§Params
  • limit - limit of entries per query

  • offset - query offset

Source§

impl<'a> MusicRequestBuilder<'a, HistoryRequestBuilder>

Source

pub async fn heavy_rotation( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<Resource, Error>>

Fetch heavy rotation content

§Params
  • limit - limit of entries per query

  • offset - query offset

Possible resources: any

Source

pub async fn recently_played( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<Resource, Error>>

Fetch recently played resources

§Params
  • limit - limit of entries per query

  • offset - query offset

Possible resources: any

Source

pub async fn recently_played_tracks( self, client: &ApiClient, tracks: &[TrackType], limit: usize, offset: usize, ) -> impl Stream<Item = Result<Resource, Error>>

Fetch recently played tracks

§Params
  • limit - limit of entries per query

  • offset - query offset

Possible resources: [LibraryMusicVideo], [LibrarySong], [MusicVideo], [Song]

Source

pub async fn recently_played_stations( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<Resource, Error>>

Fetch recently played radio stations

§Params
  • limit - limit of entries per query

  • offset - query offset

Possible resources: [Station]

Source

pub async fn recently_added_to_library( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<Resource, Error>>

Fetch resources recently added to the library

§Params
  • limit - limit of entries per query

  • offset - query offset

Possible resources: [LibraryAlbum], [LibraryArtist], [LibraryPlaylist], [LibrarySong]

Source§

impl<'a> MusicRequestBuilder<'a, LibraryAlbumRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<LibraryAlbum>, Error>

Fetch one library album by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<LibraryAlbum>, Error>

Fetch multiple library albums by id

Source

pub fn all( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<LibraryAlbum, Error>>

Fetch all library albums

§Params
  • limit - limit of entries per query

  • offset - query offset

Source§

impl<'a> MusicRequestBuilder<'a, LibraryArtistRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<LibraryArtist>, Error>

Fetch one library artist by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<LibraryArtist>, Error>

Fetch multiple library artists by id

Source

pub fn all( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<LibraryArtist, Error>>

Fetch all library artists

§Params
  • limit - limit of entries per query

  • offset - query offset

Source§

impl<'a> MusicRequestBuilder<'a, LibraryMusicVideoRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<LibraryMusicVideo>, Error>

Fetch one library music video by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<LibraryMusicVideo>, Error>

Fetch multiple library music videos by id

Source

pub fn all( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<LibraryMusicVideo, Error>>

Fetch all library music videos

§Params
  • limit - limit of entries per query

  • offset - query offset

Source§

impl<'a> MusicRequestBuilder<'a, LibraryPlaylistRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<LibraryPlaylist>, Error>

Fetch one library playlist by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<LibraryPlaylist>, Error>

Fetch multiple library playlists by id

Source

pub fn all( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<LibraryPlaylist, Error>>

Fetch all library playlists

§Params
  • limit - limit of entries per query

  • offset - query offset

Source§

impl<'localization, 'name> MusicRequestBuilder<'localization, LibraryPlaylistRequestBuilder, LibraryPlaylistCreateRequest<'name>>

Source

pub fn new(name: &'name str) -> Self

Create a new LibraryPlaylistCreateBuilder instance

Source

pub fn description(self, desc: &str) -> Self

Set description for this request

Source

pub fn public(self, p: bool) -> Self

Set if the playlist is public for this request

Source

pub fn tracks(self, resources: &[&Resource]) -> Result<Self, Error>

Add tracks to this request

Source

pub fn parent_folder(self, parent_folder_id: &str) -> Self

Set parent playlist folder

Source

pub async fn create( self, client: &ApiClient, ) -> Result<Option<LibraryPlaylist>, Error>

Create the playlist

§Return type

Resource of type LibraryPlaylist

Source§

impl<'a> MusicRequestBuilder<'a, LibraryPlaylistFolderRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<LibraryPlaylistFolder>, Error>

Fetch one library playlist folder by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<LibraryPlaylistFolder>, Error>

Fetch multiple library playlist folders by id

Source§

impl<'a> MusicRequestBuilder<'a, LibrarySongRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<LibrarySong>, Error>

Fetch one library song by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<LibrarySong>, Error>

Fetch multiple library songs by id

Source

pub fn all( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<LibrarySong, Error>>

Fetch all library songs

§Params
  • limit - limit of entries per query

  • offset - query offset

Source§

impl<'a> MusicRequestBuilder<'a, LibraryBuilder, HashMap<&'static str, HashSet<String>>>

Source

pub fn new() -> LibraryAddResourceBuilder<'a>

Create a new LibraryAddResourceBuilder instance

Source

pub fn add_resource(self, resource: &Resource) -> Result<Self, Error>

Add a resource to the library

Source

pub fn add_resources(self, resources: &[Resource]) -> Result<Self, Error>

Add multiple resources to the library

Source

pub async fn send(self, client: &ApiClient) -> Result<Vec<Resource>, Error>

Send the request

Source§

impl<'a> MusicRequestBuilder<'a, PersonalRecommendationRequestBuilder>

Source

pub async fn one( self, client: &ApiClient, id: &str, ) -> Result<Option<PersonalRecommendation>, Error>

Fetch one recommendation by id

Source

pub async fn many( self, client: &ApiClient, ids: &[&str], ) -> Result<Vec<PersonalRecommendation>, Error>

Fetch multiple recommendations by id

Source

pub async fn default_recommendations( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<PersonalRecommendation, Error>>

Fetch default recommendations

§Params
  • limit - limit of entries per query

  • offset - query offset

Source§

impl<'a> MusicRequestBuilder<'a, RatingGetRequestBuilderMarker>

Source

pub async fn one( self, client: &ApiClient, rating_type: RatingType, id: &str, ) -> Result<Option<Rating>, Error>

Fetch one rating for a resource

Source

pub async fn many( self, client: &ApiClient, rating_type: RatingType, ids: &[&str], ) -> Result<Vec<Rating>, Error>

Fetch multiple ratings by ids

Source§

impl<'a> MusicRequestBuilder<'a, RatingPostRequestBuilderMarker>

Source

pub async fn add_rating( self, client: &ApiClient, resource: &Resource, rating: i32, ) -> Result<Option<Rating>, Error>

Add a rating to a resource

§Return value

Resource of type Rating

Source

pub async fn remove_rating( self, client: &ApiClient, resource: &Resource, ) -> Result<(), Error>

Remove a rating from a resource

Source§

impl<'a> MusicRequestBuilder<'a, CatalogSearchRequestBuilderMarker>

Source

pub async fn search( self, client: &ApiClient, types: &[CatalogSearchType], term: &str, ) -> Result<CatalogSearchResults, Error>

Search the catalog using a query

§Params
  • types - types to include in the search results

  • term - The entered text for the search

Source

pub async fn search_hints( self, client: &ApiClient, term: &str, limit: usize, ) -> Result<Vec<String>, Error>

Get catalog search hints

§Params
  • term - The entered text for the search

  • limit - returned hints count limit

Source

pub async fn suggestions( self, client: &ApiClient, kinds: &[SuggestionKind], types: &[CatalogSearchType], term: &str, limit: usize, ) -> Result<Vec<CatalogSearchSuggestion>, Error>

Get catalog search suggestions

§Params
  • term - The entered text for the search

  • types - types to include in the search results

  • limit - returned hints count limit (Default value: 5, maximum: 10)

Source§

impl<'a> MusicRequestBuilder<'a, LibrarySearchRequestBuilderMarker>

Source

pub async fn search( self, client: &ApiClient, types: &[LibrarySearchType], term: &str, ) -> Result<LibrarySearchResults, Error>

Search the library using a query

§Params
  • types - types to search

  • term - The entered text for the search, spaces will automatically get replaced with ‘+’

Source§

impl<'a> MusicRequestBuilder<'a, StorefrontGetRequestBuilderMarker>

Source

pub async fn one( self, client: &ApiClient, country: Country, ) -> Result<Option<Storefront>, Error>

Fetch one storefront using a country

Source

pub async fn many( self, client: &ApiClient, countries: &[Country], ) -> Result<Vec<Storefront>, Error>

Fetch multiple storefronts using countries

§Params
  • limit - limit of entries per query

  • offset - query offset

Source

pub fn all( self, client: &ApiClient, limit: usize, offset: usize, ) -> impl Stream<Item = Result<Storefront, Error>>

Fetch all storefronts

Trait Implementations§

Source§

impl<'a, T, Data> Default for MusicRequestBuilder<'a, T, Data>
where Data: Default,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a, BuilderType, Data> Freeze for MusicRequestBuilder<'a, BuilderType, Data>
where Data: Freeze,

§

impl<'a, BuilderType, Data> RefUnwindSafe for MusicRequestBuilder<'a, BuilderType, Data>
where Data: RefUnwindSafe, BuilderType: RefUnwindSafe,

§

impl<'a, BuilderType, Data> Send for MusicRequestBuilder<'a, BuilderType, Data>
where Data: Send, BuilderType: Send,

§

impl<'a, BuilderType, Data> Sync for MusicRequestBuilder<'a, BuilderType, Data>
where Data: Sync, BuilderType: Sync,

§

impl<'a, BuilderType, Data> Unpin for MusicRequestBuilder<'a, BuilderType, Data>
where Data: Unpin, BuilderType: Unpin,

§

impl<'a, BuilderType, Data> UnwindSafe for MusicRequestBuilder<'a, BuilderType, Data>
where Data: UnwindSafe, BuilderType: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,