artifact-keeper-client 1.2.1

Rust client for the Artifact Keeper REST API
Documentation
/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.2.1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// OciBlobFootprintReport : Read-only OCI blob storage footprint report (issue #1408).  This is a **reporting-only** view. It performs no deletion and takes no locks. It surfaces how much storage the tracked `oci_blobs` rows account for so operators can see the magnitude of un-reclaimed blob layers before any garbage-collection mechanism is enabled.  It deliberately does NOT attempt to classify which blobs are \"reclaimable orphans\": that requires a manifest -> blob reference table that does not yet exist in the schema, and any per-`(repository_id, digest)` orphan heuristic would mis-handle the cross-repo dedup case (multiple `oci_blobs` rows, one physical object) and report in-use blobs as reclaimable. The numbers here are exact aggregates only.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OciBlobFootprintReport {
    /// Distinct digests older than `grace_hours` (eligible to be *considered* by a future GC sweep once a reference table exists). Reporting only.
    #[serde(rename = "aged_distinct_digests")]
    pub aged_distinct_digests: i64,
    /// Physical bytes (distinct-digest) older than `grace_hours`.
    #[serde(rename = "aged_physical_bytes")]
    pub aged_physical_bytes: i64,
    /// Number of distinct blob digests (content-addressed identities). When this is smaller than `total_blob_rows`, the difference is cross-repo deduplication: rows that share one physical storage object.
    #[serde(rename = "distinct_digests")]
    pub distinct_digests: i64,
    /// Grace window (hours) applied to the `aged_*` figures below.
    #[serde(rename = "grace_hours")]
    pub grace_hours: i64,
    /// Sum of `size_bytes` over every `oci_blobs` row. Double-counts deduplicated blobs once per referencing repository.
    #[serde(rename = "logical_bytes")]
    pub logical_bytes: i64,
    /// Per-repository logical footprint, largest `logical_bytes` first.
    #[serde(rename = "per_repository")]
    pub per_repository: Vec<models::OciBlobRepoFootprint>,
    /// Sum of `size_bytes` counting each distinct digest exactly once. This approximates the physical bytes occupied in the storage backend.
    #[serde(rename = "physical_bytes")]
    pub physical_bytes: i64,
    /// Total number of `oci_blobs` rows across all repositories.
    #[serde(rename = "total_blob_rows")]
    pub total_blob_rows: i64,
}

impl OciBlobFootprintReport {
    /// Read-only OCI blob storage footprint report (issue #1408).  This is a **reporting-only** view. It performs no deletion and takes no locks. It surfaces how much storage the tracked `oci_blobs` rows account for so operators can see the magnitude of un-reclaimed blob layers before any garbage-collection mechanism is enabled.  It deliberately does NOT attempt to classify which blobs are \"reclaimable orphans\": that requires a manifest -> blob reference table that does not yet exist in the schema, and any per-`(repository_id, digest)` orphan heuristic would mis-handle the cross-repo dedup case (multiple `oci_blobs` rows, one physical object) and report in-use blobs as reclaimable. The numbers here are exact aggregates only.
    pub fn new(aged_distinct_digests: i64, aged_physical_bytes: i64, distinct_digests: i64, grace_hours: i64, logical_bytes: i64, per_repository: Vec<models::OciBlobRepoFootprint>, physical_bytes: i64, total_blob_rows: i64) -> OciBlobFootprintReport {
        OciBlobFootprintReport {
            aged_distinct_digests,
            aged_physical_bytes,
            distinct_digests,
            grace_hours,
            logical_bytes,
            per_repository,
            physical_bytes,
            total_blob_rows,
        }
    }
}