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
pub fn serialize_structure_crate_input_create_rule_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateRuleInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_1) = &input.description {
object.key("Description").string(var_1.as_str());
}
if let Some(var_2) = &input.resource_tags {
let mut array_3 = object.key("ResourceTags").start_array();
for item_4 in var_2 {
{
#[allow(unused_mut)]
let mut object_5 = array_3.value().start_object();
crate::json_ser::serialize_structure_crate_model_resource_tag(
&mut object_5,
item_4,
)?;
object_5.finish();
}
}
array_3.finish();
}
if let Some(var_6) = &input.resource_type {
object.key("ResourceType").string(var_6.as_str());
}
if let Some(var_7) = &input.retention_period {
#[allow(unused_mut)]
let mut object_8 = object.key("RetentionPeriod").start_object();
crate::json_ser::serialize_structure_crate_model_retention_period(&mut object_8, var_7)?;
object_8.finish();
}
if let Some(var_9) = &input.tags {
let mut array_10 = object.key("Tags").start_array();
for item_11 in var_9 {
{
#[allow(unused_mut)]
let mut object_12 = array_10.value().start_object();
crate::json_ser::serialize_structure_crate_model_tag(&mut object_12, item_11)?;
object_12.finish();
}
}
array_10.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_list_rules_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ListRulesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_13) = &input.max_results {
object.key("MaxResults").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_13).into()),
);
}
if let Some(var_14) = &input.next_token {
object.key("NextToken").string(var_14.as_str());
}
if let Some(var_15) = &input.resource_tags {
let mut array_16 = object.key("ResourceTags").start_array();
for item_17 in var_15 {
{
#[allow(unused_mut)]
let mut object_18 = array_16.value().start_object();
crate::json_ser::serialize_structure_crate_model_resource_tag(
&mut object_18,
item_17,
)?;
object_18.finish();
}
}
array_16.finish();
}
if let Some(var_19) = &input.resource_type {
object.key("ResourceType").string(var_19.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_tag_resource_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::TagResourceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_20) = &input.tags {
let mut array_21 = object.key("Tags").start_array();
for item_22 in var_20 {
{
#[allow(unused_mut)]
let mut object_23 = array_21.value().start_object();
crate::json_ser::serialize_structure_crate_model_tag(&mut object_23, item_22)?;
object_23.finish();
}
}
array_21.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_update_rule_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::UpdateRuleInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_24) = &input.description {
object.key("Description").string(var_24.as_str());
}
if let Some(var_25) = &input.resource_tags {
let mut array_26 = object.key("ResourceTags").start_array();
for item_27 in var_25 {
{
#[allow(unused_mut)]
let mut object_28 = array_26.value().start_object();
crate::json_ser::serialize_structure_crate_model_resource_tag(
&mut object_28,
item_27,
)?;
object_28.finish();
}
}
array_26.finish();
}
if let Some(var_29) = &input.resource_type {
object.key("ResourceType").string(var_29.as_str());
}
if let Some(var_30) = &input.retention_period {
#[allow(unused_mut)]
let mut object_31 = object.key("RetentionPeriod").start_object();
crate::json_ser::serialize_structure_crate_model_retention_period(&mut object_31, var_30)?;
object_31.finish();
}
Ok(())
}
pub fn serialize_structure_crate_model_resource_tag(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::model::ResourceTag,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_32) = &input.resource_tag_key {
object.key("ResourceTagKey").string(var_32.as_str());
}
if let Some(var_33) = &input.resource_tag_value {
object.key("ResourceTagValue").string(var_33.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_model_retention_period(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::model::RetentionPeriod,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_34) = &input.retention_period_value {
object.key("RetentionPeriodValue").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_34).into()),
);
}
if let Some(var_35) = &input.retention_period_unit {
object.key("RetentionPeriodUnit").string(var_35.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_model_tag(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::model::Tag,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_36) = &input.key {
object.key("Key").string(var_36.as_str());
}
if let Some(var_37) = &input.value {
object.key("Value").string(var_37.as_str());
}
Ok(())
}