late 0.0.1055

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.104.0
 * 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 GetYoutubeCaptions200Response {
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    #[serde(rename = "videoId", skip_serializing_if = "Option::is_none")]
    pub video_id: Option<String>,
    /// The language of the returned track.
    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
    pub language: Option<String>,
    /// YouTube's own caption track id.
    #[serde(rename = "trackId", skip_serializing_if = "Option::is_none")]
    pub track_id: Option<String>,
    /// `asr` is YouTube's auto-generated track; `standard` was uploaded by the channel.
    #[serde(rename = "trackKind", skip_serializing_if = "Option::is_none")]
    pub track_kind: Option<TrackKind>,
    /// `cache` when served from our stored copy, `youtube` when this call spent the quota units.
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<Source>,
    /// When the stored copy was downloaded from YouTube.
    #[serde(rename = "fetchedAt", skip_serializing_if = "Option::is_none")]
    pub fetched_at: Option<String>,
    /// The whole transcript as one paragraph, no timings.
    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// Timed cues. Present when format is json. Auto-generated cues overlap in time by design (captions roll), so `start` can precede the previous cue's `end`.
    #[serde(rename = "cues", skip_serializing_if = "Option::is_none")]
    pub cues: Option<Vec<models::GetYoutubeCaptions200ResponseCuesInner>>,
    /// Raw SubRip body. Present when format is srt.
    #[serde(rename = "srt", skip_serializing_if = "Option::is_none")]
    pub srt: Option<String>,
    /// Every track on the video, so you can re-request another language. On a cached read this is the listing as it stood when we downloaded, so a language added to the video since then appears only after a `refresh=true` or when you request that language directly.
    #[serde(rename = "availableTracks", skip_serializing_if = "Option::is_none")]
    pub available_tracks: Option<Vec<models::GetYoutubeCaptions200ResponseAvailableTracksInner>>,
}

impl GetYoutubeCaptions200Response {
    pub fn new() -> GetYoutubeCaptions200Response {
        GetYoutubeCaptions200Response {
            account_id: None,
            video_id: None,
            language: None,
            track_id: None,
            track_kind: None,
            source: None,
            fetched_at: None,
            text: None,
            cues: None,
            srt: None,
            available_tracks: None,
        }
    }
}
/// `asr` is YouTube's auto-generated track; `standard` was uploaded by the channel.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TrackKind {
    #[serde(rename = "asr")]
    Asr,
    #[serde(rename = "standard")]
    Standard,
}

impl Default for TrackKind {
    fn default() -> TrackKind {
        Self::Asr
    }
}
/// `cache` when served from our stored copy, `youtube` when this call spent the quota units.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
    #[serde(rename = "cache")]
    Cache,
    #[serde(rename = "youtube")]
    Youtube,
}

impl Default for Source {
    fn default() -> Source {
        Self::Cache
    }
}