Skip to main content

late/models/
webhook_payload_call_failed.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/// WebhookPayloadCallFailed : Webhook payload for the `call.failed` event. Fired when a call setup or in-progress call fails.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhookPayloadCallFailed {
17    #[serde(rename = "id")]
18    pub id: String,
19    #[serde(rename = "event")]
20    pub event: Event,
21    #[serde(rename = "call")]
22    pub call: Box<models::WebhookPayloadCallFailedCall>,
23    #[serde(rename = "account")]
24    pub account: Box<models::InboxWebhookAccount>,
25    #[serde(rename = "timestamp")]
26    pub timestamp: String,
27}
28
29impl WebhookPayloadCallFailed {
30    /// Webhook payload for the `call.failed` event. Fired when a call setup or in-progress call fails.
31    pub fn new(
32        id: String,
33        event: Event,
34        call: models::WebhookPayloadCallFailedCall,
35        account: models::InboxWebhookAccount,
36        timestamp: String,
37    ) -> WebhookPayloadCallFailed {
38        WebhookPayloadCallFailed {
39            id,
40            event,
41            call: Box::new(call),
42            account: Box::new(account),
43            timestamp,
44        }
45    }
46}
47///
48#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
49pub enum Event {
50    #[serde(rename = "call.failed")]
51    CallFailed,
52}
53
54impl Default for Event {
55    fn default() -> Event {
56        Self::CallFailed
57    }
58}