code: public PagedList<AgentPoolInner> list(final String resourceGroupName, final String managedClusterName) {
          ServiceResponse<Page<AgentPoolInner>> response = listSinglePageAsync(resourceGroupName, managedClusterName).toBlocking().single();
          return new PagedList<AgentPoolInner>(response.body()) {
              @Override
              public Page<AgentPoolInner> nextPage(String nextPageLink) {
                  return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
              }
          };
      }
docs: Gets a list of agent pools in the specified managed cluster.
  Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool.
  
  @param resourceGroupName The name of the resource group.
  @param managedClusterName The name of the managed cluster resource.
  @throws IllegalArgumentException thrown if parameters fail the validation
  @throws CloudException thrown if the request is rejected by server
  @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
  @return the PagedList&lt;AgentPoolInner&gt; object if successful.