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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
pub struct RepositoriesClient<T> {
    client: T,
    path: String,
}
impl<T> RepositoriesClient<T>
where
    T: crate::client::Client,
{
    pub fn new(client: T, parent_path: &str) -> Self {
        Self {
            client,
            path: format!("{}{}", parent_path, "/repositories"),
        }
    }
}
impl<T> RepositoriesClient<T>
where
    T: crate::client::Client,
{
    #[doc = "Get APT repository information."]
    pub fn get(&self) -> Result<GetOutput, T::Error> {
        let path = self.path.to_string();
        self.client.get(&path, &())
    }
}
impl<T> RepositoriesClient<T>
where
    T: crate::client::Client,
{
    #[doc = "Change the properties of a repository. Currently only allows enabling/disabling."]
    pub fn post(&self, params: PostParams) -> Result<(), T::Error> {
        let path = self.path.to_string();
        self.client.post(&path, &params)
    }
}
impl<T> RepositoriesClient<T>
where
    T: crate::client::Client,
{
    #[doc = "Add a standard repository to the configuration"]
    pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
        let path = self.path.to_string();
        self.client.put(&path, &params)
    }
}
impl ErrorsGetOutputErrorsItems {
    pub fn new(error: String, path: String) -> Self {
        Self {
            error,
            path,
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct ErrorsGetOutputErrorsItems {
    #[doc = "The error message"]
    pub error: String,
    #[doc = "Path to the problematic file."]
    pub path: String,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl FilesGetOutputFilesItems {
    pub fn new(
        digest: Vec<u64>,
        file_type: FileType,
        path: String,
        repositories: Vec<RepositoriesGetOutputFilesItemsRepositoriesItems>,
    ) -> Self {
        Self {
            digest,
            file_type,
            path,
            repositories,
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct FilesGetOutputFilesItems {
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "Digest of the file as bytes."]
    pub digest: Vec<u64>,
    #[serde(rename = "file-type")]
    #[doc = "Format of the file."]
    pub file_type: FileType,
    #[doc = "Path to the problematic file."]
    pub path: String,
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "The parsed repositories."]
    pub repositories: Vec<RepositoriesGetOutputFilesItemsRepositoriesItems>,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl GetOutput {
    pub fn new(
        digest: String,
        errors: Vec<ErrorsGetOutputErrorsItems>,
        files: Vec<FilesGetOutputFilesItems>,
        infos: Vec<InfosGetOutputInfosItems>,
        standard_repos: Vec<StandardReposGetOutputStandardReposItems>,
    ) -> Self {
        Self {
            digest,
            errors,
            files,
            infos,
            standard_repos,
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct GetOutput {
    #[doc = "Common digest of all files."]
    pub digest: String,
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "List of problematic repository files."]
    pub errors: Vec<ErrorsGetOutputErrorsItems>,
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "List of parsed repository files."]
    pub files: Vec<FilesGetOutputFilesItems>,
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "Additional information/warnings for APT repositories."]
    pub infos: Vec<InfosGetOutputInfosItems>,
    #[serde(rename = "standard-repos")]
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "List of standard repositories and their configuration status"]
    pub standard_repos: Vec<StandardReposGetOutputStandardReposItems>,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl InfosGetOutputInfosItems {
    pub fn new(index: String, kind: String, message: String, path: String) -> Self {
        Self {
            index,
            kind,
            message,
            path,
            property: Default::default(),
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct InfosGetOutputInfosItems {
    #[doc = "Index of the associated repository within the file."]
    pub index: String,
    #[doc = "Kind of the information (e.g. warning)."]
    pub kind: String,
    #[doc = "Information message."]
    pub message: String,
    #[doc = "Path to the associated file."]
    pub path: String,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    #[doc = "Property from which the info originates."]
    pub property: Option<String>,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl OptionsGetOutputFilesItemsRepositoriesItemsOptionsItems {
    pub fn new(key: String, values: Vec<String>) -> Self {
        Self {
            key,
            values,
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct OptionsGetOutputFilesItemsRepositoriesItemsOptionsItems {
    #[serde(rename = "Key")]
    pub key: String,
    #[serde(rename = "Values")]
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    pub values: Vec<String>,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl PostParams {
    pub fn new(index: u64, path: String) -> Self {
        Self {
            index,
            path,
            digest: Default::default(),
            enabled: Default::default(),
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct PostParams {
    #[serde(skip_serializing_if = "Option::is_none", default)]
    #[doc = "Digest to detect modifications."]
    pub digest: Option<String>,
    #[serde(
        serialize_with = "crate::types::serialize_bool_optional",
        deserialize_with = "crate::types::deserialize_bool_optional"
    )]
    #[serde(skip_serializing_if = "Option::is_none", default)]
    #[doc = "Whether the repository should be enabled or not."]
    pub enabled: Option<bool>,
    #[serde(
        serialize_with = "crate::types::serialize_int",
        deserialize_with = "crate::types::deserialize_int"
    )]
    #[doc = "Index within the file (starting from 0)."]
    pub index: u64,
    #[doc = "Path to the containing file."]
    pub path: String,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl PutParams {
    pub fn new(handle: String) -> Self {
        Self {
            handle,
            digest: Default::default(),
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct PutParams {
    #[serde(skip_serializing_if = "Option::is_none", default)]
    #[doc = "Digest to detect modifications."]
    pub digest: Option<String>,
    #[doc = "Handle that identifies a repository."]
    pub handle: String,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl RepositoriesGetOutputFilesItemsRepositoriesItems {
    pub fn new(
        enabled: bool,
        filetype: FileType,
        suites: Vec<String>,
        types: Vec<Types>,
        uris: Vec<String>,
    ) -> Self {
        Self {
            enabled,
            filetype,
            suites,
            types,
            uris,
            comment: Default::default(),
            components: Default::default(),
            options: Default::default(),
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct RepositoriesGetOutputFilesItemsRepositoriesItems {
    #[serde(rename = "Comment")]
    #[serde(skip_serializing_if = "Option::is_none", default)]
    #[doc = "Associated comment"]
    pub comment: Option<String>,
    #[serde(rename = "Components")]
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "List of repository components"]
    pub components: Vec<String>,
    #[serde(rename = "Enabled")]
    #[serde(
        serialize_with = "crate::types::serialize_bool",
        deserialize_with = "crate::types::deserialize_bool"
    )]
    #[doc = "Whether the repository is enabled or not"]
    pub enabled: bool,
    #[serde(rename = "FileType")]
    #[doc = "Format of the defining file."]
    pub filetype: FileType,
    #[serde(rename = "Options")]
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "Additional options"]
    pub options: Vec<OptionsGetOutputFilesItemsRepositoriesItemsOptionsItems>,
    #[serde(rename = "Suites")]
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "List of package distribuitions"]
    pub suites: Vec<String>,
    #[serde(rename = "Types")]
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "List of package types."]
    pub types: Vec<Types>,
    #[serde(rename = "URIs")]
    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
    #[doc = "List of repository URIs."]
    pub uris: Vec<String>,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl StandardReposGetOutputStandardReposItems {
    pub fn new(handle: String, name: String) -> Self {
        Self {
            handle,
            name,
            status: Default::default(),
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct StandardReposGetOutputStandardReposItems {
    #[doc = "Handle to identify the repository."]
    pub handle: String,
    #[doc = "Full name of the repository."]
    pub name: String,
    #[serde(
        serialize_with = "crate::types::serialize_bool_optional",
        deserialize_with = "crate::types::deserialize_bool_optional"
    )]
    #[serde(skip_serializing_if = "Option::is_none", default)]
    #[doc = "Indicating enabled/disabled status, if the repository is configured."]
    pub status: Option<bool>,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub enum FileType {
    #[serde(rename = "list")]
    List,
    #[serde(rename = "sources")]
    Sources,
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub enum Types {
    #[serde(rename = "deb")]
    Deb,
    #[serde(rename = "deb-src")]
    DebSrc,
}