artifact-keeper-client 1.1.2

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.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 PeerInstanceResponse {
    #[serde(rename = "cache_size_bytes")]
    pub cache_size_bytes: i64,
    #[serde(rename = "cache_usage_percent")]
    pub cache_usage_percent: f64,
    #[serde(rename = "cache_used_bytes")]
    pub cache_used_bytes: i64,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "endpoint_url")]
    pub endpoint_url: String,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "is_local")]
    pub is_local: bool,
    #[serde(rename = "last_heartbeat_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_heartbeat_at: Option<Option<String>>,
    #[serde(rename = "last_sync_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_sync_at: Option<Option<String>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "region", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub region: Option<Option<String>>,
    #[serde(rename = "status")]
    pub status: String,
}

impl PeerInstanceResponse {
    pub fn new(cache_size_bytes: i64, cache_usage_percent: f64, cache_used_bytes: i64, created_at: String, endpoint_url: String, id: uuid::Uuid, is_local: bool, name: String, status: String) -> PeerInstanceResponse {
        PeerInstanceResponse {
            cache_size_bytes,
            cache_usage_percent,
            cache_used_bytes,
            created_at,
            endpoint_url,
            id,
            is_local,
            last_heartbeat_at: None,
            last_sync_at: None,
            name,
            region: None,
            status,
        }
    }
}