Skip to main content

aws_sdk_chimesdkmessaging/protocol_serde/
shape_channel_message_callback.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_channel_message_callback(
3    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
4    input: &crate::types::ChannelMessageCallback,
5) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
6    {
7        object.key("MessageId").string(input.message_id.as_str());
8    }
9    if let Some(var_1) = &input.content {
10        object.key("Content").string(var_1.as_str());
11    }
12    if let Some(var_2) = &input.metadata {
13        object.key("Metadata").string(var_2.as_str());
14    }
15    if let Some(var_3) = &input.push_notification {
16        #[allow(unused_mut)]
17        let mut object_4 = object.key("PushNotification").start_object();
18        crate::protocol_serde::shape_push_notification_configuration::ser_push_notification_configuration(&mut object_4, var_3)?;
19        object_4.finish();
20    }
21    if let Some(var_5) = &input.message_attributes {
22        #[allow(unused_mut)]
23        let mut object_6 = object.key("MessageAttributes").start_object();
24        for (key_7, value_8) in var_5 {
25            {
26                #[allow(unused_mut)]
27                let mut object_9 = object_6.key(key_7.as_str()).start_object();
28                crate::protocol_serde::shape_message_attribute_value::ser_message_attribute_value(&mut object_9, value_8)?;
29                object_9.finish();
30            }
31        }
32        object_6.finish();
33    }
34    if let Some(var_10) = &input.sub_channel_id {
35        object.key("SubChannelId").string(var_10.as_str());
36    }
37    if let Some(var_11) = &input.content_type {
38        object.key("ContentType").string(var_11.as_str());
39    }
40    Ok(())
41}