docktor_api/
operation.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Operation shape for `HealthcheckOperation`.
3#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)]
4pub struct HealthcheckOperation {
5    _private: (),
6}
7impl HealthcheckOperation {
8    /// Creates a new `HealthcheckOperation` operation.
9    pub fn new() -> Self {
10        Self { _private: () }
11    }
12}
13pub struct HealthcheckOperationOperationInputWrapper(pub crate::input::HealthcheckOperationInput);
14#[async_trait::async_trait]
15impl<B> axum_core::extract::FromRequest<B> for HealthcheckOperationOperationInputWrapper
16where
17    B: aws_smithy_http_server::HttpBody + Send,
18    B::Data: Send,
19    B::Error: Into<aws_smithy_http_server::BoxError>,
20    aws_smithy_http_server::rejection::SmithyRejection:
21        From<<B as aws_smithy_http_server::HttpBody>::Error>,
22{
23    type Rejection = aws_smithy_http_server::rejection::SmithyRejection;
24    async fn from_request(
25        req: &mut axum_core::extract::RequestParts<B>,
26    ) -> Result<Self, Self::Rejection> {
27        Ok(HealthcheckOperationOperationInputWrapper(
28            crate::operation_deser::parse_healthcheck_operation_request(req).await?,
29        ))
30    }
31}
32pub enum HealthcheckOperationOperationOutputWrapper {
33    Output(crate::output::HealthcheckOperationOutput),
34    Error(crate::error::HealthcheckOperationError),
35}
36#[async_trait::async_trait]
37impl axum_core::response::IntoResponse for HealthcheckOperationOperationOutputWrapper {
38    fn into_response(self) -> axum_core::response::Response {
39        let mut response = match self {
40            Self::Output(o) => {
41                match crate::operation_ser::serialize_healthcheck_operation_response(&o) {
42                    Ok(response) => response,
43                    Err(e) => e.into_response(),
44                }
45            }
46            Self::Error(err) => {
47                match crate::operation_ser::serialize_healthcheck_operation_error(&err) {
48                    Ok(mut response) => {
49                        response.extensions_mut().insert(
50                            aws_smithy_http_server::ExtensionModeledError::new(err.name()),
51                        );
52                        response
53                    }
54                    Err(e) => e.into_response(),
55                }
56            }
57        };
58        response
59            .extensions_mut()
60            .insert(aws_smithy_http_server::RequestExtensions::new(
61                "org.crisidev.docktor",
62                "HealthcheckOperation",
63            ));
64        response
65    }
66}
67impl
68    From<Result<crate::output::HealthcheckOperationOutput, crate::error::HealthcheckOperationError>>
69    for HealthcheckOperationOperationOutputWrapper
70{
71    fn from(
72        res: Result<
73            crate::output::HealthcheckOperationOutput,
74            crate::error::HealthcheckOperationError,
75        >,
76    ) -> Self {
77        match res {
78            Ok(v) => Self::Output(v),
79            Err(e) => Self::Error(e),
80        }
81    }
82}
83impl From<HealthcheckOperationOperationInputWrapper> for crate::input::HealthcheckOperationInput {
84    fn from(i: HealthcheckOperationOperationInputWrapper) -> Self {
85        i.0
86    }
87}
88
89/// Operation shape for `ListOperation`.
90#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)]
91pub struct ListOperation {
92    _private: (),
93}
94impl ListOperation {
95    /// Creates a new `ListOperation` operation.
96    pub fn new() -> Self {
97        Self { _private: () }
98    }
99}
100pub struct ListOperationOperationInputWrapper(pub crate::input::ListOperationInput);
101#[async_trait::async_trait]
102impl<B> axum_core::extract::FromRequest<B> for ListOperationOperationInputWrapper
103where
104    B: aws_smithy_http_server::HttpBody + Send,
105    B::Data: Send,
106    B::Error: Into<aws_smithy_http_server::BoxError>,
107    aws_smithy_http_server::rejection::SmithyRejection:
108        From<<B as aws_smithy_http_server::HttpBody>::Error>,
109{
110    type Rejection = aws_smithy_http_server::rejection::SmithyRejection;
111    async fn from_request(
112        req: &mut axum_core::extract::RequestParts<B>,
113    ) -> Result<Self, Self::Rejection> {
114        Ok(ListOperationOperationInputWrapper(
115            crate::operation_deser::parse_list_operation_request(req).await?,
116        ))
117    }
118}
119pub struct ListOperationOperationOutputWrapper(pub crate::output::ListOperationOutput);
120#[async_trait::async_trait]
121impl axum_core::response::IntoResponse for ListOperationOperationOutputWrapper {
122    fn into_response(self) -> axum_core::response::Response {
123        match crate::operation_ser::serialize_list_operation_response(&self.0) {
124            Ok(response) => response,
125            Err(e) => e.into_response(),
126        }
127    }
128}
129impl From<crate::output::ListOperationOutput> for ListOperationOperationOutputWrapper {
130    fn from(o: crate::output::ListOperationOutput) -> Self {
131        Self(o)
132    }
133}
134impl From<ListOperationOperationInputWrapper> for crate::input::ListOperationInput {
135    fn from(i: ListOperationOperationInputWrapper) -> Self {
136        i.0
137    }
138}
139
140/// Operation shape for `PrometheusTargetOperation`.
141#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)]
142pub struct PrometheusTargetOperation {
143    _private: (),
144}
145impl PrometheusTargetOperation {
146    /// Creates a new `PrometheusTargetOperation` operation.
147    pub fn new() -> Self {
148        Self { _private: () }
149    }
150}
151pub struct PrometheusTargetOperationOperationInputWrapper(
152    pub crate::input::PrometheusTargetOperationInput,
153);
154#[async_trait::async_trait]
155impl<B> axum_core::extract::FromRequest<B> for PrometheusTargetOperationOperationInputWrapper
156where
157    B: aws_smithy_http_server::HttpBody + Send,
158    B::Data: Send,
159    B::Error: Into<aws_smithy_http_server::BoxError>,
160    aws_smithy_http_server::rejection::SmithyRejection:
161        From<<B as aws_smithy_http_server::HttpBody>::Error>,
162{
163    type Rejection = aws_smithy_http_server::rejection::SmithyRejection;
164    async fn from_request(
165        req: &mut axum_core::extract::RequestParts<B>,
166    ) -> Result<Self, Self::Rejection> {
167        Ok(PrometheusTargetOperationOperationInputWrapper(
168            crate::operation_deser::parse_prometheus_target_operation_request(req).await?,
169        ))
170    }
171}
172pub enum PrometheusTargetOperationOperationOutputWrapper {
173    Output(crate::output::PrometheusTargetOperationOutput),
174    Error(crate::error::PrometheusTargetOperationError),
175}
176#[async_trait::async_trait]
177impl axum_core::response::IntoResponse for PrometheusTargetOperationOperationOutputWrapper {
178    fn into_response(self) -> axum_core::response::Response {
179        let mut response = match self {
180            Self::Output(o) => {
181                match crate::operation_ser::serialize_prometheus_target_operation_response(&o) {
182                    Ok(response) => response,
183                    Err(e) => e.into_response(),
184                }
185            }
186            Self::Error(err) => {
187                match crate::operation_ser::serialize_prometheus_target_operation_error(&err) {
188                    Ok(mut response) => {
189                        response.extensions_mut().insert(
190                            aws_smithy_http_server::ExtensionModeledError::new(err.name()),
191                        );
192                        response
193                    }
194                    Err(e) => e.into_response(),
195                }
196            }
197        };
198        response
199            .extensions_mut()
200            .insert(aws_smithy_http_server::RequestExtensions::new(
201                "org.crisidev.docktor",
202                "PrometheusTargetOperation",
203            ));
204        response
205    }
206}
207impl
208    From<
209        Result<
210            crate::output::PrometheusTargetOperationOutput,
211            crate::error::PrometheusTargetOperationError,
212        >,
213    > for PrometheusTargetOperationOperationOutputWrapper
214{
215    fn from(
216        res: Result<
217            crate::output::PrometheusTargetOperationOutput,
218            crate::error::PrometheusTargetOperationError,
219        >,
220    ) -> Self {
221        match res {
222            Ok(v) => Self::Output(v),
223            Err(e) => Self::Error(e),
224        }
225    }
226}
227impl From<PrometheusTargetOperationOperationInputWrapper>
228    for crate::input::PrometheusTargetOperationInput
229{
230    fn from(i: PrometheusTargetOperationOperationInputWrapper) -> Self {
231        i.0
232    }
233}
234
235/// Operation shape for `RestartOperation`.
236#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)]
237pub struct RestartOperation {
238    _private: (),
239}
240impl RestartOperation {
241    /// Creates a new `RestartOperation` operation.
242    pub fn new() -> Self {
243        Self { _private: () }
244    }
245}
246pub struct RestartOperationOperationInputWrapper(pub crate::input::RestartOperationInput);
247#[async_trait::async_trait]
248impl<B> axum_core::extract::FromRequest<B> for RestartOperationOperationInputWrapper
249where
250    B: aws_smithy_http_server::HttpBody + Send,
251    B::Data: Send,
252    B::Error: Into<aws_smithy_http_server::BoxError>,
253    aws_smithy_http_server::rejection::SmithyRejection:
254        From<<B as aws_smithy_http_server::HttpBody>::Error>,
255{
256    type Rejection = aws_smithy_http_server::rejection::SmithyRejection;
257    async fn from_request(
258        req: &mut axum_core::extract::RequestParts<B>,
259    ) -> Result<Self, Self::Rejection> {
260        Ok(RestartOperationOperationInputWrapper(
261            crate::operation_deser::parse_restart_operation_request(req).await?,
262        ))
263    }
264}
265pub enum RestartOperationOperationOutputWrapper {
266    Output(crate::output::RestartOperationOutput),
267    Error(crate::error::RestartOperationError),
268}
269#[async_trait::async_trait]
270impl axum_core::response::IntoResponse for RestartOperationOperationOutputWrapper {
271    fn into_response(self) -> axum_core::response::Response {
272        let mut response = match self {
273            Self::Output(o) => {
274                match crate::operation_ser::serialize_restart_operation_response(&o) {
275                    Ok(response) => response,
276                    Err(e) => e.into_response(),
277                }
278            }
279            Self::Error(err) => {
280                match crate::operation_ser::serialize_restart_operation_error(&err) {
281                    Ok(mut response) => {
282                        response.extensions_mut().insert(
283                            aws_smithy_http_server::ExtensionModeledError::new(err.name()),
284                        );
285                        response
286                    }
287                    Err(e) => e.into_response(),
288                }
289            }
290        };
291        response
292            .extensions_mut()
293            .insert(aws_smithy_http_server::RequestExtensions::new(
294                "org.crisidev.docktor",
295                "RestartOperation",
296            ));
297        response
298    }
299}
300impl From<Result<crate::output::RestartOperationOutput, crate::error::RestartOperationError>>
301    for RestartOperationOperationOutputWrapper
302{
303    fn from(
304        res: Result<crate::output::RestartOperationOutput, crate::error::RestartOperationError>,
305    ) -> Self {
306        match res {
307            Ok(v) => Self::Output(v),
308            Err(e) => Self::Error(e),
309        }
310    }
311}
312impl From<RestartOperationOperationInputWrapper> for crate::input::RestartOperationInput {
313    fn from(i: RestartOperationOperationInputWrapper) -> Self {
314        i.0
315    }
316}
317
318/// Operation shape for `StartOperation`.
319#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)]
320pub struct StartOperation {
321    _private: (),
322}
323impl StartOperation {
324    /// Creates a new `StartOperation` operation.
325    pub fn new() -> Self {
326        Self { _private: () }
327    }
328}
329pub struct StartOperationOperationInputWrapper(pub crate::input::StartOperationInput);
330#[async_trait::async_trait]
331impl<B> axum_core::extract::FromRequest<B> for StartOperationOperationInputWrapper
332where
333    B: aws_smithy_http_server::HttpBody + Send,
334    B::Data: Send,
335    B::Error: Into<aws_smithy_http_server::BoxError>,
336    aws_smithy_http_server::rejection::SmithyRejection:
337        From<<B as aws_smithy_http_server::HttpBody>::Error>,
338{
339    type Rejection = aws_smithy_http_server::rejection::SmithyRejection;
340    async fn from_request(
341        req: &mut axum_core::extract::RequestParts<B>,
342    ) -> Result<Self, Self::Rejection> {
343        Ok(StartOperationOperationInputWrapper(
344            crate::operation_deser::parse_start_operation_request(req).await?,
345        ))
346    }
347}
348pub enum StartOperationOperationOutputWrapper {
349    Output(crate::output::StartOperationOutput),
350    Error(crate::error::StartOperationError),
351}
352#[async_trait::async_trait]
353impl axum_core::response::IntoResponse for StartOperationOperationOutputWrapper {
354    fn into_response(self) -> axum_core::response::Response {
355        let mut response = match self {
356            Self::Output(o) => match crate::operation_ser::serialize_start_operation_response(&o) {
357                Ok(response) => response,
358                Err(e) => e.into_response(),
359            },
360            Self::Error(err) => match crate::operation_ser::serialize_start_operation_error(&err) {
361                Ok(mut response) => {
362                    response.extensions_mut().insert(
363                        aws_smithy_http_server::ExtensionModeledError::new(err.name()),
364                    );
365                    response
366                }
367                Err(e) => e.into_response(),
368            },
369        };
370        response
371            .extensions_mut()
372            .insert(aws_smithy_http_server::RequestExtensions::new(
373                "org.crisidev.docktor",
374                "StartOperation",
375            ));
376        response
377    }
378}
379impl From<Result<crate::output::StartOperationOutput, crate::error::StartOperationError>>
380    for StartOperationOperationOutputWrapper
381{
382    fn from(
383        res: Result<crate::output::StartOperationOutput, crate::error::StartOperationError>,
384    ) -> Self {
385        match res {
386            Ok(v) => Self::Output(v),
387            Err(e) => Self::Error(e),
388        }
389    }
390}
391impl From<StartOperationOperationInputWrapper> for crate::input::StartOperationInput {
392    fn from(i: StartOperationOperationInputWrapper) -> Self {
393        i.0
394    }
395}
396
397/// Operation shape for `StopOperation`.
398#[derive(std::default::Default, std::clone::Clone, std::fmt::Debug)]
399pub struct StopOperation {
400    _private: (),
401}
402impl StopOperation {
403    /// Creates a new `StopOperation` operation.
404    pub fn new() -> Self {
405        Self { _private: () }
406    }
407}
408pub struct StopOperationOperationInputWrapper(pub crate::input::StopOperationInput);
409#[async_trait::async_trait]
410impl<B> axum_core::extract::FromRequest<B> for StopOperationOperationInputWrapper
411where
412    B: aws_smithy_http_server::HttpBody + Send,
413    B::Data: Send,
414    B::Error: Into<aws_smithy_http_server::BoxError>,
415    aws_smithy_http_server::rejection::SmithyRejection:
416        From<<B as aws_smithy_http_server::HttpBody>::Error>,
417{
418    type Rejection = aws_smithy_http_server::rejection::SmithyRejection;
419    async fn from_request(
420        req: &mut axum_core::extract::RequestParts<B>,
421    ) -> Result<Self, Self::Rejection> {
422        Ok(StopOperationOperationInputWrapper(
423            crate::operation_deser::parse_stop_operation_request(req).await?,
424        ))
425    }
426}
427pub enum StopOperationOperationOutputWrapper {
428    Output(crate::output::StopOperationOutput),
429    Error(crate::error::StopOperationError),
430}
431#[async_trait::async_trait]
432impl axum_core::response::IntoResponse for StopOperationOperationOutputWrapper {
433    fn into_response(self) -> axum_core::response::Response {
434        let mut response = match self {
435            Self::Output(o) => match crate::operation_ser::serialize_stop_operation_response(&o) {
436                Ok(response) => response,
437                Err(e) => e.into_response(),
438            },
439            Self::Error(err) => match crate::operation_ser::serialize_stop_operation_error(&err) {
440                Ok(mut response) => {
441                    response.extensions_mut().insert(
442                        aws_smithy_http_server::ExtensionModeledError::new(err.name()),
443                    );
444                    response
445                }
446                Err(e) => e.into_response(),
447            },
448        };
449        response
450            .extensions_mut()
451            .insert(aws_smithy_http_server::RequestExtensions::new(
452                "org.crisidev.docktor",
453                "StopOperation",
454            ));
455        response
456    }
457}
458impl From<Result<crate::output::StopOperationOutput, crate::error::StopOperationError>>
459    for StopOperationOperationOutputWrapper
460{
461    fn from(
462        res: Result<crate::output::StopOperationOutput, crate::error::StopOperationError>,
463    ) -> Self {
464        match res {
465            Ok(v) => Self::Output(v),
466            Err(e) => Self::Error(e),
467        }
468    }
469}
470impl From<StopOperationOperationInputWrapper> for crate::input::StopOperationInput {
471    fn from(i: StopOperationOperationInputWrapper) -> Self {
472        i.0
473    }
474}