artifact-keeper-client 1.2.1

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.2.1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateConnectionRequest {
    #[serde(rename = "auth_type")]
    pub auth_type: String,
    #[serde(rename = "credentials")]
    pub credentials: Box<models::ConnectionCredentials>,
    #[serde(rename = "name")]
    pub name: String,
    /// Source registry type: \"artifactory\" (default) or \"nexus\"
    #[serde(rename = "source_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub source_type: Option<Option<String>>,
    #[serde(rename = "url")]
    pub url: String,
}

impl CreateConnectionRequest {
    pub fn new(auth_type: String, credentials: models::ConnectionCredentials, name: String, url: String) -> CreateConnectionRequest {
        CreateConnectionRequest {
            auth_type,
            credentials: Box::new(credentials),
            name,
            source_type: None,
            url,
        }
    }
}