Skip to main content

winterbaume_iotdataplane/
wire.rs

1//! Auto-generated wire helpers from Smithy models.
2//! Do not edit manually. Regenerate with:
3//!   smithy-codegen gen-serializers winterbaume-iot-data-plane
4
5#![allow(
6    dead_code,
7    unused_variables,
8    clippy::let_and_return,
9    clippy::single_match
10)]
11
12#[allow(unused_imports)]
13use http::header::HeaderName;
14use winterbaume_core::MockResponse;
15
16pub use super::model::*;
17
18/// Serialize void response for restJson protocol.
19pub fn serialize_delete_connection_response() -> MockResponse {
20    MockResponse::rest_json(200, "{}")
21}
22
23/// Serialize response for restJson protocol.
24pub fn serialize_delete_thing_shadow_response(result: &DeleteThingShadowResponse) -> MockResponse {
25    let status = 200_u16;
26    let body = serde_json::to_string(result).unwrap_or_else(|_| "{}".to_string());
27    MockResponse::rest_json(status, body)
28}
29
30/// Serialize response for restJson protocol.
31pub fn serialize_get_retained_message_response(
32    result: &GetRetainedMessageResponse,
33) -> MockResponse {
34    let status = 200_u16;
35    let body = serde_json::to_string(result).unwrap_or_else(|_| "{}".to_string());
36    MockResponse::rest_json(status, body)
37}
38
39/// Serialize response for restJson protocol.
40pub fn serialize_get_thing_shadow_response(result: &GetThingShadowResponse) -> MockResponse {
41    let status = 200_u16;
42    let body = serde_json::to_string(result).unwrap_or_else(|_| "{}".to_string());
43    MockResponse::rest_json(status, body)
44}
45
46/// Serialize response for restJson protocol.
47pub fn serialize_list_named_shadows_for_thing_response(
48    result: &ListNamedShadowsForThingResponse,
49) -> MockResponse {
50    let status = 200_u16;
51    let body = serde_json::to_string(result).unwrap_or_else(|_| "{}".to_string());
52    MockResponse::rest_json(status, body)
53}
54
55/// Serialize response for restJson protocol.
56pub fn serialize_list_retained_messages_response(
57    result: &ListRetainedMessagesResponse,
58) -> MockResponse {
59    let status = 200_u16;
60    let body = serde_json::to_string(result).unwrap_or_else(|_| "{}".to_string());
61    MockResponse::rest_json(status, body)
62}
63
64/// Serialize void response for restJson protocol.
65pub fn serialize_publish_response() -> MockResponse {
66    MockResponse::rest_json(200, "{}")
67}
68
69/// Serialize response for restJson protocol.
70pub fn serialize_update_thing_shadow_response(result: &UpdateThingShadowResponse) -> MockResponse {
71    let status = 200_u16;
72    let body = serde_json::to_string(result).unwrap_or_else(|_| "{}".to_string());
73    MockResponse::rest_json(status, body)
74}