ghl-models 0.5.2

Rust data models (DTOs) for the GoHighLevel (HighLevel) API v2 and v3, generated from the official OpenAPI specifications
Documentation
//! `snapshots` data models for GoHighLevel API V3 (8 types).
//!
//! Generated from HighLevel's official OpenAPI spec for the
//! **Snapshots** module. Every endpoint that uses these types, with its
//! parameters, required scopes and enum values, is documented in the
//! [`snapshots` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/snapshots.md).
//!
//! Enable with `features = ["snapshots"]`.
// @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};

/// `CreateSnapshotShareLinkRequestDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateSnapshotShareLinkRequestDTO {
    /// id for snapshot to be shared
    /// Required by the API.
    pub snapshot_id: String,
    /// Type of share link to generate
    /// Allowed values: `link`, `permanent_link`, `agency_link`, `location_link`.
    /// Required by the API.
    pub share_type: String,
    /// Comma separated Relationship number of Agencies to create agency restricted share link
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub relationship_number: Option<String>,
    /// Comma separated Sub-Account ids to create sub-account restricted share link
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub share_location_id: Option<String>,
}

/// `CreateSnapshotShareLinkSuccessfulResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateSnapshotShareLinkSuccessfulResponseDTO {
    /// id for shared snapshot
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Share Link for snapshot
    #[serde(rename = "shareLink", default, skip_serializing_if = "Option::is_none")]
    pub share_link: Option<String>,
}

/// `GetLatestSnapshotPushStatusSuccessfulResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetLatestSnapshotPushStatusSuccessfulResponseDTO {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<SnapshotStatusSchemaWithAssets>,
}

/// `GetSnapshotPushStatusSuccessfulResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetSnapshotPushStatusSuccessfulResponseDTO {
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub data: Vec<SnapshotStatusSchema>,
}

/// `GetSnapshotsSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetSnapshotsSuccessfulResponseDto {
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub snapshots: Vec<SnapshotsSchema>,
}

/// `SnapshotStatusSchema` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct SnapshotStatusSchema {
    /// Document id
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Sub-account id
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Status of snapshot push
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Timestamp of when snapshot processing starts for sub-account
    /// Format: date-time (ISO-8601 string).
    #[serde(rename = "dateAdded", default, skip_serializing_if = "Option::is_none")]
    pub date_added: Option<String>,
}

/// `SnapshotStatusSchemaWithAssets` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct SnapshotStatusSchemaWithAssets {
    /// Document id
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Sub-account id
    #[serde(
        rename = "locationId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub location_id: Option<String>,
    /// Status of snapshot push
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// List of completed assets
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub completed: Vec<String>,
    /// List of pending assets
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub pending: Vec<String>,
}

/// `SnapshotsSchema` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct SnapshotsSchema {
    /// Snapshot Id.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Name of the snapshot
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Type of snapshot - own or imported.
    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
    pub type_: Option<String>,
}