    def list(
        self,
        cluster: str | None = None,
        search: str | None = None,
        dev: bool = False,
        q: str | None = None,
    ) -> list[Deployment]:
        """
        List all deployments in the cluster.

        Args:
            cluster: The name of the cluster to list deployments from. If not specified, list deployments from all clusters.
            search: The search query to filter deployments.

        Returns:
            A list of DeploymentInfo objects.
        """
        cloud_rest_client = self._client
        if cluster is None:
            res_count = cloud_rest_client.v2.list_deployment(all=True, search=search)
            if res_count.total == 0:
                return []
            q = "is:dev" if dev else q
            res = cloud_rest_client.v2.list_deployment(
                search=search, count=res_count.total, all=True, q=q
            )
        else:
            res_count = cloud_rest_client.v2.list_deployment(cluster, search=search)
            if res_count.total == 0:
                return []
            res = cloud_rest_client.v2.list_deployment(
                cluster, search=search, count=res_count.total
            )
        return [self._generate_deployment_info_(schema) for schema in res.items]
List all deployments in the cluster.

Args:
cluster: The name of the cluster to list deployments from. If not specified, list deployments from all clusters.
search: The search query to filter deployments.

Returns:
A list of DeploymentInfo objects.
src/bentoml/_internal/cloud/deployment.py