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 FacebookPostEarningsResponseUnavailableMetricsInner {
    /// The requested metric name.
    #[serde(rename = "metric", skip_serializing_if = "Option::is_none")]
    pub metric: Option<String>,
    /// \"not_enrolled\": the account is not enrolled in the program behind this metric. \"permission_missing\": the connected user lacks access to this metric. \"unsupported_metric\": Meta does not accept this metric name on the API version Zernio uses. \"no_data\": Meta returned no bucket for this metric. \"unreadable_value\": Meta returned a value shape Zernio cannot read, so no total is reported. \"mixed_currency\": readable values disagree on currency or unit. \"upstream_error\": any other platform failure.  \"no_data\" is the common case in practice; the others are defensive.
    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
    pub reason: Option<Reason>,
    /// Platform-provided explanation when available (access tokens redacted), otherwise Zernio copy.
    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
}

impl FacebookPostEarningsResponseUnavailableMetricsInner {
    pub fn new() -> FacebookPostEarningsResponseUnavailableMetricsInner {
        FacebookPostEarningsResponseUnavailableMetricsInner {
            metric: None,
            reason: None,
            message: None,
        }
    }
}
/// \"not_enrolled\": the account is not enrolled in the program behind this metric. \"permission_missing\": the connected user lacks access to this metric. \"unsupported_metric\": Meta does not accept this metric name on the API version Zernio uses. \"no_data\": Meta returned no bucket for this metric. \"unreadable_value\": Meta returned a value shape Zernio cannot read, so no total is reported. \"mixed_currency\": readable values disagree on currency or unit. \"upstream_error\": any other platform failure.  \"no_data\" is the common case in practice; the others are defensive.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Reason {
    #[serde(rename = "not_enrolled")]
    NotEnrolled,
    #[serde(rename = "permission_missing")]
    PermissionMissing,
    #[serde(rename = "unsupported_metric")]
    UnsupportedMetric,
    #[serde(rename = "no_data")]
    NoData,
    #[serde(rename = "unreadable_value")]
    UnreadableValue,
    #[serde(rename = "mixed_currency")]
    MixedCurrency,
    #[serde(rename = "upstream_error")]
    UpstreamError,
}

impl Default for Reason {
    fn default() -> Reason {
        Self::NotEnrolled
    }
}