ghl-models 0.5.2

Rust data models (DTOs) for the GoHighLevel (HighLevel) API v2 and v3, generated from the official OpenAPI specifications
Documentation
//! `email-isv` data models for GoHighLevel API V3 (4 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Email Isv** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`email-isv` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/email-isv.md).
//!
//! Enable with `features = ["email-isv"]`.
// @generated by xtask/generate_models.py — do not edit by hand.
// Source: https://github.com/GoHighLevel/highlevel-api-docs
// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
// they aren't held to rustdoc's markdown conventions.
#![allow(
    missing_docs,
    clippy::doc_lazy_continuation,
    clippy::doc_overindented_list_items
)]

use serde::{Deserialize, Serialize};

/// `EmailNotVerifiedResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct EmailNotVerifiedResponseDto {
    /// Email verification not processed
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub verified: Option<bool>,
    /// Email verification failure message
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// Email address
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub address: Option<String>,
}

/// `EmailVerifiedV3ResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct EmailVerifiedV3ResponseDto {
    /// Reason for email verification failure
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub reason: Vec<String>,
    /// Email verification result
    /// Allowed values: `deliverable`, `undeliverable`, `do_not_send`, `unknown`, `catch_all`.
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub result: Option<String>,
    /// Risk level of email sending to bounce
    /// Allowed values: `high`, `low`, `medium`, `unknown`.
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub risk: Option<String>,
    /// Email address
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub address: Option<String>,
    /// Lead Connector email verification recommendation
    #[serde(
        rename = "leadConnectorRecommendation",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub lead_connector_recommendation: Option<LeadConnectorRecommendationDto>,
}

/// `LeadConnectorRecommendationDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct LeadConnectorRecommendationDto {
    /// Email verification status
    #[serde(
        rename = "isEmailValid",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub is_email_valid: Option<bool>,
}

/// `VerificationBodyDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct VerificationBodyDto {
    /// Email Verification type
    /// Allowed values: `email`, `contact`.
    /// Required by the API.
    #[serde(rename = "type")]
    pub type_: String,
    /// Email Verification recepient (email address / contactId)
    /// Required by the API.
    pub verify: String,
}