Skip to main content

windmill_api/models/
list_drafts_200_response_inner.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.726.1
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ListDrafts200ResponseInner {
16    #[serde(rename = "kind")]
17    pub kind: models::UserDraftItemKind,
18    #[serde(rename = "path")]
19    pub path: String,
20    /// Best-effort, read from the draft JSON's `summary` field when the editor shape carries one.
21    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
22    pub summary: Option<String>,
23    /// User-typed friendly path from the draft JSON's `draft_path`, when set and different from the storage path (e.g. a never-deployed item parked at `u/{user}/draft_{uuid}`).
24    #[serde(rename = "draft_path", skip_serializing_if = "Option::is_none")]
25    pub draft_path: Option<String>,
26    /// No deployed counterpart exists at this path — the draft is the whole item.
27    #[serde(rename = "draft_only")]
28    pub draft_only: bool,
29    /// The listed draft is a legacy workspace-level row (email NULL) predating the per-user drafts migration. Only true when no per-user draft exists at this path.
30    #[serde(rename = "legacy_draft")]
31    pub legacy_draft: bool,
32    #[serde(rename = "created_at")]
33    pub created_at: String,
34}
35
36impl ListDrafts200ResponseInner {
37    pub fn new(kind: models::UserDraftItemKind, path: String, draft_only: bool, legacy_draft: bool, created_at: String) -> ListDrafts200ResponseInner {
38        ListDrafts200ResponseInner {
39            kind,
40            path,
41            summary: None,
42            draft_path: None,
43            draft_only,
44            legacy_draft,
45            created_at,
46        }
47    }
48}
49