rspotify_model/
artist.rs

1//! All objects related to artist defined by Spotify API
2
3use serde::{Deserialize, Serialize};
4
5use std::collections::HashMap;
6
7use crate::{ArtistId, CursorBasedPage, Followers, Image};
8
9/// Simplified Artist Object
10#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Default)]
11pub struct SimplifiedArtist {
12    pub external_urls: HashMap<String, String>,
13    pub href: Option<String>,
14    pub id: Option<ArtistId<'static>>,
15    pub name: String,
16}
17
18/// Full Artist Object
19#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
20pub struct FullArtist {
21    pub external_urls: HashMap<String, String>,
22    pub followers: Followers,
23    pub genres: Vec<String>,
24    pub href: String,
25    pub id: ArtistId<'static>,
26    pub images: Vec<Image>,
27    pub name: String,
28    pub popularity: u32,
29}
30
31/// Intermediate full artist object wrapped by `Vec`
32#[derive(Deserialize)]
33pub struct FullArtists {
34    pub artists: Vec<FullArtist>,
35}
36
37/// Intermediate full Artists vector wrapped by cursor-based-page object
38#[derive(Deserialize)]
39pub struct CursorPageFullArtists {
40    pub artists: CursorBasedPage<FullArtist>,
41}