List the projects visible to this client.

        Example::

            >>> from google.cloud import resource_manager
            >>> client = resource_manager.Client()
            >>> for project in client.list_projects():
            ...     print(project.project_id)

        List all projects with label ``'environment'`` set to ``'prod'``
        (filtering by labels)::

            >>> from google.cloud import resource_manager
            >>> client = resource_manager.Client()
            >>> env_filter = {'labels.environment': 'prod'}
            >>> for project in client.list_projects(env_filter):
            ...     print(project.project_id)

        See
        https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/list

        Complete filtering example::

            >>> project_filter = {  # Return projects with...
            ...     'name': 'My Project',  # name set to 'My Project'.
            ...     'id': 'my-project-id',  # id set to 'my-project-id'.
            ...     'labels.stage': 'prod',  # the label 'stage' set to 'prod'
            ...     'labels.color': '*'  # a label 'color' set to anything.
            ... }
            >>> client.list_projects(project_filter)

        :type filter_params: dict
        :param filter_params: (Optional) A dictionary of filter options where
                              each key is a property to filter on, and each
                              value is the (case-insensitive) value to check
                              (or the glob ``*`` to check for existence of the
                              property). See the example above for more
                              details.

        :type page_size: int
        :param page_size: (Optional) The maximum number of projects in each
                          page of results from this request. Non-positive
                          values are ignored. Defaults to a sensible value
                          set by the API.

        :rtype: :class:`~google.api_core.page_iterator.Iterator`
        :returns: Iterator of all
                  :class:`~google.cloud.resource_manager.project.Project`.
                  that the current user has access to.

def list_projects(self, filter_params=None, page_size=None):
        """List the projects visible to this client.

        Example::

            >>> from google.cloud import resource_manager
            >>> client = resource_manager.Client()
            >>> for project in client.list_projects():
            ...     print(project.project_id)

        List all projects with label ``'environment'`` set to ``'prod'``
        (filtering by labels)::

            >>> from google.cloud import resource_manager
            >>> client = resource_manager.Client()
            >>> env_filter = {'labels.environment': 'prod'}
            >>> for project in client.list_projects(env_filter):
            ...     print(project.project_id)

        See
        https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/list

        Complete filtering example::

            >>> project_filter = {  # Return projects with...
            ...     'name': 'My Project',  # name set to 'My Project'.
            ...     'id': 'my-project-id',  # id set to 'my-project-id'.
            ...     'labels.stage': 'prod',  # the label 'stage' set to 'prod'
            ...     'labels.color': '*'  # a label 'color' set to anything.
            ... }
            >>> client.list_projects(project_filter)

        :type filter_params: dict
        :param filter_params: (Optional) A dictionary of filter options where
                              each key is a property to filter on, and each
                              value is the (case-insensitive) value to check
                              (or the glob ``*`` to check for existence of the
                              property). See the example above for more
                              details.

        :type page_size: int
        :param page_size: (Optional) The maximum number of projects in each
                          page of results from this request. Non-positive
                          values are ignored. Defaults to a sensible value
                          set by the API.

        :rtype: :class:`~google.api_core.page_iterator.Iterator`
        :returns: Iterator of all
                  :class:`~google.cloud.resource_manager.project.Project`.
                  that the current user has access to.
        """
        extra_params = {}

        if page_size is not None:
            extra_params["pageSize"] = page_size

        if filter_params is not None:
            extra_params["filter"] = [
                "{}:{}".format(key, value)
                for key, value in six.iteritems(filter_params)
            ]

        return page_iterator.HTTPIterator(
            client=self,
            api_request=self._connection.api_request,
            path="/projects",
            item_to_value=_item_to_project,
            items_key="projects",
            extra_params=extra_params,
        )