artifact-keeper-client 1.1.6

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 CreateSessionRequest {
    /// Path within the repository (e.g. \"images/vm.ova\")
    #[serde(rename = "artifact_path")]
    pub artifact_path: String,
    /// Expected SHA256 checksum of the complete file
    #[serde(rename = "checksum_sha256")]
    pub checksum_sha256: String,
    /// Chunk size in bytes (default 8 MB, range 1 MB - 256 MB)
    #[serde(rename = "chunk_size", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub chunk_size: Option<Option<i32>>,
    /// MIME content type (default \"application/octet-stream\")
    #[serde(rename = "content_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub content_type: Option<Option<String>>,
    /// Repository key (e.g. \"my-repo\")
    #[serde(rename = "repository_key")]
    pub repository_key: String,
    /// Total file size in bytes
    #[serde(rename = "total_size")]
    pub total_size: i64,
}

impl CreateSessionRequest {
    pub fn new(artifact_path: String, checksum_sha256: String, repository_key: String, total_size: i64) -> CreateSessionRequest {
        CreateSessionRequest {
            artifact_path,
            checksum_sha256,
            chunk_size: None,
            content_type: None,
            repository_key,
            total_size,
        }
    }
}