docktor_api_client/
error.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Error type for the `HealthcheckOperation` operation.
3#[non_exhaustive]
4#[derive(std::fmt::Debug)]
5pub struct HealthcheckOperationError {
6    /// Kind of error that occurred.
7    pub kind: HealthcheckOperationErrorKind,
8    /// Additional metadata about the error, including error code, message, and request ID.
9    pub(crate) meta: aws_smithy_types::Error,
10}
11/// Types of errors that can occur for the `HealthcheckOperation` operation.
12#[non_exhaustive]
13#[derive(std::fmt::Debug)]
14pub enum HealthcheckOperationErrorKind {
15    /// Error coming from Prometheus.
16    HealtcheckError(crate::error::HealtcheckError),
17    /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
18    Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
19}
20impl std::fmt::Display for HealthcheckOperationError {
21    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22        match &self.kind {
23            HealthcheckOperationErrorKind::HealtcheckError(_inner) => _inner.fmt(f),
24            HealthcheckOperationErrorKind::Unhandled(_inner) => _inner.fmt(f),
25        }
26    }
27}
28impl aws_smithy_types::retry::ProvideErrorKind for HealthcheckOperationError {
29    fn code(&self) -> Option<&str> {
30        HealthcheckOperationError::code(self)
31    }
32    fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
33        None
34    }
35}
36impl HealthcheckOperationError {
37    /// Creates a new `HealthcheckOperationError`.
38    pub fn new(kind: HealthcheckOperationErrorKind, meta: aws_smithy_types::Error) -> Self {
39        Self { kind, meta }
40    }
41
42    /// Creates the `HealthcheckOperationError::Unhandled` variant from any error type.
43    pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
44        Self {
45            kind: HealthcheckOperationErrorKind::Unhandled(err.into()),
46            meta: Default::default(),
47        }
48    }
49
50    /// Creates the `HealthcheckOperationError::Unhandled` variant from a `aws_smithy_types::Error`.
51    pub fn generic(err: aws_smithy_types::Error) -> Self {
52        Self {
53            meta: err.clone(),
54            kind: HealthcheckOperationErrorKind::Unhandled(err.into()),
55        }
56    }
57
58    /// Returns the error message if one is available.
59    pub fn message(&self) -> Option<&str> {
60        self.meta.message()
61    }
62
63    /// Returns error metadata, which includes the error code, message,
64    /// request ID, and potentially additional information.
65    pub fn meta(&self) -> &aws_smithy_types::Error {
66        &self.meta
67    }
68
69    /// Returns the request ID if it's available.
70    pub fn request_id(&self) -> Option<&str> {
71        self.meta.request_id()
72    }
73
74    /// Returns the error code if it's available.
75    pub fn code(&self) -> Option<&str> {
76        self.meta.code()
77    }
78    /// Returns `true` if the error kind is `HealthcheckOperationErrorKind::HealtcheckError`.
79    pub fn is_healtcheck_error(&self) -> bool {
80        matches!(
81            &self.kind,
82            HealthcheckOperationErrorKind::HealtcheckError(_)
83        )
84    }
85}
86impl std::error::Error for HealthcheckOperationError {
87    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
88        match &self.kind {
89            HealthcheckOperationErrorKind::HealtcheckError(_inner) => Some(_inner),
90            HealthcheckOperationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
91        }
92    }
93}
94
95/// Error type for the `ListOperation` operation.
96#[non_exhaustive]
97#[derive(std::fmt::Debug)]
98pub struct ListOperationError {
99    /// Kind of error that occurred.
100    pub kind: ListOperationErrorKind,
101    /// Additional metadata about the error, including error code, message, and request ID.
102    pub(crate) meta: aws_smithy_types::Error,
103}
104/// Types of errors that can occur for the `ListOperation` operation.
105#[non_exhaustive]
106#[derive(std::fmt::Debug)]
107pub enum ListOperationErrorKind {
108    /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
109    Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
110}
111impl std::fmt::Display for ListOperationError {
112    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
113        match &self.kind {
114            ListOperationErrorKind::Unhandled(_inner) => _inner.fmt(f),
115        }
116    }
117}
118impl aws_smithy_types::retry::ProvideErrorKind for ListOperationError {
119    fn code(&self) -> Option<&str> {
120        ListOperationError::code(self)
121    }
122    fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
123        None
124    }
125}
126impl ListOperationError {
127    /// Creates a new `ListOperationError`.
128    pub fn new(kind: ListOperationErrorKind, meta: aws_smithy_types::Error) -> Self {
129        Self { kind, meta }
130    }
131
132    /// Creates the `ListOperationError::Unhandled` variant from any error type.
133    pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
134        Self {
135            kind: ListOperationErrorKind::Unhandled(err.into()),
136            meta: Default::default(),
137        }
138    }
139
140    /// Creates the `ListOperationError::Unhandled` variant from a `aws_smithy_types::Error`.
141    pub fn generic(err: aws_smithy_types::Error) -> Self {
142        Self {
143            meta: err.clone(),
144            kind: ListOperationErrorKind::Unhandled(err.into()),
145        }
146    }
147
148    /// Returns the error message if one is available.
149    pub fn message(&self) -> Option<&str> {
150        self.meta.message()
151    }
152
153    /// Returns error metadata, which includes the error code, message,
154    /// request ID, and potentially additional information.
155    pub fn meta(&self) -> &aws_smithy_types::Error {
156        &self.meta
157    }
158
159    /// Returns the request ID if it's available.
160    pub fn request_id(&self) -> Option<&str> {
161        self.meta.request_id()
162    }
163
164    /// Returns the error code if it's available.
165    pub fn code(&self) -> Option<&str> {
166        self.meta.code()
167    }
168}
169impl std::error::Error for ListOperationError {
170    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
171        match &self.kind {
172            ListOperationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
173        }
174    }
175}
176
177/// Error type for the `PrometheusTargetOperation` operation.
178#[non_exhaustive]
179#[derive(std::fmt::Debug)]
180pub struct PrometheusTargetOperationError {
181    /// Kind of error that occurred.
182    pub kind: PrometheusTargetOperationErrorKind,
183    /// Additional metadata about the error, including error code, message, and request ID.
184    pub(crate) meta: aws_smithy_types::Error,
185}
186/// Types of errors that can occur for the `PrometheusTargetOperation` operation.
187#[non_exhaustive]
188#[derive(std::fmt::Debug)]
189pub enum PrometheusTargetOperationErrorKind {
190    /// //////////////////////////////////// Errors //////////////////////////////////// Returned when something critical happened.
191    DocktorError(crate::error::DocktorError),
192    /// Error coming from Prometheus.
193    PrometheusError(crate::error::PrometheusError),
194    /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
195    Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
196}
197impl std::fmt::Display for PrometheusTargetOperationError {
198    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
199        match &self.kind {
200            PrometheusTargetOperationErrorKind::DocktorError(_inner) => _inner.fmt(f),
201            PrometheusTargetOperationErrorKind::PrometheusError(_inner) => _inner.fmt(f),
202            PrometheusTargetOperationErrorKind::Unhandled(_inner) => _inner.fmt(f),
203        }
204    }
205}
206impl aws_smithy_types::retry::ProvideErrorKind for PrometheusTargetOperationError {
207    fn code(&self) -> Option<&str> {
208        PrometheusTargetOperationError::code(self)
209    }
210    fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
211        None
212    }
213}
214impl PrometheusTargetOperationError {
215    /// Creates a new `PrometheusTargetOperationError`.
216    pub fn new(kind: PrometheusTargetOperationErrorKind, meta: aws_smithy_types::Error) -> Self {
217        Self { kind, meta }
218    }
219
220    /// Creates the `PrometheusTargetOperationError::Unhandled` variant from any error type.
221    pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
222        Self {
223            kind: PrometheusTargetOperationErrorKind::Unhandled(err.into()),
224            meta: Default::default(),
225        }
226    }
227
228    /// Creates the `PrometheusTargetOperationError::Unhandled` variant from a `aws_smithy_types::Error`.
229    pub fn generic(err: aws_smithy_types::Error) -> Self {
230        Self {
231            meta: err.clone(),
232            kind: PrometheusTargetOperationErrorKind::Unhandled(err.into()),
233        }
234    }
235
236    /// Returns the error message if one is available.
237    pub fn message(&self) -> Option<&str> {
238        self.meta.message()
239    }
240
241    /// Returns error metadata, which includes the error code, message,
242    /// request ID, and potentially additional information.
243    pub fn meta(&self) -> &aws_smithy_types::Error {
244        &self.meta
245    }
246
247    /// Returns the request ID if it's available.
248    pub fn request_id(&self) -> Option<&str> {
249        self.meta.request_id()
250    }
251
252    /// Returns the error code if it's available.
253    pub fn code(&self) -> Option<&str> {
254        self.meta.code()
255    }
256    /// Returns `true` if the error kind is `PrometheusTargetOperationErrorKind::DocktorError`.
257    pub fn is_docktor_error(&self) -> bool {
258        matches!(
259            &self.kind,
260            PrometheusTargetOperationErrorKind::DocktorError(_)
261        )
262    }
263    /// Returns `true` if the error kind is `PrometheusTargetOperationErrorKind::PrometheusError`.
264    pub fn is_prometheus_error(&self) -> bool {
265        matches!(
266            &self.kind,
267            PrometheusTargetOperationErrorKind::PrometheusError(_)
268        )
269    }
270}
271impl std::error::Error for PrometheusTargetOperationError {
272    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
273        match &self.kind {
274            PrometheusTargetOperationErrorKind::DocktorError(_inner) => Some(_inner),
275            PrometheusTargetOperationErrorKind::PrometheusError(_inner) => Some(_inner),
276            PrometheusTargetOperationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
277        }
278    }
279}
280
281/// Error type for the `RestartOperation` operation.
282#[non_exhaustive]
283#[derive(std::fmt::Debug)]
284pub struct RestartOperationError {
285    /// Kind of error that occurred.
286    pub kind: RestartOperationErrorKind,
287    /// Additional metadata about the error, including error code, message, and request ID.
288    pub(crate) meta: aws_smithy_types::Error,
289}
290/// Types of errors that can occur for the `RestartOperation` operation.
291#[non_exhaustive]
292#[derive(std::fmt::Debug)]
293pub enum RestartOperationErrorKind {
294    /// //////////////////////////////////// Errors //////////////////////////////////// Returned when something critical happened.
295    DocktorError(crate::error::DocktorError),
296    /// Error coming from Systemd.
297    SystemdError(crate::error::SystemdError),
298    /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
299    Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
300}
301impl std::fmt::Display for RestartOperationError {
302    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
303        match &self.kind {
304            RestartOperationErrorKind::DocktorError(_inner) => _inner.fmt(f),
305            RestartOperationErrorKind::SystemdError(_inner) => _inner.fmt(f),
306            RestartOperationErrorKind::Unhandled(_inner) => _inner.fmt(f),
307        }
308    }
309}
310impl aws_smithy_types::retry::ProvideErrorKind for RestartOperationError {
311    fn code(&self) -> Option<&str> {
312        RestartOperationError::code(self)
313    }
314    fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
315        None
316    }
317}
318impl RestartOperationError {
319    /// Creates a new `RestartOperationError`.
320    pub fn new(kind: RestartOperationErrorKind, meta: aws_smithy_types::Error) -> Self {
321        Self { kind, meta }
322    }
323
324    /// Creates the `RestartOperationError::Unhandled` variant from any error type.
325    pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
326        Self {
327            kind: RestartOperationErrorKind::Unhandled(err.into()),
328            meta: Default::default(),
329        }
330    }
331
332    /// Creates the `RestartOperationError::Unhandled` variant from a `aws_smithy_types::Error`.
333    pub fn generic(err: aws_smithy_types::Error) -> Self {
334        Self {
335            meta: err.clone(),
336            kind: RestartOperationErrorKind::Unhandled(err.into()),
337        }
338    }
339
340    /// Returns the error message if one is available.
341    pub fn message(&self) -> Option<&str> {
342        self.meta.message()
343    }
344
345    /// Returns error metadata, which includes the error code, message,
346    /// request ID, and potentially additional information.
347    pub fn meta(&self) -> &aws_smithy_types::Error {
348        &self.meta
349    }
350
351    /// Returns the request ID if it's available.
352    pub fn request_id(&self) -> Option<&str> {
353        self.meta.request_id()
354    }
355
356    /// Returns the error code if it's available.
357    pub fn code(&self) -> Option<&str> {
358        self.meta.code()
359    }
360    /// Returns `true` if the error kind is `RestartOperationErrorKind::DocktorError`.
361    pub fn is_docktor_error(&self) -> bool {
362        matches!(&self.kind, RestartOperationErrorKind::DocktorError(_))
363    }
364    /// Returns `true` if the error kind is `RestartOperationErrorKind::SystemdError`.
365    pub fn is_systemd_error(&self) -> bool {
366        matches!(&self.kind, RestartOperationErrorKind::SystemdError(_))
367    }
368}
369impl std::error::Error for RestartOperationError {
370    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
371        match &self.kind {
372            RestartOperationErrorKind::DocktorError(_inner) => Some(_inner),
373            RestartOperationErrorKind::SystemdError(_inner) => Some(_inner),
374            RestartOperationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
375        }
376    }
377}
378
379/// Error type for the `StartOperation` operation.
380#[non_exhaustive]
381#[derive(std::fmt::Debug)]
382pub struct StartOperationError {
383    /// Kind of error that occurred.
384    pub kind: StartOperationErrorKind,
385    /// Additional metadata about the error, including error code, message, and request ID.
386    pub(crate) meta: aws_smithy_types::Error,
387}
388/// Types of errors that can occur for the `StartOperation` operation.
389#[non_exhaustive]
390#[derive(std::fmt::Debug)]
391pub enum StartOperationErrorKind {
392    /// //////////////////////////////////// Errors //////////////////////////////////// Returned when something critical happened.
393    DocktorError(crate::error::DocktorError),
394    /// Error coming from Systemd.
395    SystemdError(crate::error::SystemdError),
396    /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
397    Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
398}
399impl std::fmt::Display for StartOperationError {
400    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
401        match &self.kind {
402            StartOperationErrorKind::DocktorError(_inner) => _inner.fmt(f),
403            StartOperationErrorKind::SystemdError(_inner) => _inner.fmt(f),
404            StartOperationErrorKind::Unhandled(_inner) => _inner.fmt(f),
405        }
406    }
407}
408impl aws_smithy_types::retry::ProvideErrorKind for StartOperationError {
409    fn code(&self) -> Option<&str> {
410        StartOperationError::code(self)
411    }
412    fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
413        None
414    }
415}
416impl StartOperationError {
417    /// Creates a new `StartOperationError`.
418    pub fn new(kind: StartOperationErrorKind, meta: aws_smithy_types::Error) -> Self {
419        Self { kind, meta }
420    }
421
422    /// Creates the `StartOperationError::Unhandled` variant from any error type.
423    pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
424        Self {
425            kind: StartOperationErrorKind::Unhandled(err.into()),
426            meta: Default::default(),
427        }
428    }
429
430    /// Creates the `StartOperationError::Unhandled` variant from a `aws_smithy_types::Error`.
431    pub fn generic(err: aws_smithy_types::Error) -> Self {
432        Self {
433            meta: err.clone(),
434            kind: StartOperationErrorKind::Unhandled(err.into()),
435        }
436    }
437
438    /// Returns the error message if one is available.
439    pub fn message(&self) -> Option<&str> {
440        self.meta.message()
441    }
442
443    /// Returns error metadata, which includes the error code, message,
444    /// request ID, and potentially additional information.
445    pub fn meta(&self) -> &aws_smithy_types::Error {
446        &self.meta
447    }
448
449    /// Returns the request ID if it's available.
450    pub fn request_id(&self) -> Option<&str> {
451        self.meta.request_id()
452    }
453
454    /// Returns the error code if it's available.
455    pub fn code(&self) -> Option<&str> {
456        self.meta.code()
457    }
458    /// Returns `true` if the error kind is `StartOperationErrorKind::DocktorError`.
459    pub fn is_docktor_error(&self) -> bool {
460        matches!(&self.kind, StartOperationErrorKind::DocktorError(_))
461    }
462    /// Returns `true` if the error kind is `StartOperationErrorKind::SystemdError`.
463    pub fn is_systemd_error(&self) -> bool {
464        matches!(&self.kind, StartOperationErrorKind::SystemdError(_))
465    }
466}
467impl std::error::Error for StartOperationError {
468    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
469        match &self.kind {
470            StartOperationErrorKind::DocktorError(_inner) => Some(_inner),
471            StartOperationErrorKind::SystemdError(_inner) => Some(_inner),
472            StartOperationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
473        }
474    }
475}
476
477/// Error type for the `StopOperation` operation.
478#[non_exhaustive]
479#[derive(std::fmt::Debug)]
480pub struct StopOperationError {
481    /// Kind of error that occurred.
482    pub kind: StopOperationErrorKind,
483    /// Additional metadata about the error, including error code, message, and request ID.
484    pub(crate) meta: aws_smithy_types::Error,
485}
486/// Types of errors that can occur for the `StopOperation` operation.
487#[non_exhaustive]
488#[derive(std::fmt::Debug)]
489pub enum StopOperationErrorKind {
490    /// //////////////////////////////////// Errors //////////////////////////////////// Returned when something critical happened.
491    DocktorError(crate::error::DocktorError),
492    /// Error coming from Systemd.
493    SystemdError(crate::error::SystemdError),
494    /// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
495    Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
496}
497impl std::fmt::Display for StopOperationError {
498    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
499        match &self.kind {
500            StopOperationErrorKind::DocktorError(_inner) => _inner.fmt(f),
501            StopOperationErrorKind::SystemdError(_inner) => _inner.fmt(f),
502            StopOperationErrorKind::Unhandled(_inner) => _inner.fmt(f),
503        }
504    }
505}
506impl aws_smithy_types::retry::ProvideErrorKind for StopOperationError {
507    fn code(&self) -> Option<&str> {
508        StopOperationError::code(self)
509    }
510    fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
511        None
512    }
513}
514impl StopOperationError {
515    /// Creates a new `StopOperationError`.
516    pub fn new(kind: StopOperationErrorKind, meta: aws_smithy_types::Error) -> Self {
517        Self { kind, meta }
518    }
519
520    /// Creates the `StopOperationError::Unhandled` variant from any error type.
521    pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
522        Self {
523            kind: StopOperationErrorKind::Unhandled(err.into()),
524            meta: Default::default(),
525        }
526    }
527
528    /// Creates the `StopOperationError::Unhandled` variant from a `aws_smithy_types::Error`.
529    pub fn generic(err: aws_smithy_types::Error) -> Self {
530        Self {
531            meta: err.clone(),
532            kind: StopOperationErrorKind::Unhandled(err.into()),
533        }
534    }
535
536    /// Returns the error message if one is available.
537    pub fn message(&self) -> Option<&str> {
538        self.meta.message()
539    }
540
541    /// Returns error metadata, which includes the error code, message,
542    /// request ID, and potentially additional information.
543    pub fn meta(&self) -> &aws_smithy_types::Error {
544        &self.meta
545    }
546
547    /// Returns the request ID if it's available.
548    pub fn request_id(&self) -> Option<&str> {
549        self.meta.request_id()
550    }
551
552    /// Returns the error code if it's available.
553    pub fn code(&self) -> Option<&str> {
554        self.meta.code()
555    }
556    /// Returns `true` if the error kind is `StopOperationErrorKind::DocktorError`.
557    pub fn is_docktor_error(&self) -> bool {
558        matches!(&self.kind, StopOperationErrorKind::DocktorError(_))
559    }
560    /// Returns `true` if the error kind is `StopOperationErrorKind::SystemdError`.
561    pub fn is_systemd_error(&self) -> bool {
562        matches!(&self.kind, StopOperationErrorKind::SystemdError(_))
563    }
564}
565impl std::error::Error for StopOperationError {
566    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
567        match &self.kind {
568            StopOperationErrorKind::DocktorError(_inner) => Some(_inner),
569            StopOperationErrorKind::SystemdError(_inner) => Some(_inner),
570            StopOperationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
571        }
572    }
573}
574
575/// Error coming from Prometheus.
576#[non_exhaustive]
577#[derive(std::clone::Clone, std::cmp::PartialEq)]
578pub struct PrometheusError {
579    #[allow(missing_docs)] // documentation missing in model
580    pub message: std::option::Option<std::string::String>,
581}
582impl std::fmt::Debug for PrometheusError {
583    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
584        let mut formatter = f.debug_struct("PrometheusError");
585        formatter.field("message", &self.message);
586        formatter.finish()
587    }
588}
589impl PrometheusError {
590    /// Returns the error message.
591    pub fn message(&self) -> Option<&str> {
592        self.message.as_deref()
593    }
594}
595impl std::fmt::Display for PrometheusError {
596    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
597        write!(f, "PrometheusError")?;
598        if let Some(inner_1) = &self.message {
599            write!(f, ": {}", inner_1)?;
600        }
601        Ok(())
602    }
603}
604impl std::error::Error for PrometheusError {}
605/// See [`PrometheusError`](crate::error::PrometheusError)
606pub mod prometheus_error {
607    /// A builder for [`PrometheusError`](crate::error::PrometheusError)
608    #[non_exhaustive]
609    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
610    pub struct Builder {
611        pub(crate) message: std::option::Option<std::string::String>,
612    }
613    impl Builder {
614        #[allow(missing_docs)] // documentation missing in model
615        pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
616            self.message = Some(input.into());
617            self
618        }
619        #[allow(missing_docs)] // documentation missing in model
620        pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
621            self.message = input;
622            self
623        }
624        /// Consumes the builder and constructs a [`PrometheusError`](crate::error::PrometheusError)
625        pub fn build(self) -> crate::error::PrometheusError {
626            crate::error::PrometheusError {
627                message: self.message,
628            }
629        }
630    }
631}
632impl PrometheusError {
633    /// Creates a new builder-style object to manufacture [`PrometheusError`](crate::error::PrometheusError)
634    pub fn builder() -> crate::error::prometheus_error::Builder {
635        crate::error::prometheus_error::Builder::default()
636    }
637}
638
639/// //////////////////////////////////// Errors //////////////////////////////////// Returned when something critical happened.
640#[non_exhaustive]
641#[derive(std::clone::Clone, std::cmp::PartialEq)]
642pub struct DocktorError {
643    #[allow(missing_docs)] // documentation missing in model
644    pub message: std::option::Option<std::string::String>,
645}
646impl std::fmt::Debug for DocktorError {
647    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
648        let mut formatter = f.debug_struct("DocktorError");
649        formatter.field("message", &self.message);
650        formatter.finish()
651    }
652}
653impl DocktorError {
654    /// Returns the error message.
655    pub fn message(&self) -> Option<&str> {
656        self.message.as_deref()
657    }
658}
659impl std::fmt::Display for DocktorError {
660    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
661        write!(f, "DocktorError")?;
662        if let Some(inner_2) = &self.message {
663            write!(f, ": {}", inner_2)?;
664        }
665        Ok(())
666    }
667}
668impl std::error::Error for DocktorError {}
669/// See [`DocktorError`](crate::error::DocktorError)
670pub mod docktor_error {
671    /// A builder for [`DocktorError`](crate::error::DocktorError)
672    #[non_exhaustive]
673    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
674    pub struct Builder {
675        pub(crate) message: std::option::Option<std::string::String>,
676    }
677    impl Builder {
678        #[allow(missing_docs)] // documentation missing in model
679        pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
680            self.message = Some(input.into());
681            self
682        }
683        #[allow(missing_docs)] // documentation missing in model
684        pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
685            self.message = input;
686            self
687        }
688        /// Consumes the builder and constructs a [`DocktorError`](crate::error::DocktorError)
689        pub fn build(self) -> crate::error::DocktorError {
690            crate::error::DocktorError {
691                message: self.message,
692            }
693        }
694    }
695}
696impl DocktorError {
697    /// Creates a new builder-style object to manufacture [`DocktorError`](crate::error::DocktorError)
698    pub fn builder() -> crate::error::docktor_error::Builder {
699        crate::error::docktor_error::Builder::default()
700    }
701}
702
703/// Error coming from Systemd.
704#[non_exhaustive]
705#[derive(std::clone::Clone, std::cmp::PartialEq)]
706pub struct SystemdError {
707    #[allow(missing_docs)] // documentation missing in model
708    pub message: std::option::Option<std::string::String>,
709}
710impl std::fmt::Debug for SystemdError {
711    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
712        let mut formatter = f.debug_struct("SystemdError");
713        formatter.field("message", &self.message);
714        formatter.finish()
715    }
716}
717impl SystemdError {
718    /// Returns the error message.
719    pub fn message(&self) -> Option<&str> {
720        self.message.as_deref()
721    }
722}
723impl std::fmt::Display for SystemdError {
724    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
725        write!(f, "SystemdError")?;
726        if let Some(inner_3) = &self.message {
727            write!(f, ": {}", inner_3)?;
728        }
729        Ok(())
730    }
731}
732impl std::error::Error for SystemdError {}
733/// See [`SystemdError`](crate::error::SystemdError)
734pub mod systemd_error {
735    /// A builder for [`SystemdError`](crate::error::SystemdError)
736    #[non_exhaustive]
737    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
738    pub struct Builder {
739        pub(crate) message: std::option::Option<std::string::String>,
740    }
741    impl Builder {
742        #[allow(missing_docs)] // documentation missing in model
743        pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
744            self.message = Some(input.into());
745            self
746        }
747        #[allow(missing_docs)] // documentation missing in model
748        pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
749            self.message = input;
750            self
751        }
752        /// Consumes the builder and constructs a [`SystemdError`](crate::error::SystemdError)
753        pub fn build(self) -> crate::error::SystemdError {
754            crate::error::SystemdError {
755                message: self.message,
756            }
757        }
758    }
759}
760impl SystemdError {
761    /// Creates a new builder-style object to manufacture [`SystemdError`](crate::error::SystemdError)
762    pub fn builder() -> crate::error::systemd_error::Builder {
763        crate::error::systemd_error::Builder::default()
764    }
765}
766
767/// Error coming from Prometheus.
768#[non_exhaustive]
769#[derive(std::clone::Clone, std::cmp::PartialEq)]
770pub struct HealtcheckError {
771    #[allow(missing_docs)] // documentation missing in model
772    pub message: std::option::Option<std::string::String>,
773}
774impl std::fmt::Debug for HealtcheckError {
775    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
776        let mut formatter = f.debug_struct("HealtcheckError");
777        formatter.field("message", &self.message);
778        formatter.finish()
779    }
780}
781impl HealtcheckError {
782    /// Returns the error message.
783    pub fn message(&self) -> Option<&str> {
784        self.message.as_deref()
785    }
786}
787impl std::fmt::Display for HealtcheckError {
788    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
789        write!(f, "HealtcheckError")?;
790        if let Some(inner_4) = &self.message {
791            write!(f, ": {}", inner_4)?;
792        }
793        Ok(())
794    }
795}
796impl std::error::Error for HealtcheckError {}
797/// See [`HealtcheckError`](crate::error::HealtcheckError)
798pub mod healtcheck_error {
799    /// A builder for [`HealtcheckError`](crate::error::HealtcheckError)
800    #[non_exhaustive]
801    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
802    pub struct Builder {
803        pub(crate) message: std::option::Option<std::string::String>,
804    }
805    impl Builder {
806        #[allow(missing_docs)] // documentation missing in model
807        pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
808            self.message = Some(input.into());
809            self
810        }
811        #[allow(missing_docs)] // documentation missing in model
812        pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
813            self.message = input;
814            self
815        }
816        /// Consumes the builder and constructs a [`HealtcheckError`](crate::error::HealtcheckError)
817        pub fn build(self) -> crate::error::HealtcheckError {
818            crate::error::HealtcheckError {
819                message: self.message,
820            }
821        }
822    }
823}
824impl HealtcheckError {
825    /// Creates a new builder-style object to manufacture [`HealtcheckError`](crate::error::HealtcheckError)
826    pub fn builder() -> crate::error::healtcheck_error::Builder {
827        crate::error::healtcheck_error::Builder::default()
828    }
829}