public PagedList<SubnetInner> list(final String resourceGroupName, final String virtualNetworkName) {
        ServiceResponse<Page<SubnetInner>> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single();
        return new PagedList<SubnetInner>(response.body()) {
            @Override
            public Page<SubnetInner> nextPage(String nextPageLink) {
                return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }
public PagedList < SubnetInner > list ( final String resourceGroupName , final String virtualNetworkName ) { ServiceResponse < Page < SubnetInner > > response = listSinglePageAsync ( resourceGroupName , virtualNetworkName ) . toBlocking ( ) . single ( ) ; return new PagedList < SubnetInner > ( response . body ( ) ) { @ Override public Page < SubnetInner > nextPage ( String nextPageLink ) { return listNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ; }
Gets all subnets in a virtual network.

@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@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;SubnetInner&gt; object if successful.