tidalv2 0.3.0

Rust client library for TIDAL's v2 JSON:API - type-safe access to TIDAL's music catalog and streaming services
Documentation
use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ArtistRole {
    #[serde(rename = "attributes", default)]
    pub attributes: ArtistRoleAttributes,
    /// Resource id
    #[serde(rename = "id")]
    pub id: String,
    /// Resource type
    #[serde(rename = "type")]
    pub r#type: String,
}

impl ArtistRole {
    pub fn new(id: String, r#type: String) -> ArtistRole {
        ArtistRole {
            attributes: ArtistRoleAttributes::default(),
            id,
            r#type,
        }
    }
}

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ArtistRoleAttributes {
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

impl ArtistRoleAttributes {
    pub fn new() -> ArtistRoleAttributes {
        ArtistRoleAttributes { name: None }
    }
}