github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/rust/src/models/commit_record_creation.rs (about)

     1  /*
     2   * lakeFS API
     3   *
     4   * lakeFS HTTP API
     5   *
     6   * The version of the OpenAPI document: 1.0.0
     7   * Contact: services@treeverse.io
     8   * Generated by: https://openapi-generator.tech
     9   */
    10  
    11  use crate::models;
    12  
    13  #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
    14  pub struct CommitRecordCreation {
    15      /// id of the commit record
    16      #[serde(rename = "commit_id")]
    17      pub commit_id: String,
    18      /// version of the commit record
    19      #[serde(rename = "version")]
    20      pub version: i32,
    21      /// committer of the commit record
    22      #[serde(rename = "committer")]
    23      pub committer: String,
    24      /// message of the commit record
    25      #[serde(rename = "message")]
    26      pub message: String,
    27      /// metarange_id of the commit record
    28      #[serde(rename = "metarange_id")]
    29      pub metarange_id: String,
    30      /// Unix Epoch in seconds
    31      #[serde(rename = "creation_date")]
    32      pub creation_date: i64,
    33      /// parents of the commit record
    34      #[serde(rename = "parents")]
    35      pub parents: Vec<String>,
    36      /// metadata of the commit record
    37      #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    38      pub metadata: Option<std::collections::HashMap<String, String>>,
    39      /// generation of the commit record
    40      #[serde(rename = "generation")]
    41      pub generation: i64,
    42      #[serde(rename = "force", skip_serializing_if = "Option::is_none")]
    43      pub force: Option<bool>,
    44  }
    45  
    46  impl CommitRecordCreation {
    47      pub fn new(commit_id: String, version: i32, committer: String, message: String, metarange_id: String, creation_date: i64, parents: Vec<String>, generation: i64) -> CommitRecordCreation {
    48          CommitRecordCreation {
    49              commit_id,
    50              version,
    51              committer,
    52              message,
    53              metarange_id,
    54              creation_date,
    55              parents,
    56              metadata: None,
    57              generation,
    58              force: None,
    59          }
    60      }
    61  }
    62