'Method which is called when state of the entity is \'absent\'. If user
don\'t provide `entity` parameter the entity is searched using
`search_params` parameter. If entity is found it\'s removed.
Function executed before remove is executed can optionally be specified
in `pre_remove` parameter.
:param entity: Entity we want to remove.
:param search_params: Dictionary of parameters to be used for search.
:param kwargs: Additional parameters passed when removing entity.
:return: Dictionary with values returned by Ansible module.'

def remove(self, entity=None, search_params=None, **kwargs):

    if (entity is None):
        entity = self.search_entity(search_params)
    if (entity is None):
        return {'changed': self.changed, 'msg': "Entity    wasn't    found."}
    self.pre_remove(entity)
    entity_service = self._service.service(entity.id)
    if (not self._module.check_mode):
        entity_service.remove(**kwargs)
        wait(service=entity_service, condition=(lambda entity: (not entity)), wait=self._module.params['wait'], timeout=self._module.params['timeout'], poll_interval=self._module.params['poll_interval'])
    self.changed = True
    return {'changed': self.changed, 'id': entity.id, type(entity).__name__.lower(): get_dict_of_struct(struct=entity, connection=self._connection, fetch_nested=self._module.params.get('fetch_nested'), attributes=self._module.params.get('nested_attributes'))}
