/*
* 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.563.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 GetAccountHealth200Response {
#[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
/// TikTok only. The TikTok integration the account is connected through: business (TikTok for Business, Accounts API) or developer (the original integration). Absent on other platforms.
#[serde(rename = "integrationLane", skip_serializing_if = "Option::is_none")]
pub integration_lane: Option<IntegrationLane>,
#[serde(rename = "sendCap", skip_serializing_if = "Option::is_none")]
pub send_cap: Option<Box<models::GetAccountHealth200ResponseSendCap>>,
/// Google and Microsoft only: state of the provider change-notification subscriptions behind `message.received` and `calendar.event.*`. `pending` means a granted area has no live subscription yet (retried every 6 hours), `failed` that renewals keep failing (reconnect the account).
#[serde(rename = "push", skip_serializing_if = "Option::is_none")]
pub push: Option<Push>,
#[serde(rename = "username", skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
#[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
/// Overall health status
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
#[serde(rename = "tokenStatus", skip_serializing_if = "Option::is_none")]
pub token_status: Option<Box<models::GetAccountHealth200ResponseTokenStatus>>,
#[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
pub permissions: Option<Box<models::GetAccountHealth200ResponsePermissions>>,
/// List of issues found
#[serde(rename = "issues", skip_serializing_if = "Option::is_none")]
pub issues: Option<Vec<String>>,
/// Actionable recommendations to fix issues
#[serde(rename = "recommendations", skip_serializing_if = "Option::is_none")]
pub recommendations: Option<Vec<String>>,
/// User id of the profile owner, not necessarily the team member who connected the account.
#[serde(rename = "ownerUserId", skip_serializing_if = "Option::is_none")]
pub owner_user_id: Option<String>,
/// Why the connection is broken or its token refresh is failing, from the most recent current cause. Null when the connection is healthy, including when the account is unhealthy for another reason (analytics, messaging restriction, missing analytics scopes, Meta phone status), or when no cause is stored.
#[serde(
rename = "disconnectReason",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub disconnect_reason: Option<Option<String>>,
/// intentional: deliberately disconnected by the user or by Zernio (for example a plan downgrade), not a token failure. unintentional: token expired or revoked, or an auth failure. Null when disconnectReason is null.
#[serde(
rename = "disconnectionType",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub disconnection_type: Option<Option<DisconnectionType>>,
/// When the earliest current stored cause was recorded (the start of the outage); for an intentional disconnect, when it was disconnected. Null when the connection is healthy, including when the account is unhealthy for another reason (analytics, messaging restriction, missing analytics scopes, Meta phone status), or when unknown.
#[serde(
rename = "unhealthySince",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub unhealthy_since: Option<Option<String>>,
#[serde(rename = "analyticsSync", skip_serializing_if = "Option::is_none")]
pub analytics_sync:
Option<Box<models::GetAllAccountsHealth200ResponseAccountsInnerAnalyticsSync>>,
#[serde(
rename = "inboundActivity",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub inbound_activity: Option<Option<Box<models::InboundActivity>>>,
#[serde(
rename = "messagingRestriction",
skip_serializing_if = "Option::is_none"
)]
pub messaging_restriction: Option<Box<models::GetAccountHealth200ResponseMessagingRestriction>>,
#[serde(rename = "platformConnection", skip_serializing_if = "Option::is_none")]
pub platform_connection: Option<Box<models::GetAccountHealth200ResponsePlatformConnection>>,
}
impl GetAccountHealth200Response {
pub fn new() -> GetAccountHealth200Response {
GetAccountHealth200Response {
account_id: None,
platform: None,
integration_lane: None,
send_cap: None,
push: None,
username: None,
display_name: None,
status: None,
token_status: None,
permissions: None,
issues: None,
recommendations: None,
owner_user_id: None,
disconnect_reason: None,
disconnection_type: None,
unhealthy_since: None,
analytics_sync: None,
inbound_activity: None,
messaging_restriction: None,
platform_connection: None,
}
}
}
/// TikTok only. The TikTok integration the account is connected through: business (TikTok for Business, Accounts API) or developer (the original integration). Absent on other platforms.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum IntegrationLane {
#[serde(rename = "business")]
Business,
#[serde(rename = "developer")]
Developer,
}
impl Default for IntegrationLane {
fn default() -> IntegrationLane {
Self::Business
}
}
/// Google and Microsoft only: state of the provider change-notification subscriptions behind `message.received` and `calendar.event.*`. `pending` means a granted area has no live subscription yet (retried every 6 hours), `failed` that renewals keep failing (reconnect the account).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Push {
#[serde(rename = "active")]
Active,
#[serde(rename = "pending")]
Pending,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "not_applicable")]
NotApplicable,
}
impl Default for Push {
fn default() -> Push {
Self::Active
}
}
/// Overall health status
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "healthy")]
Healthy,
#[serde(rename = "warning")]
Warning,
#[serde(rename = "error")]
Error,
}
impl Default for Status {
fn default() -> Status {
Self::Healthy
}
}
/// intentional: deliberately disconnected by the user or by Zernio (for example a plan downgrade), not a token failure. unintentional: token expired or revoked, or an auth failure. Null when disconnectReason is null.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DisconnectionType {
#[serde(rename = "intentional")]
Intentional,
#[serde(rename = "unintentional")]
Unintentional,
}
impl Default for DisconnectionType {
fn default() -> DisconnectionType {
Self::Intentional
}
}