// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// A workflow and its current configuration.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Workflow {
    /// Unique ID for this workflow
    pub id: String,
    /// The name of the workflow
    ///
    /// Defaults to `Untitled Workflow`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub name: Option<String>,
    /// Description of the workflow
    ///
    /// Defaults to ``.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub description: Option<String>,
    /// Project that owns this workflow. Null only on legacy rows that predate the project backfill.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub project_id: Option<String>,
    /// Published workflow metadata when a published version exists
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub published: Option<WorkflowPublished>,
    pub created_at: String,
    pub updated_at: String,
    /// Server-derived permissions for the current actor.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub capabilities: Option<Vec<WorkflowCapabilities>>,
    /// Provisioning state of this workflow's WorkOS authorization resource.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub authz_status: Option<WorkflowAuthzStatus>,
}
impl Workflow {
    /// Construct a new `Workflow` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        id: impl Into<String>,
        created_at: impl Into<String>,
        updated_at: impl Into<String>,
    ) -> Self {
        Self {
            id: id.into(),
            name: Default::default(),
            description: Default::default(),
            project_id: Default::default(),
            published: Default::default(),
            created_at: created_at.into(),
            updated_at: updated_at.into(),
            capabilities: Default::default(),
            authz_status: Default::default(),
        }
    }
}
