async def _get_paginated_results(
        self, client: httpx.AsyncClient, url: str, params: Optional[Dict[str, Any]] = None
    ) -> List[Dict[str, Any]]:
        """Get all pages of results from a paginated Bitbucket API endpoint.

        Args:
            client: HTTP client
            url: API endpoint URL
            params: Optional query parameters

        Returns:
            List of all results from all pages
        """
        if params is None:
            params = {}

        all_results = []
        next_url = url

        while next_url:
            # Create Basic auth credentials
            credentials = f"{self.username}:{self.app_password}"
            encoded_credentials = base64.b64encode(credentials.encode()).decode()

            headers = {
                "Authorization": f"Basic {encoded_credentials}",
                "Accept": "application/json",
            }

            response = await client.get(
                next_url, headers=headers, params=params if next_url == url else None
            )
            response.raise_for_status()

            data = response.json()
            results = data.get("values", [])
            all_results.extend(results)

            # Get next page URL
            next_url = data.get("next")

        return all_results
Get all pages of results from a paginated Bitbucket API endpoint.

        Args:
            client: HTTP client
            url: API endpoint URL
            params: Optional query parameters

        Returns:
            List of all results from all pages
        
backend/airweave/platform/sources/bitbucket.py