When the action is against the state, a county or other public corporation therein, or a private corporation, or a minor, the confession shall be made by the person who at the time sustains the relation to such state, corporation, county or minor, as would authorize the service of a notice summons upon him or her; or in the case of a minor, if a guardian for the action has been appointed, then by such guardian; in all other cases the confession shall be made by the defendant in person.