harbor_api/models/
scanner_registration_req.rs

1/*
2 * Harbor API
3 *
4 * These APIs provide services for manipulating Harbor project.
5 *
6 * The version of the OpenAPI document: 2.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ScannerRegistrationReq {
16    /// The name of this registration
17    #[serde(rename = "name")]
18    pub name: String,
19    /// An optional description of this registration.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// A base URL of the scanner adapter.
23    #[serde(rename = "url")]
24    pub url: String,
25    /// Specify what authentication approach is adopted for the HTTP communications. Supported types Basic\", \"Bearer\" and api key header \"X-ScannerAdapter-API-Key\" 
26    #[serde(rename = "auth", skip_serializing_if = "Option::is_none")]
27    pub auth: Option<String>,
28    /// An optional value of the HTTP Authorization header sent with each request to the Scanner Adapter API. 
29    #[serde(rename = "access_credential", skip_serializing_if = "Option::is_none")]
30    pub access_credential: Option<String>,
31    /// Indicate if skip the certificate verification when sending HTTP requests
32    #[serde(rename = "skip_certVerify", skip_serializing_if = "Option::is_none")]
33    pub skip_cert_verify: Option<bool>,
34    /// Indicate whether use internal registry addr for the scanner to pull content or not
35    #[serde(rename = "use_internal_addr", skip_serializing_if = "Option::is_none")]
36    pub use_internal_addr: Option<bool>,
37    /// Indicate whether the registration is enabled or not
38    #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")]
39    pub disabled: Option<bool>,
40}
41
42impl ScannerRegistrationReq {
43    pub fn new(name: String, url: String) -> ScannerRegistrationReq {
44        ScannerRegistrationReq {
45            name,
46            description: None,
47            url,
48            auth: None,
49            access_credential: None,
50            skip_cert_verify: None,
51            use_internal_addr: None,
52            disabled: None,
53        }
54    }
55}
56