fn generate_status_code_parser(operation: &Operation, service: &Service<'_>) -> String {
    if operation.output.is_none() {
        return "".to_owned();
    }

    let shape_name = &operation.output.as_ref().unwrap().shape;
    let output_shape = &service
        .get_shape(shape_name)
        .expect("Shape missing from service definition");

    let mut status_code_parser = "".to_string();

    for (member_name, member) in output_shape.members.as_ref().unwrap() {
        if let Some(ref location) = member.location {
            if location == "statusCode" {
                if output_shape.required(member_name) {
                    status_code_parser += &format!(
                        "result.{} = Some(response.status.as_u16());",
                        member_name.to_snake_case()
                    );
                } else {
                    status_code_parser += &format!(
                        "result.{} = Some(response.status.as_u16() as i64);",
                        member_name.to_snake_case()
                    );
                }
            }
        }
    }

    status_code_parser
}
Generate code to plumb the response status code into any fields
in the output shape that specify it
service_crategen/src/commands/generate/codegen/rest_json.rs