/*
* 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).
*
* The version of the OpenAPI document: 1.15.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// InboxWebhookConversation : The conversation context included in inbox webhook payloads.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InboxWebhookConversation {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "platformConversationId")]
pub platform_conversation_id: String,
#[serde(rename = "participantId", skip_serializing_if = "Option::is_none")]
pub participant_id: Option<String>,
#[serde(rename = "participantName", skip_serializing_if = "Option::is_none")]
pub participant_name: Option<String>,
#[serde(
rename = "participantUsername",
skip_serializing_if = "Option::is_none"
)]
pub participant_username: Option<String>,
#[serde(rename = "participantPicture", skip_serializing_if = "Option::is_none")]
pub participant_picture: Option<String>,
#[serde(rename = "status")]
pub status: Status,
/// Zernio CRM Contact ID for the participant, when one exists. Resolved by joining `participantId` to the ContactChannel collection. Best-effort: omitted when no channel matches or `participantId` is absent. Lets integrators join any inbox webhook back to the CRM Contact without needing to look at the sender, which matters for outgoing and delivery-status events whose sender is the business.
#[serde(rename = "contactId", skip_serializing_if = "Option::is_none")]
pub contact_id: Option<String>,
}
impl InboxWebhookConversation {
/// The conversation context included in inbox webhook payloads.
pub fn new(
id: String,
platform_conversation_id: String,
status: Status,
) -> InboxWebhookConversation {
InboxWebhookConversation {
id,
platform_conversation_id,
participant_id: None,
participant_name: None,
participant_username: None,
participant_picture: None,
status,
contact_id: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "active")]
Active,
#[serde(rename = "archived")]
Archived,
}
impl Default for Status {
fn default() -> Status {
Self::Active
}
}