/*
 * 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 YouTubeVideoRetentionResponse {
    #[serde(rename = "success", skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// The Zernio account ID for the YouTube account
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// The YouTube video ID
    #[serde(rename = "videoId", skip_serializing_if = "Option::is_none")]
    pub video_id: Option<String>,
    /// Video title
    #[serde(
        rename = "title",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub title: Option<Option<String>>,
    /// When the video was published on YouTube
    #[serde(
        rename = "publishedAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub published_at: Option<Option<String>>,
    /// Video length in seconds (from YouTube contentDetails.duration)
    #[serde(
        rename = "durationSeconds",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub duration_seconds: Option<Option<i32>>,
    #[serde(rename = "dateRange", skip_serializing_if = "Option::is_none")]
    pub date_range: Option<Box<models::YouTubeDailyViewsResponseDateRange>>,
    /// Up to 100 points covering the video timeline, aggregated over the date range. Empty for videos with very few views.
    #[serde(rename = "retentionCurve", skip_serializing_if = "Option::is_none")]
    pub retention_curve: Option<Vec<models::YouTubeVideoRetentionResponseRetentionCurveInner>>,
    /// Present only when the curve is empty, explaining why
    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
    pub note: Option<String>,
    #[serde(rename = "scopeStatus", skip_serializing_if = "Option::is_none")]
    pub scope_status: Option<Box<models::YouTubeDailyViewsResponseScopeStatus>>,
}

impl YouTubeVideoRetentionResponse {
    pub fn new() -> YouTubeVideoRetentionResponse {
        YouTubeVideoRetentionResponse {
            success: None,
            account_id: None,
            video_id: None,
            title: None,
            published_at: None,
            duration_seconds: None,
            date_range: None,
            retention_curve: None,
            note: None,
            scope_status: None,
        }
    }
}
