github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/rust/src/models/object_stats.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 ObjectStats {
    15      #[serde(rename = "path")]
    16      pub path: String,
    17      #[serde(rename = "path_type")]
    18      pub path_type: PathType,
    19      /// The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET 
    20      #[serde(rename = "physical_address")]
    21      pub physical_address: String,
    22      /// If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time.  This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire.  This field is *optional*. 
    23      #[serde(rename = "physical_address_expiry", skip_serializing_if = "Option::is_none")]
    24      pub physical_address_expiry: Option<i64>,
    25      #[serde(rename = "checksum")]
    26      pub checksum: String,
    27      #[serde(rename = "size_bytes", skip_serializing_if = "Option::is_none")]
    28      pub size_bytes: Option<i64>,
    29      /// Unix Epoch in seconds
    30      #[serde(rename = "mtime")]
    31      pub mtime: i64,
    32      #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    33      pub metadata: Option<std::collections::HashMap<String, String>>,
    34      /// Object media type
    35      #[serde(rename = "content_type", skip_serializing_if = "Option::is_none")]
    36      pub content_type: Option<String>,
    37  }
    38  
    39  impl ObjectStats {
    40      pub fn new(path: String, path_type: PathType, physical_address: String, checksum: String, mtime: i64) -> ObjectStats {
    41          ObjectStats {
    42              path,
    43              path_type,
    44              physical_address,
    45              physical_address_expiry: None,
    46              checksum,
    47              size_bytes: None,
    48              mtime,
    49              metadata: None,
    50              content_type: None,
    51          }
    52      }
    53  }
    54  /// 
    55  #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
    56  pub enum PathType {
    57      #[serde(rename = "common_prefix")]
    58      CommonPrefix,
    59      #[serde(rename = "object")]
    60      Object,
    61  }
    62  
    63  impl Default for PathType {
    64      fn default() -> PathType {
    65          Self::CommonPrefix
    66      }
    67  }
    68