aperture_cli/cache/
models.rs1use serde::{Deserialize, Serialize};
2use std::collections::HashMap;
3
4#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
5pub struct CachedSpec {
6 pub name: String,
7 pub version: String,
8 pub commands: Vec<CachedCommand>,
9 pub base_url: Option<String>,
11 pub servers: Vec<String>,
13 pub security_schemes: HashMap<String, CachedSecurityScheme>,
15}
16
17#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
18pub struct CachedCommand {
19 pub name: String,
20 pub description: Option<String>,
21 pub summary: Option<String>,
22 pub operation_id: String,
23 pub method: String,
24 pub path: String,
25 pub parameters: Vec<CachedParameter>,
26 pub request_body: Option<CachedRequestBody>,
27 pub responses: Vec<CachedResponse>,
28 pub security_requirements: Vec<String>,
30 pub tags: Vec<String>,
32 pub deprecated: bool,
34 pub external_docs_url: Option<String>,
36}
37
38#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
39pub struct CachedParameter {
40 pub name: String,
41 pub location: String,
42 pub required: bool,
43 pub description: Option<String>,
44 pub schema: Option<String>,
45 pub schema_type: Option<String>,
46 pub format: Option<String>,
47 pub default_value: Option<String>,
48 pub enum_values: Vec<String>,
49 pub example: Option<String>,
50}
51
52#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
53pub struct CachedRequestBody {
54 pub content_type: String,
55 pub schema: String,
56 pub required: bool,
57 pub description: Option<String>,
58 pub example: Option<String>,
59}
60
61#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
62pub struct CachedResponse {
63 pub status_code: String,
64 pub description: Option<String>,
65 pub content_type: Option<String>,
66 pub schema: Option<String>,
67}
68
69#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
71pub struct CachedSecurityScheme {
72 pub name: String,
74 pub scheme_type: String,
76 pub scheme: Option<String>,
78 pub location: Option<String>,
80 pub parameter_name: Option<String>,
82 pub description: Option<String>,
84 pub bearer_format: Option<String>,
86 pub aperture_secret: Option<CachedApertureSecret>,
88}
89
90#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)]
92pub struct CachedApertureSecret {
93 pub source: String,
95 pub name: String,
97}