/*
* 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 SendInboxMessage400Response {
#[serde(rename = "error", skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
/// Present on Meta pass-through rejections: platform_error when Meta rejected the send (see platform/platformError below), invalid_request_error for validation failures.
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<Type>,
/// Stable machine-readable reason. PLATFORM_LIMITATION covers a capability the platform does not offer (e.g. Bluesky and Reddit DMs reject media); MISSING_PARTICIPANT means the stored conversation has no recipient to send to; DIRECT_SEND_NOT_ELIGIBLE and DIRECT_SEND_BLOCKED mean the WhatsApp Business Account needs Meta to grant or restore Direct Send access; DIRECT_SEND_LIMITED is temporary, Meta lifts it on its own; platform_api_error means Meta itself rejected the send (see platformError).
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<Code>,
/// Present alongside code platform_api_error. The platform that rejected the send (e.g. instagram, facebook, whatsapp).
#[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "platformError", skip_serializing_if = "Option::is_none")]
pub platform_error: Option<Box<models::SendInboxMessage400ResponsePlatformError>>,
}
impl SendInboxMessage400Response {
pub fn new() -> SendInboxMessage400Response {
SendInboxMessage400Response {
error: None,
r#type: None,
code: None,
platform: None,
platform_error: None,
}
}
}
/// Present on Meta pass-through rejections: platform_error when Meta rejected the send (see platform/platformError below), invalid_request_error for validation failures.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "platform_error")]
PlatformError,
#[serde(rename = "invalid_request_error")]
InvalidRequestError,
}
impl Default for Type {
fn default() -> Type {
Self::PlatformError
}
}
/// Stable machine-readable reason. PLATFORM_LIMITATION covers a capability the platform does not offer (e.g. Bluesky and Reddit DMs reject media); MISSING_PARTICIPANT means the stored conversation has no recipient to send to; DIRECT_SEND_NOT_ELIGIBLE and DIRECT_SEND_BLOCKED mean the WhatsApp Business Account needs Meta to grant or restore Direct Send access; DIRECT_SEND_LIMITED is temporary, Meta lifts it on its own; platform_api_error means Meta itself rejected the send (see platformError).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Code {
#[serde(rename = "PLATFORM_LIMITATION")]
PlatformLimitation,
#[serde(rename = "MISSING_PARTICIPANT")]
MissingParticipant,
#[serde(rename = "INVALID_TEMPLATE_HEADER")]
InvalidTemplateHeader,
#[serde(rename = "DIRECT_SEND_NOT_ELIGIBLE")]
DirectSendNotEligible,
#[serde(rename = "DIRECT_SEND_LIMITED")]
DirectSendLimited,
#[serde(rename = "DIRECT_SEND_BLOCKED")]
DirectSendBlocked,
#[serde(rename = "platform_api_error")]
PlatformApiError,
}
impl Default for Code {
fn default() -> Code {
Self::PlatformLimitation
}
}