Skip to main content

ory_kratos_client/models/
session_device.rs

1/*
2 * Ory Identities API
3 *
4 * This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more. 
5 *
6 * The version of the OpenAPI document: v26.2.0
7 * Contact: office@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// SessionDevice : Device corresponding to a Session
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SessionDevice {
17    /// Device record ID
18    #[serde(rename = "id")]
19    pub id: String,
20    /// IPAddress of the client
21    #[serde(rename = "ip_address", skip_serializing_if = "Option::is_none")]
22    pub ip_address: Option<String>,
23    /// Geo Location corresponding to the IP Address
24    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
25    pub location: Option<String>,
26    /// UserAgent of the client
27    #[serde(rename = "user_agent", skip_serializing_if = "Option::is_none")]
28    pub user_agent: Option<String>,
29}
30
31impl SessionDevice {
32    /// Device corresponding to a Session
33    pub fn new(id: String) -> SessionDevice {
34        SessionDevice {
35            id,
36            ip_address: None,
37            location: None,
38            user_agent: None,
39        }
40    }
41}
42