typesense_rs/models/
api_key.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Typesense API
//
// An open source search engine for building delightful search experiences.
//
// The version of the OpenAPI document: 27.0
//
// Generated by: https://openapi-generator.tech

use serde::{Deserialize, Serialize};

use crate::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ApiKey {
	#[serde(rename = "actions")]
	pub actions: Vec<String>,
	#[serde(rename = "collections")]
	pub collections: Vec<String>,
	#[serde(rename = "description")]
	pub description: String,
	#[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
	pub expires_at: Option<i64>,
	#[serde(rename = "value", skip_serializing_if = "Option::is_none")]
	pub value: Option<String>,
	#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
	pub id: Option<i64>,
	#[serde(rename = "value_prefix", skip_serializing_if = "Option::is_none")]
	pub value_prefix: Option<String>,
}

impl ApiKey {
	pub fn new(actions: Vec<String>, collections: Vec<String>, description: String) -> ApiKey {
		ApiKey {
			actions,
			collections,
			description,
			expires_at: None,
			value: None,
			id: None,
			value_prefix: None,
		}
	}
}