artifact-keeper-client 1.1.0

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 WebhookResponse {
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "events")]
    pub events: Vec<String>,
    #[serde(rename = "headers", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub headers: Option<Option<serde_json::Value>>,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "is_enabled")]
    pub is_enabled: bool,
    #[serde(rename = "last_triggered_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_triggered_at: Option<Option<String>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "repository_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub repository_id: Option<Option<uuid::Uuid>>,
    #[serde(rename = "url")]
    pub url: String,
}

impl WebhookResponse {
    pub fn new(created_at: String, events: Vec<String>, id: uuid::Uuid, is_enabled: bool, name: String, url: String) -> WebhookResponse {
        WebhookResponse {
            created_at,
            events,
            headers: None,
            id,
            is_enabled,
            last_triggered_at: None,
            name,
            repository_id: None,
            url,
        }
    }
}