/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.0.0-rc.3
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChunkAvailabilityResponse {
    #[serde(rename = "artifact_id")]
    pub artifact_id: uuid::Uuid,
    #[serde(rename = "available_chunks")]
    pub available_chunks: i32,
    #[serde(rename = "chunk_bitmap")]
    pub chunk_bitmap: Vec<i32>,
    #[serde(rename = "peer_instance_id")]
    pub peer_instance_id: uuid::Uuid,
    #[serde(rename = "total_chunks")]
    pub total_chunks: i32,
}

impl ChunkAvailabilityResponse {
    pub fn new(artifact_id: uuid::Uuid, available_chunks: i32, chunk_bitmap: Vec<i32>, peer_instance_id: uuid::Uuid, total_chunks: i32) -> ChunkAvailabilityResponse {
        ChunkAvailabilityResponse {
            artifact_id,
            available_chunks,
            chunk_bitmap,
            peer_instance_id,
            total_chunks,
        }
    }
}

