typesense_codegen/models/
api_key.rs

1/*
2 * Typesense API
3 *
4 * An open source search engine for building delightful search experiences.
5 *
6 * The version of the OpenAPI document: 0.25.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
12pub struct ApiKey {
13    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
14    pub value: Option<String>,
15    #[serde(rename = "description")]
16    pub description: String,
17    #[serde(rename = "actions")]
18    pub actions: Vec<String>,
19    #[serde(rename = "collections")]
20    pub collections: Vec<String>,
21    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
22    pub expires_at: Option<i64>,
23    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
24    pub id: Option<i64>,
25    #[serde(rename = "value_prefix", skip_serializing_if = "Option::is_none")]
26    pub value_prefix: Option<String>,
27}
28
29impl ApiKey {
30    pub fn new(description: String, actions: Vec<String>, collections: Vec<String>) -> ApiKey {
31        ApiKey {
32            value: None,
33            description,
34            actions,
35            collections,
36            expires_at: None,
37            id: None,
38            value_prefix: None,
39        }
40    }
41}