def create_new_version(<EOL>self,<EOL>name,<EOL>subject,<EOL>text='<STR_LIT>',<EOL>template_id=None,<EOL>html=None,<EOL>locale=None,<EOL>timeout=None<EOL>):
if(html):<EOL><INDENT>payload = {<EOL>'<STR_LIT:name>': name,<EOL>'<STR_LIT>': subject,<EOL>'<STR_LIT:html>': html,<EOL>'<STR_LIT:text>': text<EOL>}<EOL><DEDENT>else:<EOL><INDENT>payload = {<EOL>'<STR_LIT:name>': name,<EOL>'<STR_LIT>': subject,<EOL>'<STR_LIT:text>': text<EOL>}<EOL><DEDENT>if locale:<EOL><INDENT>url = self.TEMPLATES_SPECIFIC_LOCALE_VERSIONS_ENDPOINT % (<EOL>template_id,<EOL>locale<EOL>)<EOL><DEDENT>else:<EOL><INDENT>url = self.TEMPLATES_NEW_VERSION_ENDPOINT % template_id<EOL><DEDENT>return self._api_request(<EOL>url,<EOL>self.HTTP_POST,<EOL>payload=payload,<EOL>timeout=timeout<EOL>)<EOL>
API call to create a new version of a template