The state building code required by this chapter shall be enforced by the counties and cities. Any county or city not having a building department shall contract with another county, city, or inspection agency approved by the county or city for enforcement of the state building code within its jurisdictional boundaries.