langfuse_client_base/models/
project.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
15pub struct Project {
16    #[serde(rename = "id")]
17    pub id: String,
18    #[serde(rename = "name")]
19    pub name: String,
20    /// Metadata for the project
21    #[serde(rename = "metadata")]
22    pub metadata: std::collections::HashMap<String, serde_json::Value>,
23    /// Number of days to retain data. Null or 0 means no retention. Omitted if no retention is configured.
24    #[serde(
25        rename = "retentionDays",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub retention_days: Option<Option<i32>>,
31}
32
33impl Project {
34    pub fn new(
35        id: String,
36        name: String,
37        metadata: std::collections::HashMap<String, serde_json::Value>,
38    ) -> Project {
39        Project {
40            id,
41            name,
42            metadata,
43            retention_days: None,
44        }
45    }
46}