@api_resource(Template)<EOL><INDENT>def _add_remove_user_template(self, url, template_id, account_id=None, email_address=None):<DEDENT>
if not email_address and not account_id:<EOL><INDENT>raise HSException("<STR_LIT>")<EOL><DEDENT>data = {}<EOL>if account_id is not None:<EOL><INDENT>data = {<EOL>"<STR_LIT>": account_id<EOL>}<EOL><DEDENT>else:<EOL><INDENT>data = {<EOL>"<STR_LIT>": email_address<EOL>}<EOL><DEDENT>request = self._get_request()<EOL>response = request.post(url + template_id, data)<EOL>return response<EOL>
Add or Remove user from a Template

        We use this function for two tasks because they have the same API call

        Args:

            template_id (str):      The id of the template

            account_id (str):       ID of the account to add/remove access to/from

            email_address (str):    The email_address of the account to add/remove access to/from

        Raises:
            HSException: If no email address or account_id specified

        Returns:
            A Template object