sindri_openapi/models/
api_key_response.rs

1/*
2 * Sindri Labs API
3 *
4 *  ## About [Sindri Labs](https://www.sindri.app/)' API simplifies the developer experience to enable fast and scalable zero-knowledge proof generation. Front-End Dashboard: [https://sindri.app/login](https://sindri.app/login) ## Documentation The [Sindri Documentation](https://sindri.app/docs) contains everything you need to get started! ## Sindri Resources The [sindri-resources GitHub repo](https://github.com/Sindri-Labs/sindri-resources) contains contains resources and sample data for the Sindri API. ## Using this Page This is a standard [OpenAPI (Swagger)](https://swagger.io/specification/) API documentation page. It provides detailed documentation for each endpoint. This page enables easy prototyping via the \"Try it out\" feature! Since all Sindri endpoints require a valid API Key, in order to use the \"Try it out\" feature for any endpoint in this documentation you must first obtain an API key. Do this in one of two ways: 1. Enter your username and password in the `/api/apikey/generate` endpoint of the **Authorization** section below. Use the API key returned in the `access` field of the response. 2. Obtain an API key from the Sindri Dashboard team \"Account Settings\". After obtaining your API key, authorize your page session by entering your API Key in the `SindriAPIKeyBearerAuth` section, reached by clicking \"Authorize\" below. Proving Backend Version: v1.2.17
5 *
6 * The version of the OpenAPI document: v1.17.28
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ApiKeyResponse : Response containing an API key.  This key is used in conjunction with the APIKey model to authenticate users in the API.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ApiKeyResponse {
17    #[serde(rename = "api_key", deserialize_with = "Option::deserialize")]
18    pub api_key: Option<String>,
19    /// The date that the API key was created.
20    #[serde(rename = "date_created")]
21    pub date_created: String,
22    #[serde(rename = "date_expires", deserialize_with = "Option::deserialize")]
23    pub date_expires: Option<String>,
24    #[serde(rename = "date_last_used", deserialize_with = "Option::deserialize")]
25    pub date_last_used: Option<String>,
26    /// The database ID for the API key. Used when deleting keys.
27    #[serde(rename = "id")]
28    pub id: String,
29    /// The human-readable name for the API key used for managing keys.
30    #[serde(rename = "name")]
31    pub name: String,
32    /// The non-secret key prefix.
33    #[serde(rename = "prefix")]
34    pub prefix: String,
35    /// The non-secret key suffix. Helpful for identifying keys if a name wasn't specified at creation time.
36    #[serde(rename = "suffix")]
37    pub suffix: String,
38}
39
40impl ApiKeyResponse {
41    /// Response containing an API key.  This key is used in conjunction with the APIKey model to authenticate users in the API.
42    pub fn new(
43        api_key: Option<String>,
44        date_created: String,
45        date_expires: Option<String>,
46        date_last_used: Option<String>,
47        id: String,
48        name: String,
49        prefix: String,
50        suffix: String,
51    ) -> ApiKeyResponse {
52        ApiKeyResponse {
53            api_key,
54            date_created,
55            date_expires,
56            date_last_used,
57            id,
58            name,
59            prefix,
60            suffix,
61        }
62    }
63}