/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// WebhookPayloadAccountConnected : Webhook payload for account connected events
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadAccountConnected {
    /// Stable webhook event ID
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "event")]
    pub event: Event,
    #[serde(rename = "account")]
    pub account: Box<models::WebhookPayloadAccountConnectedAccount>,
    #[serde(rename = "timestamp")]
    pub timestamp: String,
}

impl WebhookPayloadAccountConnected {
    /// Webhook payload for account connected events
    pub fn new(
        id: String,
        event: Event,
        account: models::WebhookPayloadAccountConnectedAccount,
        timestamp: String,
    ) -> WebhookPayloadAccountConnected {
        WebhookPayloadAccountConnected {
            id,
            event,
            account: Box::new(account),
            timestamp,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Event {
    #[serde(rename = "account.connected")]
    AccountConnected,
}

impl Default for Event {
    fn default() -> Event {
        Self::AccountConnected
    }
}
