vaultrs/api/kv2/
responses.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use std::collections::HashMap;

use serde::{Deserialize, Serialize};
use serde_json::Value;

/// Response from executing
/// [ReadConfigurationRequest][crate::api::kv2::requests::ReadConfigurationRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadConfigurationResponse {
    pub cas_required: bool,
    pub delete_version_after: String,
    pub max_versions: u64,
}

/// Response from executing
/// [ReadSecretRequest][crate::api::kv2::requests::ReadSecretRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadSecretResponse {
    pub data: Value,
    pub metadata: SecretVersionMetadata,
}

/// Response from executing
/// [ReadSecretRequest][crate::api::kv2::requests::ReadSecretRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct SecretVersionMetadata {
    pub created_time: String,
    pub deletion_time: String,
    pub custom_metadata: Option<HashMap<String, String>>,
    pub destroyed: bool,
    pub version: u64,
}

/// Response from executing
/// [ListSecretsRequest][crate::api::kv2::requests::ListSecretsRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ListSecretsResponse {
    pub keys: Vec<String>,
}

/// Response from executing
/// [ReadSecretMetadataRequest][crate::api::kv2::requests::ReadSecretMetadataRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadSecretMetadataResponse {
    pub cas_required: bool,
    pub created_time: String,
    pub current_version: u64,
    pub delete_version_after: String,
    pub max_versions: u64,
    pub oldest_version: u64,
    pub updated_time: String,
    pub custom_metadata: Option<HashMap<String, String>>,
    pub versions: HashMap<String, SecretMetadata>,
}

/// Response from executing
/// [ReadSecretMetadataRequest][crate::api::kv2::requests::ReadSecretMetadataRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct SecretMetadata {
    pub created_time: String,
    pub deletion_time: String,
    pub destroyed: bool,
}