// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// A reusable edit template: an empty PDF and the `form_fields` defined on it.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EditTemplate {
    /// Unique identifier of the template.
    pub id: String,
    /// Name of the template.
    pub name: String,
    /// File information for the empty PDF template.
    pub file: FileRef,
    /// Form fields attached to the template.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub form_fields: Option<Vec<FormField>>,
    /// Number of form fields in the template.
    ///
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub field_count: Option<i64>,
    /// Timestamp of creation.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_at: Option<String>,
    /// Timestamp of last update.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub updated_at: Option<String>,
}
impl EditTemplate {
    /// Construct a new `EditTemplate` with the required fields set.
    #[allow(deprecated)]
    pub fn new(id: impl Into<String>, name: impl Into<String>, file: FileRef) -> Self {
        Self {
            id: id.into(),
            name: name.into(),
            file,
            form_fields: Default::default(),
            field_count: Default::default(),
            created_at: Default::default(),
            updated_at: Default::default(),
        }
    }
}
