def list_by_workspace(self, resource_group_name, workspace_name, **kwargs):
    'Lists the storage insight instances within a workspace.\n\n        :param resource_group_name: The name of the resource group. The name is case insensitive.\n        :type resource_group_name: str\n        :param workspace_name: The name of the workspace.\n        :type workspace_name: 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 StorageInsightListResult or the result of cls(response)\n        :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.StorageInsightListResult]\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = '2020-08-01'
    accept = 'application/json'

    def prepare_request(next_link=None):
        header_parameters = {}
        header_parameters['Accept'] = self._serialize.header('accept', accept, 'str')
        if (not next_link):
            url = self.list_by_workspace.metadata['url']
            path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1), 'workspaceName': self._serialize.url('workspace_name', workspace_name, 'str', max_length=63, min_length=4, pattern='^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), 'subscriptionId': self._serialize.url('self._config.subscription_id', self._config.subscription_id, 'str', min_length=1)}
            url = self._client.format_url(url, **path_format_arguments)
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query('api_version', api_version, 'str')
            request = self._client.get(url, query_parameters, header_parameters)
        else:
            url = next_link
            query_parameters = {}
            request = self._client.get(url, query_parameters, header_parameters)
        return request

    def extract_data(pipeline_response):
        deserialized = self._deserialize('StorageInsightListResult', pipeline_response)
        list_of_elem = deserialized.value
        if cls:
            list_of_elem = cls(list_of_elem)
        return ((deserialized.odata_next_link or None), iter(list_of_elem))

    def get_next(next_link=None):
        request = prepare_request(next_link)
        pipeline_response = 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 ItemPaged(get_next, extract_data)
Lists the storage insight instances within a workspace.

:param resource_group_name: The name of the resource group. The name is case insensitive.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either StorageInsightListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.StorageInsightListResult]
:raises: ~azure.core.exceptions.HttpResponseError
def list_by_workspace(self, resource_group_name, workspace_name, **kwargs):
    'Lists the storage insight instances within a workspace.\n\n        :param resource_group_name: The name of the resource group. The name is case insensitive.\n        :type resource_group_name: str\n        :param workspace_name: The name of the workspace.\n        :type workspace_name: 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 StorageInsightListResult or the result of cls(response)\n        :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.StorageInsightListResult]\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = '2020-08-01'
    accept = 'application/json'

    def prepare_request(next_link=None):
        header_parameters = {}
        header_parameters['Accept'] = self._serialize.header('accept', accept, 'str')
        if (not next_link):
            url = self.list_by_workspace.metadata['url']
            path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1), 'workspaceName': self._serialize.url('workspace_name', workspace_name, 'str', max_length=63, min_length=4, pattern='^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), 'subscriptionId': self._serialize.url('self._config.subscription_id', self._config.subscription_id, 'str', min_length=1)}
            url = self._client.format_url(url, **path_format_arguments)
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query('api_version', api_version, 'str')
            request = self._client.get(url, query_parameters, header_parameters)
        else:
            url = next_link
            query_parameters = {}
            request = self._client.get(url, query_parameters, header_parameters)
        return request

    def extract_data(pipeline_response):
        deserialized = self._deserialize('StorageInsightListResult', pipeline_response)
        list_of_elem = deserialized.value
        if cls:
            list_of_elem = cls(list_of_elem)
        return ((deserialized.odata_next_link or None), iter(list_of_elem))

    def get_next(next_link=None):
        request = prepare_request(next_link)
        pipeline_response = 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 ItemPaged(get_next, extract_data)