def cancel(self,identity,params=None, headers=None):
path = self._sub_url_params('<STR_LIT>', {<EOL>'<STR_LIT>': identity,<EOL>})<EOL>if params is not None:<EOL><INDENT>params = {'<STR_LIT:data>': params}<EOL><DEDENT>response = self._perform_request('<STR_LIT:POST>', path, params, headers,<EOL>retry_failures=False)<EOL>return self._resource_for(response)<EOL>
Cancel a mandate import.

        Cancels the mandate import, which aborts the import process and stops
        the mandates
        being set up in GoCardless. Once the import has been cancelled, it can
        no longer have
        entries added to it. Mandate imports which have already been submitted
        or processed
        cannot be cancelled.

        Args:
              identity (string): Unique identifier, beginning with "IM".
              params (dict, optional): Request body.

        Returns:
              ListResponse of MandateImport instances