/*
 * 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.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// WebhookPayloadReviewNew : Webhook payload for the review.new event (new review posted on a connected account).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadReviewNew {
    /// Stable webhook event ID
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "event")]
    pub event: Event,
    #[serde(rename = "review")]
    pub review: Box<models::ReviewWebhookReview>,
    #[serde(rename = "account")]
    pub account: Box<models::WebhookPayloadReviewNewAccount>,
    #[serde(rename = "timestamp")]
    pub timestamp: String,
}

impl WebhookPayloadReviewNew {
    /// Webhook payload for the review.new event (new review posted on a connected account).
    pub fn new(
        id: String,
        event: Event,
        review: models::ReviewWebhookReview,
        account: models::WebhookPayloadReviewNewAccount,
        timestamp: String,
    ) -> WebhookPayloadReviewNew {
        WebhookPayloadReviewNew {
            id,
            event,
            review: Box::new(review),
            account: Box::new(account),
            timestamp,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Event {
    #[serde(rename = "review.new")]
    ReviewNew,
}

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