/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InstagramDemographicsResponse {
    #[serde(rename = "success", skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// The Zernio SocialAccount ID
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    #[serde(rename = "metric", skip_serializing_if = "Option::is_none")]
    pub metric: Option<Metric>,
    /// The timeframe used for demographic data
    #[serde(rename = "timeframe", skip_serializing_if = "Option::is_none")]
    pub timeframe: Option<Timeframe>,
    /// Object keyed by breakdown dimension (age, city, country, gender)
    #[serde(rename = "demographics", skip_serializing_if = "Option::is_none")]
    pub demographics: Option<
        std::collections::HashMap<
            String,
            Vec<models::InstagramDemographicsResponseDemographicsValueInner>,
        >,
    >,
    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
    pub note: Option<String>,
}

impl InstagramDemographicsResponse {
    pub fn new() -> InstagramDemographicsResponse {
        InstagramDemographicsResponse {
            success: None,
            account_id: None,
            platform: None,
            metric: None,
            timeframe: None,
            demographics: None,
            note: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Metric {
    #[serde(rename = "follower_demographics")]
    FollowerDemographics,
    #[serde(rename = "engaged_audience_demographics")]
    EngagedAudienceDemographics,
}

impl Default for Metric {
    fn default() -> Metric {
        Self::FollowerDemographics
    }
}
/// The timeframe used for demographic data
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Timeframe {
    #[serde(rename = "this_week")]
    ThisWeek,
    #[serde(rename = "this_month")]
    ThisMonth,
}

impl Default for Timeframe {
    fn default() -> Timeframe {
        Self::ThisWeek
    }
}
