harbor-api 2.0.0

These APIs provide services for manipulating Harbor project.
Documentation
/*
 * Harbor API
 *
 * These APIs provide services for manipulating Harbor project.
 *
 * The version of the OpenAPI document: 2.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ScannerRegistrationReq {
    /// The name of this registration
    #[serde(rename = "name")]
    pub name: String,
    /// An optional description of this registration.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// A base URL of the scanner adapter.
    #[serde(rename = "url")]
    pub url: String,
    /// Specify what authentication approach is adopted for the HTTP communications. Supported types Basic\", \"Bearer\" and api key header \"X-ScannerAdapter-API-Key\" 
    #[serde(rename = "auth", skip_serializing_if = "Option::is_none")]
    pub auth: Option<String>,
    /// An optional value of the HTTP Authorization header sent with each request to the Scanner Adapter API. 
    #[serde(rename = "access_credential", skip_serializing_if = "Option::is_none")]
    pub access_credential: Option<String>,
    /// Indicate if skip the certificate verification when sending HTTP requests
    #[serde(rename = "skip_certVerify", skip_serializing_if = "Option::is_none")]
    pub skip_cert_verify: Option<bool>,
    /// Indicate whether use internal registry addr for the scanner to pull content or not
    #[serde(rename = "use_internal_addr", skip_serializing_if = "Option::is_none")]
    pub use_internal_addr: Option<bool>,
    /// Indicate whether the registration is enabled or not
    #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")]
    pub disabled: Option<bool>,
}

impl ScannerRegistrationReq {
    pub fn new(name: String, url: String) -> ScannerRegistrationReq {
        ScannerRegistrationReq {
            name,
            description: None,
            url,
            auth: None,
            access_credential: None,
            skip_cert_verify: None,
            use_internal_addr: None,
            disabled: None,
        }
    }
}