// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Public API shape for one immutable review version.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ReviewVersion {
    pub id: String,
    pub review_id: String,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub parent_id: Option<String>,
    /// Actor that created the version.
    pub author: Actor,
    pub snapshot: std::collections::HashMap<String, serde_json::Value>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub note: Option<String>,
    /// When the review version was created.
    pub created_at: String,
}
impl ReviewVersion {
    /// Construct a new `ReviewVersion` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        id: impl Into<String>,
        review_id: impl Into<String>,
        author: Actor,
        snapshot: std::collections::HashMap<String, serde_json::Value>,
        created_at: impl Into<String>,
    ) -> Self {
        Self {
            id: id.into(),
            review_id: review_id.into(),
            parent_id: Default::default(),
            author,
            snapshot,
            note: Default::default(),
            created_at: created_at.into(),
        }
    }
}
