windmill-api 1.895.1

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.895.1
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClientIpDiagnostics {
    #[serde(rename = "peer", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub peer: Option<Option<String>>,
    #[serde(rename = "forwarding_header", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub forwarding_header: Option<Option<String>>,
    /// as audit entries and the login rate limit record it
    #[serde(rename = "client_ip", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub client_ip: Option<Option<String>>,
    /// as token IP allowlists see it
    #[serde(rename = "enforced_client_ip", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub enforced_client_ip: Option<Option<String>>,
    #[serde(rename = "trusted_proxies_set")]
    pub trusted_proxies_set: bool,
    /// a whole private range is trusted, so any host on the private network can name its own client address
    #[serde(rename = "private_ranges_trusted")]
    pub private_ranges_trusted: bool,
    #[serde(rename = "client_ip_header", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub client_ip_header: Option<Option<String>>,
    #[serde(rename = "enforced")]
    pub enforced: Box<models::ClientIpTrustView>,
    /// absent when it is the enforced view, which it differs from only by Cloudflare
    #[serde(rename = "attributed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub attributed: Option<Option<Box<models::ClientIpTrustView>>>,
    #[serde(rename = "configuration")]
    pub configuration: Box<models::ClientIpDiagnosticsConfiguration>,
    #[serde(rename = "forwarders")]
    pub forwarders: Vec<models::ClientIpDiagnosticsForwardersInner>,
}

impl ClientIpDiagnostics {
    pub fn new(trusted_proxies_set: bool, private_ranges_trusted: bool, enforced: models::ClientIpTrustView, configuration: models::ClientIpDiagnosticsConfiguration, forwarders: Vec<models::ClientIpDiagnosticsForwardersInner>) -> ClientIpDiagnostics {
        ClientIpDiagnostics {
            peer: None,
            forwarding_header: None,
            client_ip: None,
            enforced_client_ip: None,
            trusted_proxies_set,
            private_ranges_trusted,
            client_ip_header: None,
            enforced: Box::new(enforced),
            attributed: None,
            configuration: Box::new(configuration),
            forwarders,
        }
    }
}