langfuse_client/models/
api_key_summary.rs

1/*
2 * langfuse
3 *
4 * ## Authentication  Authenticate with the API using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication), get API keys in the project settings:  - username: Langfuse Public Key - password: Langfuse Secret Key  ## Exports  - OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml - Postman collection: https://cloud.langfuse.com/generated/postman/collection.json
5 *
6 * The version of the OpenAPI document: 
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ApiKeySummary : Summary of an API key
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16#[cfg_attr(feature="bon", derive(bon::Builder))]
17pub struct ApiKeySummary {
18    #[serde(rename = "id")]
19    pub id: String,
20    #[serde(rename = "createdAt")]
21    pub created_at: String,
22    #[serde(rename = "expiresAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub expires_at: Option<Option<String>>,
24    #[serde(rename = "lastUsedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub last_used_at: Option<Option<String>>,
26    #[serde(rename = "note", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub note: Option<Option<String>>,
28    #[serde(rename = "publicKey")]
29    pub public_key: String,
30    #[serde(rename = "displaySecretKey")]
31    pub display_secret_key: String,
32}
33
34impl ApiKeySummary {
35    /// Summary of an API key
36    pub fn new(id: String, created_at: String, public_key: String, display_secret_key: String) -> ApiKeySummary {
37        ApiKeySummary {
38            id,
39            created_at,
40            expires_at: None,
41            last_used_at: None,
42            note: None,
43            public_key,
44            display_secret_key,
45        }
46    }
47}
48