As used in this article, the term “peace officer” means a sheriff, undersheriff, deputy sheriff, marshal, or deputy marshal of a county or city and county, or a marshal or police officer of a city or town, employed and compensated as such, whether the members are volunteer, partly paid, or fully paid, except those whose principal duties are clerical, such as stenographers, telephone operators, and other workers not engaged in law enforcement operations, or the protection or preservation of life or property, and not under suspension or otherwise lacking in good standing.