late 0.0.1112

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

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadWhatsAppAccountQualityUpdatedQuality {
    /// The Meta webhook field that reported the change.
    #[serde(rename = "source")]
    pub source: Source,
    /// Meta's `event` on phone_number_quality_update (for example FLAGGED, UNFLAGGED, UPGRADE, DOWNGRADE, ONBOARDING, THROUGHPUT_UPGRADE). Null on business_capability_update.
    #[serde(rename = "metaEvent", deserialize_with = "Option::deserialize")]
    pub meta_event: Option<String>,
    /// Current quality rating (GREEN, YELLOW, RED, UNKNOWN), read live from Meta on FLAGGED/UNFLAGGED.
    #[serde(rename = "qualityRating", deserialize_with = "Option::deserialize")]
    pub quality_rating: Option<String>,
    #[serde(
        rename = "previousQualityRating",
        deserialize_with = "Option::deserialize"
    )]
    pub previous_quality_rating: Option<String>,
    /// Current messaging limit tier, for example TIER_250, TIER_2K, TIER_10K, TIER_100K, TIER_UNLIMITED.
    #[serde(
        rename = "messagingLimitTier",
        deserialize_with = "Option::deserialize"
    )]
    pub messaging_limit_tier: Option<String>,
    #[serde(
        rename = "previousMessagingLimitTier",
        deserialize_with = "Option::deserialize"
    )]
    pub previous_messaging_limit_tier: Option<String>,
    #[serde(
        rename = "displayPhoneNumber",
        deserialize_with = "Option::deserialize"
    )]
    pub display_phone_number: Option<String>,
}

impl WebhookPayloadWhatsAppAccountQualityUpdatedQuality {
    pub fn new(
        source: Source,
        meta_event: Option<String>,
        quality_rating: Option<String>,
        previous_quality_rating: Option<String>,
        messaging_limit_tier: Option<String>,
        previous_messaging_limit_tier: Option<String>,
        display_phone_number: Option<String>,
    ) -> WebhookPayloadWhatsAppAccountQualityUpdatedQuality {
        WebhookPayloadWhatsAppAccountQualityUpdatedQuality {
            source,
            meta_event,
            quality_rating,
            previous_quality_rating,
            messaging_limit_tier,
            previous_messaging_limit_tier,
            display_phone_number,
        }
    }
}
/// The Meta webhook field that reported the change.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
    #[serde(rename = "phone_number_quality_update")]
    PhoneNumberQualityUpdate,
    #[serde(rename = "business_capability_update")]
    BusinessCapabilityUpdate,
}

impl Default for Source {
    fn default() -> Source {
        Self::PhoneNumberQualityUpdate
    }
}