github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/rust/src/models/diff.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 Diff {
    15      #[serde(rename = "type")]
    16      pub r#type: Type,
    17      #[serde(rename = "path")]
    18      pub path: String,
    19      #[serde(rename = "path_type")]
    20      pub path_type: PathType,
    21      /// represents the size of the added/changed/deleted entry
    22      #[serde(rename = "size_bytes", skip_serializing_if = "Option::is_none")]
    23      pub size_bytes: Option<i64>,
    24  }
    25  
    26  impl Diff {
    27      pub fn new(r#type: Type, path: String, path_type: PathType) -> Diff {
    28          Diff {
    29              r#type,
    30              path,
    31              path_type,
    32              size_bytes: None,
    33          }
    34      }
    35  }
    36  /// 
    37  #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
    38  pub enum Type {
    39      #[serde(rename = "added")]
    40      Added,
    41      #[serde(rename = "removed")]
    42      Removed,
    43      #[serde(rename = "changed")]
    44      Changed,
    45      #[serde(rename = "conflict")]
    46      Conflict,
    47      #[serde(rename = "prefix_changed")]
    48      PrefixChanged,
    49  }
    50  
    51  impl Default for Type {
    52      fn default() -> Type {
    53          Self::Added
    54      }
    55  }
    56  /// 
    57  #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
    58  pub enum PathType {
    59      #[serde(rename = "common_prefix")]
    60      CommonPrefix,
    61      #[serde(rename = "object")]
    62      Object,
    63  }
    64  
    65  impl Default for PathType {
    66      fn default() -> PathType {
    67          Self::CommonPrefix
    68      }
    69  }
    70