prawn 0.0.3

Rust Client for the Tidal API providing comprehensive API coverag, and easy OAuth management
Documentation
/*
 * TIDAL API
 *
 * The TIDAL API is a [JSON:API](https://jsonapi.org/)–compliant web API that exposes TIDAL’s music, metadata, and user-related functionality through a consistent, resource-oriented design. More information and API management are available at [developer.tidal.com](developer.tidal.com)
 *
 * The version of the OpenAPI document: 1.0.36
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct AlbumsAttributes {
    /// Access type
    #[serde(rename = "accessType", skip_serializing_if = "Option::is_none")]
    pub access_type: Option<AccessType>,
    /// Available usage for this album
    #[serde(rename = "availability", skip_serializing_if = "Option::is_none")]
    pub availability: Option<Vec<Availability>>,
    /// Barcode id (EAN-13 or UPC-A)
    #[serde(rename = "barcodeId")]
    pub barcode_id: String,
    #[serde(rename = "copyright", skip_serializing_if = "Option::is_none")]
    pub copyright: Option<Box<models::Copyright>>,
    /// Duration (ISO 8601)
    #[serde(rename = "duration")]
    pub duration: String,
    /// Explicit content
    #[serde(rename = "explicit")]
    pub explicit: bool,
    /// Album links external to TIDAL API
    #[serde(rename = "externalLinks", skip_serializing_if = "Option::is_none")]
    pub external_links: Option<Vec<models::ExternalLink>>,
    #[serde(rename = "mediaTags")]
    pub media_tags: Vec<String>,
    /// Number of items in album
    #[serde(rename = "numberOfItems")]
    pub number_of_items: i32,
    /// Number of volumes
    #[serde(rename = "numberOfVolumes")]
    pub number_of_volumes: i32,
    /// Popularity (0.0 - 1.0)
    #[serde(rename = "popularity")]
    pub popularity: f64,
    /// Release date (ISO-8601)
    #[serde(rename = "releaseDate", skip_serializing_if = "Option::is_none")]
    pub release_date: Option<String>,
    /// Album title
    #[serde(rename = "title")]
    pub title: String,
    /// Album type
    #[serde(rename = "type")]
    pub r#type: Type,
    /// Album version
    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

impl AlbumsAttributes {
    pub fn new(barcode_id: String, duration: String, explicit: bool, media_tags: Vec<String>, number_of_items: i32, number_of_volumes: i32, popularity: f64, title: String, r#type: Type) -> AlbumsAttributes {
        AlbumsAttributes {
            access_type: None,
            availability: None,
            barcode_id,
            copyright: None,
            duration,
            explicit,
            external_links: None,
            media_tags,
            number_of_items,
            number_of_volumes,
            popularity,
            release_date: None,
            title,
            r#type,
            version: None,
        }
    }
}
/// Access type
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AccessType {
    #[serde(rename = "PUBLIC")]
    Public,
    #[serde(rename = "UNLISTED")]
    Unlisted,
    #[serde(rename = "PRIVATE")]
    Private,
}

impl Default for AccessType {
    fn default() -> AccessType {
        Self::Public
    }
}
/// Available usage for this album
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Availability {
    #[serde(rename = "STREAM")]
    Stream,
    #[serde(rename = "DJ")]
    Dj,
    #[serde(rename = "STEM")]
    Stem,
}

impl Default for Availability {
    fn default() -> Availability {
        Self::Stream
    }
}
/// Album type
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "ALBUM")]
    Album,
    #[serde(rename = "EP")]
    Ep,
    #[serde(rename = "SINGLE")]
    Single,
}

impl Default for Type {
    fn default() -> Type {
        Self::Album
    }
}