1use std::collections::BTreeMap;
2
3use serde::Deserialize;
4use serde::Serialize;
5
6use k8_obj_metadata::Crd;
7use k8_obj_metadata::CrdNames;
8use k8_obj_metadata::Header;
9use k8_obj_metadata::Spec;
10use k8_obj_metadata::Status;
11
12const SECRET_API: Crd = Crd {
15 group: "core",
16 version: "v1",
17 names: CrdNames {
18 kind: "Secret",
19 plural: "secrets",
20 singular: "secret",
21 },
22};
23
24impl Spec for SecretSpec {
25 type Status = SecretStatus;
26 type Header = SecretHeader;
27
28 fn metadata() -> &'static Crd {
29 &SECRET_API
30 }
31}
32
33#[derive(Deserialize, Serialize, Debug, PartialEq, Default, Clone)]
34#[serde(rename_all = "camelCase")]
35pub struct SecretSpec {}
36
37#[derive(Deserialize, Serialize, Default, PartialEq, Debug, Clone)]
38#[serde(rename_all = "camelCase")]
39pub struct SecretStatus {}
40
41impl Status for SecretStatus {}
42
43#[derive(Deserialize, Serialize, Debug, Default, Clone)]
44#[serde(rename_all = "camelCase")]
45pub struct SecretHeader {
46 #[serde(default)]
47 pub data: BTreeMap<String, String>,
48 #[serde(rename = "type")]
49 pub ty: String,
50}
51
52impl Header for SecretHeader {}