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

/// TestFormatResponse : Response from format handler test
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TestFormatResponse {
    /// Parsed metadata if parse_metadata succeeded
    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<Option<Box<models::TestMetadata>>>,
    /// Parse error message if any
    #[serde(rename = "parse_error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub parse_error: Option<Option<String>>,
    /// Whether validation passed
    #[serde(rename = "valid")]
    pub valid: bool,
    /// Validation error message if any
    #[serde(rename = "validation_error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub validation_error: Option<Option<String>>,
}

impl TestFormatResponse {
    /// Response from format handler test
    pub fn new(valid: bool) -> TestFormatResponse {
        TestFormatResponse {
            metadata: None,
            parse_error: None,
            valid,
            validation_error: None,
        }
    }
}

