/*
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ArtifactListResponse {
    /// Maven component grouping.  Only present when `group_by=maven_component`.
    #[serde(rename = "components", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub components: Option<Option<Vec<models::MavenComponentResponse>>>,
    /// Docker tag grouping.  Only present when `group_by=docker_tag`.
    #[serde(rename = "docker_tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub docker_tags: Option<Option<Vec<models::DockerTagResponse>>>,
    #[serde(rename = "items")]
    pub items: Vec<models::ArtifactResponse>,
    #[serde(rename = "pagination")]
    pub pagination: Box<models::Pagination>,
}

impl ArtifactListResponse {
    pub fn new(items: Vec<models::ArtifactResponse>, pagination: models::Pagination) -> ArtifactListResponse {
        ArtifactListResponse {
            components: None,
            docker_tags: None,
            items,
            pagination: Box::new(pagination),
        }
    }
}

