Skip to main content

limit_lens/models/
test_session.rs

1/*
2 * Limit Lens API
3 *
4 * A simple API for testing and visualizing rate limiters in real-time. Monitor request throughput and see how your rate limiting algorithms perform under load.
5 *
6 * The version of the OpenAPI document: 0.6.1
7 * Contact: sharmaninenine@gmail.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// TestSession : Represents a test session for rate limit testing
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TestSession {
17    /// When the test session was created
18    #[serde(rename = "created_at")]
19    pub created_at: String,
20    /// Unique identifier for the test session
21    #[serde(rename = "id")]
22    pub id: String,
23    /// Name of the test session (optional)
24    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub name: Option<Option<String>>,
26}
27
28impl TestSession {
29    /// Represents a test session for rate limit testing
30    pub fn new(created_at: String, id: String) -> TestSession {
31        TestSession {
32            created_at,
33            id,
34            name: None,
35        }
36    }
37}
38