/*
* 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.108.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// BusinessAgentStatus : Where the merchant is in the Meta Business Agent setup for this number.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BusinessAgentStatus {
/// Whether the number can run the agent; null when the terms are not accepted yet (Meta refuses the check).
#[serde(rename = "eligible", deserialize_with = "Option::deserialize")]
pub eligible: Option<bool>,
/// False when Meta rejects calls because the merchant has not accepted the terms in WhatsApp Manager.
#[serde(rename = "termsAccepted")]
pub terms_accepted: bool,
/// An agent exists on the number (onboard was called).
#[serde(rename = "onboarded")]
pub onboarded: bool,
/// The agent answers live conversations.
#[serde(rename = "enabled")]
pub enabled: bool,
#[serde(rename = "agentId", deserialize_with = "Option::deserialize")]
pub agent_id: Option<String>,
#[serde(rename = "settings", deserialize_with = "Option::deserialize")]
pub settings: Option<Box<models::BusinessAgentSettings>>,
/// Steps Meta keeps outside the API that Zernio can verify are still pending.
#[serde(rename = "manualSteps")]
pub manual_steps: Vec<models::BusinessAgentStatusManualStepsInner>,
/// Steps Meta keeps outside the API and exposes no state for, listed once an agent exists. Informational: Zernio cannot tell whether the merchant already did them.
#[serde(rename = "unverifiedSteps")]
pub unverified_steps: Vec<models::BusinessAgentStatusUnverifiedStepsInner>,
}
impl BusinessAgentStatus {
/// Where the merchant is in the Meta Business Agent setup for this number.
pub fn new(
eligible: Option<bool>,
terms_accepted: bool,
onboarded: bool,
enabled: bool,
agent_id: Option<String>,
settings: Option<models::BusinessAgentSettings>,
manual_steps: Vec<models::BusinessAgentStatusManualStepsInner>,
unverified_steps: Vec<models::BusinessAgentStatusUnverifiedStepsInner>,
) -> BusinessAgentStatus {
BusinessAgentStatus {
eligible,
terms_accepted,
onboarded,
enabled,
agent_id,
settings: if let Some(x) = settings {
Some(Box::new(x))
} else {
None
},
manual_steps,
unverified_steps,
}
}
}