@distributed_trace
def list(self, top: Optional[int]=None, expand: Optional[str]=None, **kwargs: Any) -> AsyncIterable['_models.ProviderListResult']:
    'Gets all resource providers for a subscription.\n\n        :param top: The number of results to return. If null is passed returns all deployments. Default\n         value is None.\n        :type top: int\n        :param expand: The properties to include in the results. For example, use &$expand=metadata in\n         the query string to retrieve resource provider metadata. To include property aliases in\n         response, use $expand=resourceTypes/aliases. Default value is None.\n        :type expand: str\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :return: An iterator like instance of either ProviderListResult or the result of cls(response)\n        :rtype:\n         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ProviderListResult]\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    api_version = kwargs.pop('api_version', '2019-08-01')
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))

    def prepare_request(next_link=None):
        if (not next_link):
            request = build_providers_list_request(subscription_id=self._config.subscription_id, api_version=api_version, top=top, expand=expand, template_url=self.list.metadata['url'])
            request = _convert_request(request)
            request.url = self._client.format_url(request.url)
        else:
            request = build_providers_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
            request = _convert_request(request)
            request.url = self._client.format_url(request.url)
            request.method = 'GET'
        return request

    async def extract_data(pipeline_response):
        deserialized = self._deserialize('ProviderListResult', pipeline_response)
        list_of_elem = deserialized.value
        if cls:
            list_of_elem = cls(list_of_elem)
        return ((deserialized.next_link or None), AsyncList(list_of_elem))

    async def get_next(next_link=None):
        request = prepare_request(next_link)
        pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
        response = pipeline_response.http_response
        if (response.status_code not in [200]):
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)
        return pipeline_response
    return AsyncItemPaged(get_next, extract_data)
Gets all resource providers for a subscription.

:param top: The number of results to return. If null is passed returns all deployments. Default
 value is None.
:type top: int
:param expand: The properties to include in the results. For example, use &$expand=metadata in
 the query string to retrieve resource provider metadata. To include property aliases in
 response, use $expand=resourceTypes/aliases. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ProviderListResult or the result of cls(response)
:rtype:
 ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ProviderListResult]
:raises: ~azure.core.exceptions.HttpResponseError
@distributed_trace
def list(self, top: Optional[int]=None, expand: Optional[str]=None, **kwargs: Any) -> AsyncIterable['_models.ProviderListResult']:
    'Gets all resource providers for a subscription.\n\n        :param top: The number of results to return. If null is passed returns all deployments. Default\n         value is None.\n        :type top: int\n        :param expand: The properties to include in the results. For example, use &$expand=metadata in\n         the query string to retrieve resource provider metadata. To include property aliases in\n         response, use $expand=resourceTypes/aliases. Default value is None.\n        :type expand: str\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :return: An iterator like instance of either ProviderListResult or the result of cls(response)\n        :rtype:\n         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ProviderListResult]\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    api_version = kwargs.pop('api_version', '2019-08-01')
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))

    def prepare_request(next_link=None):
        if (not next_link):
            request = build_providers_list_request(subscription_id=self._config.subscription_id, api_version=api_version, top=top, expand=expand, template_url=self.list.metadata['url'])
            request = _convert_request(request)
            request.url = self._client.format_url(request.url)
        else:
            request = build_providers_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
            request = _convert_request(request)
            request.url = self._client.format_url(request.url)
            request.method = 'GET'
        return request

    async def extract_data(pipeline_response):
        deserialized = self._deserialize('ProviderListResult', pipeline_response)
        list_of_elem = deserialized.value
        if cls:
            list_of_elem = cls(list_of_elem)
        return ((deserialized.next_link or None), AsyncList(list_of_elem))

    async def get_next(next_link=None):
        request = prepare_request(next_link)
        pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
        response = pipeline_response.http_response
        if (response.status_code not in [200]):
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)
        return pipeline_response
    return AsyncItemPaged(get_next, extract_data)