Skip to main content

hanzo_client/models/
object_item.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ObjectItem {
16    /// ETag is the store's entity tag for the bytes currently at this key, with the quotes the store wraps it in stripped. It is an opaque VERSION and not a checksum to verify against: a single-part upload's tag happens to be the MD5 of the content and a multipart upload's is not, and nothing here says which this was. Compare two reads of one key to learn whether the object changed; absent for a folder entry, and for an object the store reports none for.
17    #[serde(rename = "etag", skip_serializing_if = "Option::is_none")]
18    pub etag: Option<String>,
19    /// true for a folder (common prefix)
20    #[serde(rename = "isDir", skip_serializing_if = "Option::is_none")]
21    pub is_dir: Option<bool>,
22    /// key RELATIVE to the requested prefix
23    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
24    pub key: Option<String>,
25    /// unix seconds (0 for a folder)
26    #[serde(rename = "lastModified", skip_serializing_if = "Option::is_none")]
27    pub last_modified: Option<i32>,
28    /// bytes (0 for a folder)
29    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
30    pub size: Option<i32>,
31}
32
33impl ObjectItem {
34    pub fn new() -> ObjectItem {
35        ObjectItem {
36            etag: None,
37            is_dir: None,
38            key: None,
39            last_modified: None,
40            size: None,
41        }
42    }
43}
44