hanzo_client/models/api_key.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
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)]
15pub struct ApiKey {
16 /// CreatedAt is when the key last changed, as IAM records it.
17 #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
18 pub created_at: Option<String>,
19 /// Key is the FULL value, and is present for a publishable key only: it is public by construction and useless to its holder if it cannot be read back.
20 #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
21 pub key: Option<String>,
22 /// Limit is what this key may reach, as `kind:name` entries — `model:zen5`, `project:acme`, `product:commerce`. Absent means the key reaches whatever its holder does, which is what every key minted before limits existed does and must keep doing.
23 #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
24 pub limit: Option<Vec<String>>,
25 /// Prefix is the recognizable, non-secret head of the key — enough to tell two keys apart, never enough to use one.
26 #[serde(rename = "prefix", skip_serializing_if = "Option::is_none")]
27 pub prefix: Option<String>,
28 /// Type is the key class: secret (sk-) or publishable (pk-).
29 #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
30 pub r#type: Option<String>,
31}
32
33impl ApiKey {
34 pub fn new() -> ApiKey {
35 ApiKey {
36 created_at: None,
37 key: None,
38 limit: None,
39 prefix: None,
40 r#type: None,
41 }
42 }
43}
44