late 0.0.1055

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.
Documentation
/*
 * 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};

/// InboxWebhookConversation : The conversation context included in inbox webhook payloads.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InboxWebhookConversation {
    /// Zernio's internal conversation id (also the message's conversationId). Accepted by every /v1/inbox/conversations/{conversationId} endpoint.
    #[serde(rename = "id")]
    pub id: String,
    /// The platform's conversation id. This is the `id` GET /v1/inbox/conversations returns for the same conversation (on Instagram and Messenger it is the participant's IGSID / PSID), so key your records on it to match webhooks with list rows. Also accepted by the conversation endpoints.
    #[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
    }
}