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 TreeNodeResponse {
    #[serde(rename = "children_count", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub children_count: Option<Option<i64>>,
    #[serde(rename = "created_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<Option<String>>,
    #[serde(rename = "has_children")]
    pub has_children: bool,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "repository_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub repository_key: Option<Option<String>>,
    #[serde(rename = "size_bytes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub size_bytes: Option<Option<i64>>,
    #[serde(rename = "type")]
    pub r#type: String,
}

impl TreeNodeResponse {
    pub fn new(has_children: bool, id: String, name: String, path: String, r#type: String) -> TreeNodeResponse {
        TreeNodeResponse {
            children_count: None,
            created_at: None,
            has_children,
            id,
            name,
            path,
            repository_key: None,
            size_bytes: None,
            r#type,
        }
    }
}