  def ListDeployments(
      self, namespace: Optional[str] = None) -> List[workloads.K8sDeployment]:
    """Lists the deployments in this cluster.

    Args:
      namespace (str): Optional. The namespace in which to list the deployments.
          If not specified, deployments are listed in all namespaces.

    Returns:
      List[workloads.K8sDeployment]: The list of deployments.
    """
    api = self._Api(client.AppsV1Api)
    if namespace is not None:
      deployments = api.list_namespaced_deployment(namespace)
    else:
      deployments = api.list_deployment_for_all_namespaces()
    return [
        workloads.K8sDeployment(
            self._api_client,
            deployment.metadata.name,
            deployment.metadata.namespace) for deployment in deployments.items
    ]
Lists the deployments in this cluster.

Args:
namespace (str): Optional. The namespace in which to list the deployments.
If not specified, deployments are listed in all namespaces.

Returns:
List[workloads.K8sDeployment]: The list of deployments.
libcloudforensics/providers/kubernetes/cluster.py