Probably a few ways, but here's one.
You know the lever in minecraft? I'll use that as an example. The square stone part could be a func_button and that will be the part you shoot/press. The wooden handle will be a func_brush that rotates ~90° to the new position, triggered by an output from the button.