ghl-models 0.5.2

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

/// `CreateFolderParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateFolderParams {
    /// Location Id
    /// Required by the API.
    #[serde(rename = "altId")]
    pub alt_id: String,
    /// Type of entity (location only)
    /// Allowed values: `location`.
    /// Required by the API.
    #[serde(rename = "altType")]
    pub alt_type: String,
    /// Name of the folder to be created
    /// Required by the API.
    pub name: String,
    /// ID of the parent folder (optional)
    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
    pub parent_id: Option<String>,
}

/// `DeleteMediaObjectItem` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteMediaObjectItem {
    /// Unique identifier of the file or folder to be deleted
    /// Required by the API.
    #[serde(rename = "_id")]
    pub id: String,
}

/// `DeleteMediaObjectsBodyParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteMediaObjectsBodyParams {
    /// Array of file objects to be deleted or trashed
    /// Required by the API.
    #[serde(
        rename = "filesToBeDeleted",
        default,
        skip_serializing_if = "Vec::is_empty"
    )]
    pub files_to_be_deleted: Vec<DeleteMediaObjectItem>,
    /// Type of entity that owns the files
    /// Allowed values: `location`.
    /// Required by the API.
    #[serde(rename = "altType")]
    pub alt_type: String,
    /// Location identifier
    /// Required by the API.
    #[serde(rename = "altId")]
    pub alt_id: String,
    /// Status to set for the files (deleted or trashed)
    /// Allowed values: `deleted`, `trashed`.
    /// Required by the API.
    pub status: String,
}

/// `FolderDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FolderDTO {
    /// Location identifier that owns this folder
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
    pub alt_id: Option<String>,
    /// Type of entity that owns the folder
    /// Allowed values: `location`.
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "altType", default, skip_serializing_if = "Option::is_none")]
    pub alt_type: Option<String>,
    /// Name of the folder
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// ID of the parent folder (null for root folders)
    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
    pub parent_id: Option<String>,
    /// Type of the object (always 'folder' for folders)
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
    pub type_: Option<String>,
    /// Whether the folder has been deleted
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub deleted: Option<bool>,
    /// Whether there are pending uploads to this folder
    #[serde(
        rename = "pendingUpload",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub pending_upload: Option<bool>,
    /// Primary category of content stored in the folder
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub category: Option<String>,
    /// Sub-category of content stored in the folder
    #[serde(
        rename = "subCategory",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub sub_category: Option<String>,
    /// Whether the folder is private and not publicly accessible
    #[serde(rename = "isPrivate", default, skip_serializing_if = "Option::is_none")]
    pub is_private: Option<bool>,
    /// Whether the folder has been moved from its original location
    #[serde(
        rename = "relocatedFolder",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub relocated_folder: Option<bool>,
    /// Whether the data migration process has been completed for this folder
    #[serde(
        rename = "migrationCompleted",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub migration_completed: Option<bool>,
    /// Whether this is a system-generated application folder
    #[serde(rename = "appFolder", default, skip_serializing_if = "Option::is_none")]
    pub app_folder: Option<bool>,
    /// Whether the folder is essential and should not be deleted
    #[serde(
        rename = "isEssential",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub is_essential: Option<bool>,
    /// Current status of the folder
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// ID of the user who last updated the folder
    #[serde(
        rename = "lastUpdatedBy",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub last_updated_by: Option<String>,
}

/// `GetFilesResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetFilesResponseDTO {
    /// Array of File Objects
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub files: Vec<String>,
}

/// `MoveOrDeleteObjectParams` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct MoveOrDeleteObjectParams {
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "altType", default, skip_serializing_if = "Option::is_none")]
    pub alt_type: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
    pub alt_id: Option<String>,
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
}

/// `UpdateMediaObject` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateMediaObject {
    /// Unique identifier of the file or folder to be updated
    /// Required by the API.
    pub id: String,
    /// New name for the file or folder
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// `UpdateMediaObjects` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateMediaObjects {
    /// Location identifier
    /// Required by the API.
    #[serde(rename = "altId")]
    pub alt_id: String,
    /// Type of entity that owns the files
    /// Allowed values: `location`.
    /// Required by the API.
    #[serde(rename = "altType")]
    pub alt_type: String,
    /// Array of file objects to be updated
    /// Required by the API.
    #[serde(
        rename = "filesToBeUpdated",
        default,
        skip_serializing_if = "Vec::is_empty"
    )]
    pub files_to_be_updated: Vec<UpdateMediaObject>,
}

/// `UpdateObject` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateObject {
    /// New name for the file or folder
    /// Required by the API.
    pub name: String,
    /// Type of entity that owns the file or folder
    /// Allowed values: `location`.
    /// Required by the API.
    #[serde(rename = "altType")]
    pub alt_type: String,
    /// Location identifier that owns the file or folder
    /// Required by the API.
    #[serde(rename = "altId")]
    pub alt_id: String,
}

/// `UploadFileResponseDTO` from the GoHighLevel OpenAPI spec.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UploadFileResponseDTO {
    /// ID of the uploaded file
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(rename = "fileId", default, skip_serializing_if = "Option::is_none")]
    pub file_id: Option<String>,
    /// Google Cloud Storage URL of the uploaded file
    /// Required by the API.
    /// (Optional here so responses that omit it still parse.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}