authentik_client/models/
authenticated_session_geo_ip.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AuthenticatedSessionGeoIp {
17 #[serde(rename = "continent", deserialize_with = "Option::deserialize")]
18 pub continent: Option<String>,
19 #[serde(rename = "country", deserialize_with = "Option::deserialize")]
20 pub country: Option<String>,
21 #[serde(rename = "lat", deserialize_with = "Option::deserialize")]
22 pub lat: Option<f64>,
23 #[serde(rename = "long", deserialize_with = "Option::deserialize")]
24 pub long: Option<f64>,
25 #[serde(rename = "city")]
26 pub city: String,
27}
28
29impl AuthenticatedSessionGeoIp {
30 pub fn new(
32 continent: Option<String>,
33 country: Option<String>,
34 lat: Option<f64>,
35 long: Option<f64>,
36 city: String,
37 ) -> AuthenticatedSessionGeoIp {
38 AuthenticatedSessionGeoIp {
39 continent,
40 country,
41 lat,
42 long,
43 city,
44 }
45 }
46}