Skip to main content

windmill_api/models/
client_ip_diagnostics.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.891.0
7 * Contact: contact@windmill.dev
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 ClientIpDiagnostics {
16    #[serde(rename = "peer", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
17    pub peer: Option<Option<String>>,
18    #[serde(rename = "forwarding_header", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub forwarding_header: Option<Option<String>>,
20    /// as audit entries and the login rate limit record it
21    #[serde(rename = "client_ip", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub client_ip: Option<Option<String>>,
23    /// as token IP allowlists see it
24    #[serde(rename = "enforced_client_ip", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub enforced_client_ip: Option<Option<String>>,
26    #[serde(rename = "trusted_proxies_set")]
27    pub trusted_proxies_set: bool,
28    #[serde(rename = "client_ip_header", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub client_ip_header: Option<Option<String>>,
30    #[serde(rename = "enforced")]
31    pub enforced: Box<models::ClientIpTrustView>,
32    /// absent when it is the enforced view, which it differs from only by Cloudflare
33    #[serde(rename = "attributed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub attributed: Option<Option<Box<models::ClientIpTrustView>>>,
35    #[serde(rename = "forwarders")]
36    pub forwarders: Vec<models::ClientIpDiagnosticsForwardersInner>,
37}
38
39impl ClientIpDiagnostics {
40    pub fn new(trusted_proxies_set: bool, enforced: models::ClientIpTrustView, forwarders: Vec<models::ClientIpDiagnosticsForwardersInner>) -> ClientIpDiagnostics {
41        ClientIpDiagnostics {
42            peer: None,
43            forwarding_header: None,
44            client_ip: None,
45            enforced_client_ip: None,
46            trusted_proxies_set,
47            client_ip_header: None,
48            enforced: Box::new(enforced),
49            attributed: None,
50            forwarders,
51        }
52    }
53}
54