/*
* 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};
/// GetAccountHealth200ResponsePlatformConnection : WhatsApp accounts only. Live probe of the Meta link behind the channel, performed at request time (the same read as GET /v1/whatsapp/number-info).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetAccountHealth200ResponsePlatformConnection {
/// `connected` = Meta served the channel object. `disconnected` = Meta refused to serve it (Graph error 100, subcode 33), which is how a phone-side coexistence disconnect surfaces. `unknown` = the live read failed for another reason (timeout, transient Meta error), not evidence either way.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
/// When this live probe ran (always the current request; never cached)
#[serde(rename = "checkedAt", skip_serializing_if = "Option::is_none")]
pub checked_at: Option<String>,
/// Meta's own `status` field from the phone-number node (for example CONNECTED), when the object was readable
#[serde(
rename = "phoneStatus",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub phone_status: Option<Option<String>>,
#[serde(rename = "metaError", skip_serializing_if = "Option::is_none")]
pub meta_error: Option<Box<models::GetAccountHealth200ResponsePlatformConnectionMetaError>>,
/// From the phone number's Meta health_status. `false` = Meta says Zernio is not subscribed to the message webhook for this number, so inbound messages are not delivered even though the number is CONNECTED and can still send. Fix by re-subscribing (reconnect the number); if it stays `false`, the number is routed to a different WhatsApp Business Account (typically after linking it to a Facebook Page). `true` = Meta reports no such problem. `null` = Meta did not report it (read failed or no health_status), not evidence either way.
#[serde(
rename = "inboundWebhookSubscribed",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub inbound_webhook_subscribed: Option<Option<bool>>,
}
impl GetAccountHealth200ResponsePlatformConnection {
/// WhatsApp accounts only. Live probe of the Meta link behind the channel, performed at request time (the same read as GET /v1/whatsapp/number-info).
pub fn new() -> GetAccountHealth200ResponsePlatformConnection {
GetAccountHealth200ResponsePlatformConnection {
status: None,
checked_at: None,
phone_status: None,
meta_error: None,
inbound_webhook_subscribed: None,
}
}
}
/// `connected` = Meta served the channel object. `disconnected` = Meta refused to serve it (Graph error 100, subcode 33), which is how a phone-side coexistence disconnect surfaces. `unknown` = the live read failed for another reason (timeout, transient Meta error), not evidence either way.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "connected")]
Connected,
#[serde(rename = "disconnected")]
Disconnected,
#[serde(rename = "unknown")]
Unknown,
}
impl Default for Status {
fn default() -> Status {
Self::Connected
}
}