aws-sdk-controltower 0.5.0

AWS SDK for AWS Control Tower
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_input_disable_control_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DisableControlInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_1) = &input.control_identifier {
        object.key("controlIdentifier").string(var_1.as_str());
    }
    if let Some(var_2) = &input.target_identifier {
        object.key("targetIdentifier").string(var_2.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_enable_control_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::EnableControlInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_3) = &input.control_identifier {
        object.key("controlIdentifier").string(var_3.as_str());
    }
    if let Some(var_4) = &input.target_identifier {
        object.key("targetIdentifier").string(var_4.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_control_operation_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetControlOperationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_5) = &input.operation_identifier {
        object.key("operationIdentifier").string(var_5.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_enabled_controls_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListEnabledControlsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_6) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_6).into()),
        );
    }
    if let Some(var_7) = &input.next_token {
        object.key("nextToken").string(var_7.as_str());
    }
    if let Some(var_8) = &input.target_identifier {
        object.key("targetIdentifier").string(var_8.as_str());
    }
    Ok(())
}