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 MigrationItemResponse {
    #[serde(rename = "checksum_source", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub checksum_source: Option<Option<String>>,
    #[serde(rename = "checksum_target", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub checksum_target: Option<Option<String>>,
    #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub completed_at: Option<Option<String>>,
    #[serde(rename = "error_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub error_message: Option<Option<String>>,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "item_type")]
    pub item_type: String,
    #[serde(rename = "job_id")]
    pub job_id: uuid::Uuid,
    #[serde(rename = "retry_count")]
    pub retry_count: i32,
    #[serde(rename = "size_bytes")]
    pub size_bytes: i64,
    #[serde(rename = "source_path")]
    pub source_path: String,
    #[serde(rename = "started_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub started_at: Option<Option<String>>,
    #[serde(rename = "status")]
    pub status: String,
    #[serde(rename = "target_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub target_path: Option<Option<String>>,
}

impl MigrationItemResponse {
    pub fn new(id: uuid::Uuid, item_type: String, job_id: uuid::Uuid, retry_count: i32, size_bytes: i64, source_path: String, status: String) -> MigrationItemResponse {
        MigrationItemResponse {
            checksum_source: None,
            checksum_target: None,
            completed_at: None,
            error_message: None,
            id,
            item_type,
            job_id,
            retry_count,
            size_bytes,
            source_path,
            started_at: None,
            status,
            target_path: None,
        }
    }
}