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

/// WebhookEvent : Webhook event types
/// Webhook event types
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum WebhookEvent {
    #[serde(rename = "artifact_uploaded")]
    ArtifactUploaded,
    #[serde(rename = "artifact_deleted")]
    ArtifactDeleted,
    #[serde(rename = "repository_created")]
    RepositoryCreated,
    #[serde(rename = "repository_deleted")]
    RepositoryDeleted,
    #[serde(rename = "user_created")]
    UserCreated,
    #[serde(rename = "user_deleted")]
    UserDeleted,
    #[serde(rename = "build_started")]
    BuildStarted,
    #[serde(rename = "build_completed")]
    BuildCompleted,
    #[serde(rename = "build_failed")]
    BuildFailed,

}

impl std::fmt::Display for WebhookEvent {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::ArtifactUploaded => write!(f, "artifact_uploaded"),
            Self::ArtifactDeleted => write!(f, "artifact_deleted"),
            Self::RepositoryCreated => write!(f, "repository_created"),
            Self::RepositoryDeleted => write!(f, "repository_deleted"),
            Self::UserCreated => write!(f, "user_created"),
            Self::UserDeleted => write!(f, "user_deleted"),
            Self::BuildStarted => write!(f, "build_started"),
            Self::BuildCompleted => write!(f, "build_completed"),
            Self::BuildFailed => write!(f, "build_failed"),
        }
    }
}

impl Default for WebhookEvent {
    fn default() -> WebhookEvent {
        Self::ArtifactUploaded
    }
}

