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 InlineObject4 {
    /// Human-readable error message suitable for end-user display.
    #[serde(rename = "error")]
    pub error: String,
    /// Machine-readable error code. Stable across versions.
    #[serde(rename = "code")]
    pub code: Code,
    /// Discriminator for which gate fired.
    #[serde(rename = "reason")]
    pub reason: Reason,
    /// Link to the relevant documentation page.
    #[serde(rename = "documentation_url", skip_serializing_if = "Option::is_none")]
    pub documentation_url: Option<String>,
    /// Deep-link to send the end-user to. For `free_tier_exceeded` and `twitter_passthrough` this opens the add-payment-method drawer on the Zernio billing page. For `enterprise_required` this is the Zernio enterprise contact page.
    #[serde(rename = "dashboard_url", skip_serializing_if = "Option::is_none")]
    pub dashboard_url: Option<String>,
    #[serde(rename = "details", skip_serializing_if = "Option::is_none")]
    pub details: Option<Box<models::InlineObject4Details>>,
}

impl InlineObject4 {
    pub fn new(error: String, code: Code, reason: Reason) -> InlineObject4 {
        InlineObject4 {
            error,
            code,
            reason,
            documentation_url: None,
            dashboard_url: None,
            details: None,
        }
    }
}
/// Machine-readable error code. Stable across versions.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Code {
    #[serde(rename = "PAYMENT_REQUIRED")]
    PaymentRequired,
}

impl Default for Code {
    fn default() -> Code {
        Self::PaymentRequired
    }
}
/// Discriminator for which gate fired.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Reason {
    #[serde(rename = "free_tier_exceeded")]
    FreeTierExceeded,
    #[serde(rename = "twitter_passthrough")]
    TwitterPassthrough,
    #[serde(rename = "enterprise_required")]
    EnterpriseRequired,
    #[serde(rename = "card_verification_required")]
    CardVerificationRequired,
}

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