Skip to main content

late/models/
webhook_payload_call_received_call.rs

1/*
2 * Zernio API
3 *
4 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5 *
6 * The version of the OpenAPI document: 1.0.4
7 * Contact: support@zernio.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhookPayloadCallReceivedCall {
16    /// Internal Zernio Call doc id
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<String>,
19    /// Meta wacid.* call id when known
20    #[serde(
21        rename = "metaCallId",
22        default,
23        with = "::serde_with::rust::double_option",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub meta_call_id: Option<Option<String>>,
27    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
28    pub account_id: Option<String>,
29    /// Meta phone_number_id
30    #[serde(rename = "phoneNumberId", skip_serializing_if = "Option::is_none")]
31    pub phone_number_id: Option<String>,
32    #[serde(rename = "direction", skip_serializing_if = "Option::is_none")]
33    pub direction: Option<Direction>,
34    /// Consumer wa_id / E.164
35    #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
36    pub from: Option<String>,
37    /// Business number (E.164)
38    #[serde(rename = "to", skip_serializing_if = "Option::is_none")]
39    pub to: Option<String>,
40    /// Destination snapshot at routing time
41    #[serde(rename = "forwardTo", skip_serializing_if = "Option::is_none")]
42    pub forward_to: Option<String>,
43    #[serde(rename = "contactId", skip_serializing_if = "Option::is_none")]
44    pub contact_id: Option<String>,
45    #[serde(rename = "conversationId", skip_serializing_if = "Option::is_none")]
46    pub conversation_id: Option<String>,
47    #[serde(rename = "startedAt", skip_serializing_if = "Option::is_none")]
48    pub started_at: Option<String>,
49}
50
51impl WebhookPayloadCallReceivedCall {
52    pub fn new() -> WebhookPayloadCallReceivedCall {
53        WebhookPayloadCallReceivedCall {
54            id: None,
55            meta_call_id: None,
56            account_id: None,
57            phone_number_id: None,
58            direction: None,
59            from: None,
60            to: None,
61            forward_to: None,
62            contact_id: None,
63            conversation_id: None,
64            started_at: None,
65        }
66    }
67}
68///
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum Direction {
71    #[serde(rename = "inbound")]
72    Inbound,
73    #[serde(rename = "outbound")]
74    Outbound,
75}
76
77impl Default for Direction {
78    fn default() -> Direction {
79        Self::Inbound
80    }
81}