'Converts the provider instance to a :class:`dict`.
:returns:
:class:`dict`'

def to_dict(self):

    return dict(name=self.name, id=getattr(self, 'id', None), type_id=self.type_id, type=self.get_type(), scope=getattr(self, 'scope', None), user=(self.user.id if self.user else None))
