/*
 * Artifact Keeper API
 *
 * REST API for Artifact Keeper, an open-source universal artifact registry. Covers user management, repositories, artifacts, search, security scanning, SBOM, dependency tracking, SSO, analytics, monitoring, telemetry, lifecycle policies, plugins, edge nodes, migration, and administration. Format-specific protocol endpoints (npm, PyPI, Maven, Docker/OCI, etc.) are not included; those follow their respective upstream specifications.
 *
 * The version of the OpenAPI document: 1.0.0-a2
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ScoredPeer {
    #[serde(rename = "node_id")]
    pub node_id: uuid::Uuid,
    #[serde(rename = "score")]
    pub score: f64,
    #[serde(rename = "latency_ms")]
    pub latency_ms: i32,
    #[serde(rename = "bandwidth_mbps")]
    pub bandwidth_mbps: f64,
    #[serde(rename = "has_chunks")]
    pub has_chunks: i32,
}

impl ScoredPeer {
    pub fn new(node_id: uuid::Uuid, score: f64, latency_ms: i32, bandwidth_mbps: f64, has_chunks: i32) -> ScoredPeer {
        ScoredPeer {
            node_id,
            score,
            latency_ms,
            bandwidth_mbps,
            has_chunks,
        }
    }
}

