late 0.0.1373

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.575.1
 * 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 InstallAutomationTemplate400Response {
    /// Human-readable error message.
    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// Error class for programmatic handling.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    /// Stable machine-readable error code.
    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
    pub code: Option<String>,
    /// The request field that caused the error, when applicable.
    #[serde(rename = "param", skip_serializing_if = "Option::is_none")]
    pub param: Option<String>,
    /// Documentation page for resolving the error, when one applies.
    #[serde(rename = "docUrl", skip_serializing_if = "Option::is_none")]
    pub doc_url: Option<String>,
    /// Upstream platform (e.g. meta, google, tiktok), present when type is platform_error.
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    /// Raw error payload from the upstream platform, passed through verbatim so integrators can read provider-specific codes. For Meta this includes error_subcode, error_user_title, and error_user_msg.
    #[serde(rename = "platformError", skip_serializing_if = "Option::is_none")]
    pub platform_error: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// Email API: the mailbox provider the error came from (`google`, `microsoft`).
    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
    pub provider: Option<String>,
    #[serde(rename = "providerError", skip_serializing_if = "Option::is_none")]
    pub provider_error: Option<Box<models::ErrorResponseProviderError>>,
    /// Email API: whether the same request can succeed if retried (with the same `Idempotency-Key` for sends).
    #[serde(rename = "retryable", skip_serializing_if = "Option::is_none")]
    pub retryable: Option<bool>,
    /// Email API: the request id, also in the `X-Request-Id` header. Quote it when you contact support.
    #[serde(rename = "requestId", skip_serializing_if = "Option::is_none")]
    pub request_id: Option<String>,
    /// Email API: where this `code` is documented.
    #[serde(rename = "docsUrl", skip_serializing_if = "Option::is_none")]
    pub docs_url: Option<String>,
    #[serde(rename = "details", skip_serializing_if = "Option::is_none")]
    pub details: Option<Box<models::AutomationProblems>>,
}

impl InstallAutomationTemplate400Response {
    pub fn new() -> InstallAutomationTemplate400Response {
        InstallAutomationTemplate400Response {
            error: None,
            r#type: None,
            code: None,
            param: None,
            doc_url: None,
            platform: None,
            platform_error: None,
            provider: None,
            provider_error: None,
            retryable: None,
            request_id: None,
            docs_url: None,
            details: None,
        }
    }
}
/// Error class for programmatic handling.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "invalid_request_error")]
    InvalidRequestError,
    #[serde(rename = "authentication_error")]
    AuthenticationError,
    #[serde(rename = "permission_error")]
    PermissionError,
    #[serde(rename = "not_found")]
    NotFound,
    #[serde(rename = "rate_limit_error")]
    RateLimitError,
    #[serde(rename = "platform_error")]
    PlatformError,
    #[serde(rename = "api_error")]
    ApiError,
}

impl Default for Type {
    fn default() -> Type {
        Self::InvalidRequestError
    }
}