This is a mini DC motor running at 3~6 volts with 3700~11500 RPM range.
Recessed magnetic door switches are made with the same magnetic reed switches used for surface-mount alarm contacts. Instead of a rectangular housing, recessed alarm contacts have a cylindrical case. This makes them easy to install, just by drilling a hole of the proper diameter. The magnets are also designed with the same type of cylindrical housing.