#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CreateChecklistRequest {
    #[builder(into)]
    #[serde(rename = "commitMessage")]
    commit_message: String,
    #[serde(rename = "assigneeRid")]
    assignee_rid: super::super::super::rids::api::UserRid,
    #[builder(into)]
    #[serde(rename = "title")]
    title: String,
    #[builder(into)]
    #[serde(rename = "description")]
    description: String,
    #[builder(default, list(item(type = super::CreateChecklistEntryRequest)))]
    #[serde(rename = "checks", skip_serializing_if = "Vec::is_empty", default)]
    checks: Vec<super::CreateChecklistEntryRequest>,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "properties",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    properties: std::collections::BTreeMap<String, String>,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "labels",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    labels: std::collections::BTreeSet<String>,
    #[builder(default, list(item(type = super::UnresolvedChecklistVariable)))]
    #[serde(
        rename = "checklistVariables",
        skip_serializing_if = "Vec::is_empty",
        default
    )]
    checklist_variables: Vec<super::UnresolvedChecklistVariable>,
    #[builder(default, into)]
    #[serde(rename = "isPublished", skip_serializing_if = "Option::is_none", default)]
    is_published: Option<bool>,
    #[builder(default, into)]
    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
    workspace: Option<conjure_object::ResourceIdentifier>,
}
impl CreateChecklistRequest {
    #[inline]
    pub fn commit_message(&self) -> &str {
        &*self.commit_message
    }
    #[inline]
    pub fn assignee_rid(&self) -> &super::super::super::rids::api::UserRid {
        &self.assignee_rid
    }
    #[inline]
    pub fn title(&self) -> &str {
        &*self.title
    }
    #[inline]
    pub fn description(&self) -> &str {
        &*self.description
    }
    #[inline]
    pub fn checks(&self) -> &[super::CreateChecklistEntryRequest] {
        &*self.checks
    }
    #[inline]
    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
        &self.properties
    }
    #[inline]
    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
        &self.labels
    }
    /// Variables that can be used in checks. Variables are resolved in order of declaration.
    /// If variable `a` depends on variable `b`, then `b` must be defined before `a` in the list.
    #[inline]
    pub fn checklist_variables(&self) -> &[super::UnresolvedChecklistVariable] {
        &*self.checklist_variables
    }
    /// Default value is true.
    #[inline]
    pub fn is_published(&self) -> Option<bool> {
        self.is_published.as_ref().map(|o| *o)
    }
    /// The workspace in which to create the checklist. If not provided, the checklist will be created in the default workspace for
    /// the user's organization, if the default workspace for the organization is configured.
    #[inline]
    pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.workspace.as_ref().map(|o| &*o)
    }
}
