from typing import Callable


def get_pagination_request_result(limit: int, page: int, max_page_size: int, client_request: Callable,
                                  **kwargs) -> dict:
    """
    Perform API request for pagination utility.
    Args:
        limit (int): The number of results to retrieve.
        page (int): The page number of the results to retrieve.
        max_page_size (int): API maximum page size limitation.
        client_request (int): API Client function.

    Returns:
        dict: API response from GCP.

    """
    offset = (page - 1) * limit
    page_token = None

    steps = max_page_size if offset > max_page_size else offset

    for i in range(0, offset, steps):
        response = client_request(limit=steps, page_token=page_token, **kwargs)

        page_token = response.get('nextPageToken')

        if not page_token:
            return {}

    return client_request(limit=limit, page_token=page_token, **kwargs)