1use std::collections::HashMap;
2
3use serde::{Deserialize, Serialize};
4
5use crate::{error::ApiErrorItem, operation::ApiOperation};
6
7use super::ty::ApiModel;
8
9#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
10pub struct ApiDocument {
11 pub ident: String,
13
14 pub name: String,
16
17 pub note: Option<String>,
19
20 pub version: Option<String>,
22
23 pub modules: HashMap<String, ApiModule>,
25
26 pub resources: Vec<ApiResource>,
28
29 pub operations: Vec<ApiOperation>,
31
32 pub models: HashMap<String, ApiModel>,
34
35 pub errors: Vec<ApiErrorItem>,
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
40pub struct ApiModule {
41 pub ident: String,
42 pub name: String,
43 pub parent: Option<String>,
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
47pub struct ApiResource {
48 pub ident: String,
50
51 pub value: String,
53}