'Iterate over the branches in this repository.
:param int number: (optional), number of branches to return. Default:
-1 returns all branches
:param bool protected: (optional), True lists only protected branches.
Default: False
:param str etag: (optional), ETag from a previous request to the same
endpoint
:returns: generator of
:class:`Branch <github3.repos.branch.Branch>`\ es'

def branches(self, number=(-1), protected=False, etag=None):

    url = self._build_url(u'branches', base_url=self._api)
    params = ({u'protected': u'1'} if protected else None)
    return self._iter(int(number), url, Branch, params, etag=etag, headers=Branch.PREVIEW_HEADERS)
