(self)
return return_status
Archive a sketch and return a boolean whether it was successful.
Archive a sketch and return a boolean whether it was successful.
Archive a sketch and return a boolean whether it was successful .
def archive(self):
        """Archive a sketch and return a boolean whether it was successful."""
        if self.is_archived():
            logger.error('Sketch already archived.')
            return False

        resource_url = '{0:s}/sketches/{1:d}/archive/'.format(
            self.api.api_root, self.id)
        data = {
            'action': 'archive'
        }
        response = self.api.session.post(resource_url, json=data)
        return_status = error.check_return_status(response, logger)
        self._archived = return_status

        return return_status
def archive ( self ) : if self . is_archived ( ) : logger . error ( 'Sketch already archived.' ) return False resource_url = '{0:s}/sketches/{1:d}/archive/' . format ( self . api . api_root , self . id ) data = { 'action' : 'archive' } response = self . api . session . post ( resource_url , json = data ) return_status = error . check_return_status ( response , logger ) self . _archived = return_status return return_status