aws_sdk_sagemaker/protocol_serde/
shape_create_cluster_input.rs1pub fn ser_create_cluster_input_input(
3 object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
4 input: &crate::operation::create_cluster::CreateClusterInput,
5) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
6 if let Some(var_1) = &input.cluster_name {
7 object.key("ClusterName").string(var_1.as_str());
8 }
9 if let Some(var_2) = &input.instance_groups {
10 let mut array_3 = object.key("InstanceGroups").start_array();
11 for item_4 in var_2 {
12 {
13 #[allow(unused_mut)]
14 let mut object_5 = array_3.value().start_object();
15 crate::protocol_serde::shape_cluster_instance_group_specification::ser_cluster_instance_group_specification(&mut object_5, item_4)?;
16 object_5.finish();
17 }
18 }
19 array_3.finish();
20 }
21 if let Some(var_6) = &input.restricted_instance_groups {
22 let mut array_7 = object.key("RestrictedInstanceGroups").start_array();
23 for item_8 in var_6 {
24 {
25 #[allow(unused_mut)]
26 let mut object_9 = array_7.value().start_object();
27 crate::protocol_serde::shape_cluster_restricted_instance_group_specification::ser_cluster_restricted_instance_group_specification(
28 &mut object_9,
29 item_8,
30 )?;
31 object_9.finish();
32 }
33 }
34 array_7.finish();
35 }
36 if let Some(var_10) = &input.vpc_config {
37 #[allow(unused_mut)]
38 let mut object_11 = object.key("VpcConfig").start_object();
39 crate::protocol_serde::shape_vpc_config::ser_vpc_config(&mut object_11, var_10)?;
40 object_11.finish();
41 }
42 if let Some(var_12) = &input.tags {
43 let mut array_13 = object.key("Tags").start_array();
44 for item_14 in var_12 {
45 {
46 #[allow(unused_mut)]
47 let mut object_15 = array_13.value().start_object();
48 crate::protocol_serde::shape_tag::ser_tag(&mut object_15, item_14)?;
49 object_15.finish();
50 }
51 }
52 array_13.finish();
53 }
54 if let Some(var_16) = &input.orchestrator {
55 #[allow(unused_mut)]
56 let mut object_17 = object.key("Orchestrator").start_object();
57 crate::protocol_serde::shape_cluster_orchestrator::ser_cluster_orchestrator(&mut object_17, var_16)?;
58 object_17.finish();
59 }
60 if let Some(var_18) = &input.node_recovery {
61 object.key("NodeRecovery").string(var_18.as_str());
62 }
63 if let Some(var_19) = &input.tiered_storage_config {
64 #[allow(unused_mut)]
65 let mut object_20 = object.key("TieredStorageConfig").start_object();
66 crate::protocol_serde::shape_cluster_tiered_storage_config::ser_cluster_tiered_storage_config(&mut object_20, var_19)?;
67 object_20.finish();
68 }
69 if let Some(var_21) = &input.node_provisioning_mode {
70 object.key("NodeProvisioningMode").string(var_21.as_str());
71 }
72 if let Some(var_22) = &input.cluster_role {
73 object.key("ClusterRole").string(var_22.as_str());
74 }
75 if let Some(var_23) = &input.auto_scaling {
76 #[allow(unused_mut)]
77 let mut object_24 = object.key("AutoScaling").start_object();
78 crate::protocol_serde::shape_cluster_auto_scaling_config::ser_cluster_auto_scaling_config(&mut object_24, var_23)?;
79 object_24.finish();
80 }
81 Ok(())
82}