Skip to main content

ghl_models/v2/
medias.rs

1// @generated by xtask/generate_models.py — do not edit by hand.
2// Source: https://github.com/GoHighLevel/highlevel-api-docs
3// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
4// they aren't held to rustdoc's markdown conventions.
5#![allow(
6    missing_docs,
7    clippy::doc_lazy_continuation,
8    clippy::doc_overindented_list_items
9)]
10
11use serde::{Deserialize, Serialize};
12
13/// `CreateFolderParams` from the GoHighLevel OpenAPI spec.
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct CreateFolderParams {
16    /// Location Id
17    /// Required by the API.
18    #[serde(rename = "altId")]
19    pub alt_id: String,
20    /// Type of entity (location only)
21    /// Allowed values: `location`.
22    /// Required by the API.
23    #[serde(rename = "altType")]
24    pub alt_type: String,
25    /// Name of the folder to be created
26    /// Required by the API.
27    pub name: String,
28    /// ID of the parent folder (optional)
29    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
30    pub parent_id: Option<String>,
31}
32
33/// `DeleteMediaObjectItem` from the GoHighLevel OpenAPI spec.
34#[derive(Debug, Clone, Default, Serialize, Deserialize)]
35pub struct DeleteMediaObjectItem {
36    /// Unique identifier of the file or folder to be deleted
37    /// Required by the API.
38    #[serde(rename = "_id")]
39    pub id: String,
40}
41
42/// `DeleteMediaObjectsBodyParams` from the GoHighLevel OpenAPI spec.
43#[derive(Debug, Clone, Default, Serialize, Deserialize)]
44pub struct DeleteMediaObjectsBodyParams {
45    /// Array of file objects to be deleted or trashed
46    /// Required by the API.
47    #[serde(
48        rename = "filesToBeDeleted",
49        default,
50        skip_serializing_if = "Vec::is_empty"
51    )]
52    pub files_to_be_deleted: Vec<DeleteMediaObjectItem>,
53    /// Type of entity that owns the files
54    /// Allowed values: `location`.
55    /// Required by the API.
56    #[serde(rename = "altType")]
57    pub alt_type: String,
58    /// Location identifier
59    /// Required by the API.
60    #[serde(rename = "altId")]
61    pub alt_id: String,
62    /// Status to set for the files (deleted or trashed)
63    /// Allowed values: `deleted`, `trashed`.
64    /// Required by the API.
65    pub status: String,
66}
67
68/// `FolderDTO` from the GoHighLevel OpenAPI spec.
69#[derive(Debug, Clone, Default, Serialize, Deserialize)]
70pub struct FolderDTO {
71    /// Location identifier that owns this folder
72    /// Required by the API.
73    #[serde(rename = "altId")]
74    pub alt_id: String,
75    /// Type of entity that owns the folder
76    /// Allowed values: `location`.
77    /// Required by the API.
78    #[serde(rename = "altType")]
79    pub alt_type: String,
80    /// Name of the folder
81    /// Required by the API.
82    pub name: String,
83    /// ID of the parent folder (null for root folders)
84    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
85    pub parent_id: Option<String>,
86    /// Type of the object (always 'folder' for folders)
87    /// Required by the API.
88    #[serde(rename = "type")]
89    pub type_: String,
90    /// Whether the folder has been deleted
91    #[serde(default, skip_serializing_if = "Option::is_none")]
92    pub deleted: Option<bool>,
93    /// Whether there are pending uploads to this folder
94    #[serde(
95        rename = "pendingUpload",
96        default,
97        skip_serializing_if = "Option::is_none"
98    )]
99    pub pending_upload: Option<bool>,
100    /// Primary category of content stored in the folder
101    #[serde(default, skip_serializing_if = "Option::is_none")]
102    pub category: Option<String>,
103    /// Sub-category of content stored in the folder
104    #[serde(
105        rename = "subCategory",
106        default,
107        skip_serializing_if = "Option::is_none"
108    )]
109    pub sub_category: Option<String>,
110    /// Whether the folder is private and not publicly accessible
111    #[serde(rename = "isPrivate", default, skip_serializing_if = "Option::is_none")]
112    pub is_private: Option<bool>,
113    /// Whether the folder has been moved from its original location
114    #[serde(
115        rename = "relocatedFolder",
116        default,
117        skip_serializing_if = "Option::is_none"
118    )]
119    pub relocated_folder: Option<bool>,
120    /// Whether the data migration process has been completed for this folder
121    #[serde(
122        rename = "migrationCompleted",
123        default,
124        skip_serializing_if = "Option::is_none"
125    )]
126    pub migration_completed: Option<bool>,
127    /// Whether this is a system-generated application folder
128    #[serde(rename = "appFolder", default, skip_serializing_if = "Option::is_none")]
129    pub app_folder: Option<bool>,
130    /// Whether the folder is essential and should not be deleted
131    #[serde(
132        rename = "isEssential",
133        default,
134        skip_serializing_if = "Option::is_none"
135    )]
136    pub is_essential: Option<bool>,
137    /// Current status of the folder
138    #[serde(default, skip_serializing_if = "Option::is_none")]
139    pub status: Option<String>,
140    /// ID of the user who last updated the folder
141    #[serde(
142        rename = "lastUpdatedBy",
143        default,
144        skip_serializing_if = "Option::is_none"
145    )]
146    pub last_updated_by: Option<String>,
147}
148
149/// `GetFilesResponseDTO` from the GoHighLevel OpenAPI spec.
150#[derive(Debug, Clone, Default, Serialize, Deserialize)]
151pub struct GetFilesResponseDTO {
152    /// Array of File Objects
153    /// Required by the API.
154    #[serde(default, skip_serializing_if = "Vec::is_empty")]
155    pub files: Vec<String>,
156}
157
158/// `MoveOrDeleteObjectParams` from the GoHighLevel OpenAPI spec.
159#[derive(Debug, Clone, Default, Serialize, Deserialize)]
160pub struct MoveOrDeleteObjectParams {
161    /// Required by the API.
162    #[serde(rename = "altType")]
163    pub alt_type: String,
164    /// Required by the API.
165    #[serde(rename = "altId")]
166    pub alt_id: String,
167    /// Required by the API.
168    #[serde(rename = "_id")]
169    pub id: String,
170}
171
172/// `UpdateMediaObject` from the GoHighLevel OpenAPI spec.
173#[derive(Debug, Clone, Default, Serialize, Deserialize)]
174pub struct UpdateMediaObject {
175    /// Unique identifier of the file or folder to be updated
176    /// Required by the API.
177    pub id: String,
178    /// New name for the file or folder
179    #[serde(default, skip_serializing_if = "Option::is_none")]
180    pub name: Option<String>,
181}
182
183/// `UpdateMediaObjects` from the GoHighLevel OpenAPI spec.
184#[derive(Debug, Clone, Default, Serialize, Deserialize)]
185pub struct UpdateMediaObjects {
186    /// Location identifier
187    /// Required by the API.
188    #[serde(rename = "altId")]
189    pub alt_id: String,
190    /// Type of entity that owns the files
191    /// Allowed values: `location`.
192    /// Required by the API.
193    #[serde(rename = "altType")]
194    pub alt_type: String,
195    /// Array of file objects to be updated
196    /// Required by the API.
197    #[serde(
198        rename = "filesToBeUpdated",
199        default,
200        skip_serializing_if = "Vec::is_empty"
201    )]
202    pub files_to_be_updated: Vec<UpdateMediaObject>,
203}
204
205/// `UpdateObject` from the GoHighLevel OpenAPI spec.
206#[derive(Debug, Clone, Default, Serialize, Deserialize)]
207pub struct UpdateObject {
208    /// New name for the file or folder
209    /// Required by the API.
210    pub name: String,
211    /// Type of entity that owns the file or folder
212    /// Allowed values: `location`.
213    /// Required by the API.
214    #[serde(rename = "altType")]
215    pub alt_type: String,
216    /// Location identifier that owns the file or folder
217    /// Required by the API.
218    #[serde(rename = "altId")]
219    pub alt_id: String,
220}
221
222/// `UploadFileResponseDTO` from the GoHighLevel OpenAPI spec.
223#[derive(Debug, Clone, Default, Serialize, Deserialize)]
224pub struct UploadFileResponseDTO {
225    /// ID of the uploaded file
226    /// Required by the API.
227    #[serde(rename = "fileId")]
228    pub file_id: String,
229    /// Google Cloud Storage URL of the uploaded file
230    /// Required by the API.
231    pub url: String,
232}