docktor-api 0.35.2

Autogenerate Docktor API service model
Documentation
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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_output_healthcheck_operation_output(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::output::HealthcheckOperationOutput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_1) = &input.message {
        object.key("message").string(var_1);
    }
    Ok(())
}

pub fn serialize_structure_crate_error_healtcheck_error(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::error::HealtcheckError,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_2) = &input.message {
        object.key("message").string(var_2);
    }
    Ok(())
}

pub fn serialize_structure_crate_output_list_operation_output(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::output::ListOperationOutput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_3) = &input.available_services {
        let mut array_4 = object.key("available_services").start_array();
        for item_5 in var_3 {
            {
                array_4.value().string(item_5);
            }
        }
        array_4.finish();
    }
    if let Some(var_6) = &input.checksum {
        object.key("checksum").string(var_6);
    }
    if let Some(var_7) = &input.host {
        let mut object_8 = object.key("host").start_object();
        crate::json_ser::serialize_structure_crate_model_host(&mut object_8, var_7)?;
        object_8.finish();
    }
    if let Some(var_9) = &input.peers {
        let mut object_10 = object.key("peers").start_object();
        for (key_11, value_12) in var_9 {
            {
                let mut object_13 = object_10.key(key_11).start_object();
                crate::json_ser::serialize_structure_crate_model_list_output(
                    &mut object_13,
                    value_12,
                )?;
                object_13.finish();
            }
        }
        object_10.finish();
    }
    if let Some(var_14) = &input.primary {
        object.key("primary").string(var_14);
    }
    if let Some(var_15) = &input.resources {
        let mut object_16 = object.key("resources").start_object();
        crate::json_ser::serialize_structure_crate_model_resources(&mut object_16, var_15)?;
        object_16.finish();
    }
    if let Some(var_17) = &input.services {
        let mut array_18 = object.key("services").start_array();
        for item_19 in var_17 {
            {
                let mut object_20 = array_18.value().start_object();
                crate::json_ser::serialize_structure_crate_model_service(&mut object_20, item_19)?;
                object_20.finish();
            }
        }
        array_18.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_output_prometheus_target_operation_output(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::output::PrometheusTargetOperationOutput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_21) = &input.targets {
        let mut array_22 = object.key("targets").start_array();
        for item_23 in var_21 {
            {
                let mut object_24 = array_22.value().start_object();
                crate::json_ser::serialize_structure_crate_model_prometheus_target(
                    &mut object_24,
                    item_23,
                )?;
                object_24.finish();
            }
        }
        array_22.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_error_docktor_error(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::error::DocktorError,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_25) = &input.message {
        object.key("message").string(var_25);
    }
    Ok(())
}

pub fn serialize_structure_crate_error_prometheus_error(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::error::PrometheusError,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_26) = &input.message {
        object.key("message").string(var_26);
    }
    Ok(())
}

pub fn serialize_structure_crate_output_restart_operation_output(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::output::RestartOperationOutput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_27) = &input.inner {
        let mut array_28 = object.key("inner").start_array();
        for item_29 in var_27 {
            {
                let mut object_30 = array_28.value().start_object();
                crate::json_ser::serialize_structure_crate_model_systemd_output_inner(
                    &mut object_30,
                    item_29,
                )?;
                object_30.finish();
            }
        }
        array_28.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_error_systemd_error(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::error::SystemdError,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_31) = &input.message {
        object.key("message").string(var_31);
    }
    Ok(())
}

pub fn serialize_structure_crate_output_start_operation_output(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::output::StartOperationOutput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_32) = &input.inner {
        let mut array_33 = object.key("inner").start_array();
        for item_34 in var_32 {
            {
                let mut object_35 = array_33.value().start_object();
                crate::json_ser::serialize_structure_crate_model_systemd_output_inner(
                    &mut object_35,
                    item_34,
                )?;
                object_35.finish();
            }
        }
        array_33.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_output_stop_operation_output(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::output::StopOperationOutput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_36) = &input.inner {
        let mut array_37 = object.key("inner").start_array();
        for item_38 in var_36 {
            {
                let mut object_39 = array_37.value().start_object();
                crate::json_ser::serialize_structure_crate_model_systemd_output_inner(
                    &mut object_39,
                    item_38,
                )?;
                object_39.finish();
            }
        }
        array_37.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_host(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Host,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_40) = &input.hostname {
        object.key("hostname").string(var_40);
    }
    if let Some(var_41) = &input.domain {
        object.key("domain").string(var_41);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_list_output(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ListOutput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_42) = &input.primary {
        object.key("primary").string(var_42);
    }
    if let Some(var_43) = &input.host {
        let mut object_44 = object.key("host").start_object();
        crate::json_ser::serialize_structure_crate_model_host(&mut object_44, var_43)?;
        object_44.finish();
    }
    if let Some(var_45) = &input.resources {
        let mut object_46 = object.key("resources").start_object();
        crate::json_ser::serialize_structure_crate_model_resources(&mut object_46, var_45)?;
        object_46.finish();
    }
    if let Some(var_47) = &input.services {
        let mut array_48 = object.key("services").start_array();
        for item_49 in var_47 {
            {
                let mut object_50 = array_48.value().start_object();
                crate::json_ser::serialize_structure_crate_model_service(&mut object_50, item_49)?;
                object_50.finish();
            }
        }
        array_48.finish();
    }
    if let Some(var_51) = &input.checksum {
        object.key("checksum").string(var_51);
    }
    if let Some(var_52) = &input.available_services {
        let mut array_53 = object.key("available_services").start_array();
        for item_54 in var_52 {
            {
                array_53.value().string(item_54);
            }
        }
        array_53.finish();
    }
    if let Some(var_55) = &input.peers {
        let mut object_56 = object.key("peers").start_object();
        for (key_57, value_58) in var_55 {
            {
                let mut object_59 = object_56.key(key_57).start_object();
                crate::json_ser::serialize_structure_crate_model_list_output(
                    &mut object_59,
                    value_58,
                )?;
                object_59.finish();
            }
        }
        object_56.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_resources(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Resources,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_60) = &input.cpus {
        object.key("cpus").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_60).into()),
        );
    }
    if let Some(var_61) = &input.memory {
        let mut object_62 = object.key("memory").start_object();
        crate::json_ser::serialize_structure_crate_model_memory(&mut object_62, var_61)?;
        object_62.finish();
    }
    if let Some(var_63) = &input.load_avg {
        let mut object_64 = object.key("load_avg").start_object();
        crate::json_ser::serialize_structure_crate_model_load_avg(&mut object_64, var_63)?;
        object_64.finish();
    }
    if let Some(var_65) = &input.temperature {
        object.key("temperature").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((*var_65).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_service(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Service,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_66) = &input.id {
        object.key("id").string(var_66);
    }
    if let Some(var_67) = &input.name {
        object.key("name").string(var_67);
    }
    if let Some(var_68) = &input.service {
        object.key("service").string(var_68);
    }
    if let Some(var_69) = &input.pod {
        object.key("pod").string(var_69);
    }
    if let Some(var_70) = &input.host {
        let mut object_71 = object.key("host").start_object();
        crate::json_ser::serialize_structure_crate_model_host(&mut object_71, var_70)?;
        object_71.finish();
    }
    if let Some(var_72) = &input.weave {
        let mut object_73 = object.key("weave").start_object();
        crate::json_ser::serialize_structure_crate_model_weave_info(&mut object_73, var_72)?;
        object_73.finish();
    }
    if let Some(var_74) = &input.https {
        let mut array_75 = object.key("https").start_array();
        for item_76 in var_74 {
            {
                let mut object_77 = array_75.value().start_object();
                crate::json_ser::serialize_structure_crate_model_http(&mut object_77, item_76)?;
                object_77.finish();
            }
        }
        array_75.finish();
    }
    if let Some(var_78) = &input.tcps {
        let mut array_79 = object.key("tcps").start_array();
        for item_80 in var_78 {
            {
                let mut object_81 = array_79.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tcp(&mut object_81, item_80)?;
                object_81.finish();
            }
        }
        array_79.finish();
    }
    if let Some(var_82) = &input.monitorings {
        let mut array_83 = object.key("monitorings").start_array();
        for item_84 in var_82 {
            {
                let mut object_85 = array_83.value().start_object();
                crate::json_ser::serialize_structure_crate_model_monitoring(
                    &mut object_85,
                    item_84,
                )?;
                object_85.finish();
            }
        }
        array_83.finish();
    }
    if let Some(var_86) = &input.healthcheck {
        let mut object_87 = object.key("healthcheck").start_object();
        crate::json_ser::serialize_structure_crate_model_healthcheck(&mut object_87, var_86)?;
        object_87.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_prometheus_target(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::PrometheusTarget,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_88) = &input.targets {
        let mut array_89 = object.key("targets").start_array();
        for item_90 in var_88 {
            {
                array_89.value().string(item_90);
            }
        }
        array_89.finish();
    }
    if let Some(var_91) = &input.labels {
        let mut object_92 = object.key("labels").start_object();
        for (key_93, value_94) in var_91 {
            {
                object_92.key(key_93).string(value_94);
            }
        }
        object_92.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_systemd_output_inner(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SystemdOutputInner,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_95) = &input.hostname {
        object.key("hostname").string(var_95);
    }
    if let Some(var_96) = &input.service {
        object.key("service").string(var_96);
    }
    if let Some(var_97) = &input.output {
        object.key("output").string(var_97);
    }
    if let Some(var_98) = &input.error {
        object.key("error").string(var_98);
    }
    if let Some(var_99) = &input.exit_code {
        object.key("exit_code").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_99).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_memory(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Memory,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_100) = &input.free {
        object.key("free").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((*var_100).into()),
        );
    }
    if let Some(var_101) = &input.used {
        object.key("used").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((*var_101).into()),
        );
    }
    if let Some(var_102) = &input.total {
        object.key("total").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((*var_102).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_load_avg(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::LoadAvg,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_103) = &input.one {
        object.key("one").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((*var_103).into()),
        );
    }
    if let Some(var_104) = &input.five {
        object.key("five").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((*var_104).into()),
        );
    }
    if let Some(var_105) = &input.fifteen {
        object.key("fifteen").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((*var_105).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_weave_info(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::WeaveInfo,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_106) = &input.domain {
        object.key("domain").string(var_106);
    }
    if let Some(var_107) = &input.ip {
        object.key("ip").string(var_107);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_http(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Http,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_108) = &input.port {
        object.key("port").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_108).into()),
        );
    }
    if let Some(var_109) = &input.verb {
        object.key("verb").string(var_109);
    }
    if let Some(var_110) = &input.auth {
        object.key("auth").boolean(*var_110);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_tcp(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Tcp,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_111) = &input.external {
        object.key("external").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_111).into()),
        );
    }
    if let Some(var_112) = &input.internal {
        object.key("internal").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_112).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_monitoring(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Monitoring,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_113) = &input.hostname {
        object.key("hostname").string(var_113);
    }
    if let Some(var_114) = &input.url {
        object.key("url").string(var_114);
    }
    if let Some(var_115) = &input.port {
        object.key("port").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_115).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_healthcheck(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Healthcheck,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_116) = &input.message {
        object.key("message").string(var_116);
    }
    if let Some(var_117) = &input.status {
        object.key("status").string(var_117);
    }
    if let Some(var_118) = &input.exit_code {
        object.key("exit_code").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_118).into()),
        );
    }
    if let Some(var_119) = &input.failing_streak {
        object.key("failing_streak").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_119).into()),
        );
    }
    Ok(())
}