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 ArtistsAttributes {
    /// Is the artist enabled for contributions?
    #[serde(rename = "contributionsEnabled", skip_serializing_if = "Option::is_none")]
    pub contributions_enabled: Option<bool>,
    /// Contributions sales pitch
    #[serde(rename = "contributionsSalesPitch", skip_serializing_if = "Option::is_none")]
    pub contributions_sales_pitch: Option<String>,
    /// Artist links external to TIDAL API
    #[serde(rename = "externalLinks", skip_serializing_if = "Option::is_none")]
    pub external_links: Option<Vec<models::ExternalLink>>,
    /// Artist handle
    #[serde(rename = "handle", skip_serializing_if = "Option::is_none")]
    pub handle: Option<String>,
    /// Artist name
    #[serde(rename = "name")]
    pub name: String,
    /// Artist popularity (0.0 - 1.0)
    #[serde(rename = "popularity")]
    pub popularity: f64,
    /// Is the artist spotlighted?
    #[serde(rename = "spotlighted", skip_serializing_if = "Option::is_none")]
    pub spotlighted: Option<bool>,
}

impl ArtistsAttributes {
    pub fn new(name: String, popularity: f64) -> ArtistsAttributes {
        ArtistsAttributes {
            contributions_enabled: None,
            contributions_sales_pitch: None,
            external_links: None,
            handle: None,
            name,
            popularity,
            spotlighted: None,
        }
    }
}