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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
use super::def::*;
use cyfs_base::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct MetaOutputRequestCommon {
pub dec_id: Option<ObjectId>,
pub target_dec_id: Option<ObjectId>,
pub target: Option<ObjectId>,
pub flags: u32,
}
impl MetaOutputRequestCommon {
pub fn new() -> Self {
Self {
dec_id: None,
target_dec_id: None,
target: None,
flags: 0,
}
}
}
impl std::fmt::Display for MetaOutputRequestCommon {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(dec_id) = &self.dec_id {
write!(f, "dec_id: {}", dec_id)?;
}
if let Some(target_dec_id) = &self.target_dec_id {
write!(f, ", target_dec_id: {}", target_dec_id)?;
}
if let Some(target) = &self.target {
write!(f, ", target: {}", target)?;
}
write!(f, ", flags: {}", self.flags)?;
Ok(())
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaAddAccessOutputRequest {
pub common: MetaOutputRequestCommon,
pub item: GlobalStatePathAccessItem,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaAddAccessOutputResponse {
pub updated: bool,
}
pub type GlobalStateMetaRemoveAccessOutputRequest = GlobalStateMetaAddAccessOutputRequest;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaRemoveAccessOutputResponse {
pub item: Option<GlobalStatePathAccessItem>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaClearAccessOutputRequest {
pub common: MetaOutputRequestCommon,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaClearAccessOutputResponse {
pub count: u32,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaAddLinkOutputRequest {
pub common: MetaOutputRequestCommon,
pub source: String,
pub target: String,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaAddLinkOutputResponse {
pub updated: bool,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaRemoveLinkOutputRequest {
pub common: MetaOutputRequestCommon,
pub source: String,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaRemoveLinkOutputResponse {
pub item: Option<GlobalStatePathLinkItem>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaClearLinkOutputRequest {
pub common: MetaOutputRequestCommon,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaClearLinkOutputResponse {
pub count: u32,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaAddObjectMetaOutputRequest {
pub common: MetaOutputRequestCommon,
pub item: GlobalStateObjectMetaItem,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaAddObjectMetaOutputResponse {
pub updated: bool,
}
pub type GlobalStateMetaRemoveObjectMetaOutputRequest = GlobalStateMetaAddObjectMetaOutputRequest;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaRemoveObjectMetaOutputResponse {
pub item: Option<GlobalStateObjectMetaItem>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaClearObjectMetaOutputRequest {
pub common: MetaOutputRequestCommon,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaClearObjectMetaOutputResponse {
pub count: u32,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaAddPathConfigOutputRequest {
pub common: MetaOutputRequestCommon,
pub item: GlobalStatePathConfigItem,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaAddPathConfigOutputResponse {
pub updated: bool,
}
pub type GlobalStateMetaRemovePathConfigOutputRequest = GlobalStateMetaAddPathConfigOutputRequest;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaRemovePathConfigOutputResponse {
pub item: Option<GlobalStatePathConfigItem>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaClearPathConfigOutputRequest {
pub common: MetaOutputRequestCommon,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GlobalStateMetaClearPathConfigOutputResponse {
pub count: u32,
}