def METHOD_NAME(charges, case_number, edit_action_ambiguous_charge_id, edit) -> OeciCharge:
    charge = next((charge for charge in charges if charge.ambiguous_charge_id == edit_action_ambiguous_charge_id))
    charge_dict = RecordEditor._parse_charge_edits(edit)
    charge_type_string = charge_dict.pop("charge_type", None)
    edited_oeci_charge = replace(charge, **charge_dict)
    if charge_type_string:
        charge_type_data = {
            "id": f"{charge.ambiguous_charge_id}-0",
            "case_number": case_number,
            "charge_type": RecordEditor._get_charge_type(charge_type_string),
            **asdict(edited_oeci_charge),
        }
        new_charge = from_dict(data_class=Charge, data=charge_type_data)
        return new_charge
    else:
        return edited_oeci_charge