A deposition within the state on notice shall be taken: 1. when the person to be examined is a party or an officer, director, member or employee of a party, within the county in which he resides or has an office for the regular transaction of business in person or where the action is pending . . . .