windmill-api 1.730.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.730.0
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ListDrafts200ResponseInner {
    #[serde(rename = "kind")]
    pub kind: models::UserDraftItemKind,
    #[serde(rename = "path")]
    pub path: String,
    /// Best-effort, read from the draft JSON's `summary` field when the editor shape carries one.
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<String>,
    /// 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}`).
    #[serde(rename = "draft_path", skip_serializing_if = "Option::is_none")]
    pub draft_path: Option<String>,
    /// No deployed counterpart exists at this path — the draft is the whole item.
    #[serde(rename = "draft_only")]
    pub draft_only: bool,
    /// 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.
    #[serde(rename = "legacy_draft")]
    pub legacy_draft: bool,
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// Whether the current user may deploy/discard this draft (same check the deploy/discard endpoints enforce).
    #[serde(rename = "can_write")]
    pub can_write: bool,
    /// The row belongs to the current user (own draft or the legacy no-owner row) and is therefore actionable. Always true in the default listing; with `all_users=true`, other users' rows are false (view-only).
    #[serde(rename = "mine")]
    pub mine: bool,
    /// Draft authors at this (path, kind) — the legacy NULL-email row surfaced as a null username. Populated only for the shared full-page-editor kinds (script/flow/app/raw_app); omitted for drawer kinds, which keep their drafts private. Feeds the Draft badge's owner-avatar circles. 
    #[serde(rename = "draft_users", skip_serializing_if = "Option::is_none")]
    pub draft_users: Option<Vec<models::ListScripts200ResponseInnerAllOfDraftUsersInner>>,
}

impl ListDrafts200ResponseInner {
    pub fn new(kind: models::UserDraftItemKind, path: String, draft_only: bool, legacy_draft: bool, created_at: String, can_write: bool, mine: bool) -> ListDrafts200ResponseInner {
        ListDrafts200ResponseInner {
            kind,
            path,
            summary: None,
            draft_path: None,
            draft_only,
            legacy_draft,
            created_at,
            can_write,
            mine,
            draft_users: None,
        }
    }
}