text: # coding=utf-8
  # --------------------------------------------------------------------------
  # Code generated by Microsoft (R) AutoRest Code Generator.
  # Changes may cause incorrect behavior and will be lost if the code is
  # regenerated.
  # --------------------------------------------------------------------------
  
  from msrest.pipeline import ClientRawResponse
  
  from .. import models
  
  
  class ThreatIntelligenceIndicatorsListOperations(object):
      """ThreatIntelligenceIndicatorsListOperations operations.
  
      :param client: Client for service requests.
      :param config: Configuration of service client.
      :param serializer: An object model serializer.
      :param deserializer: An object model deserializer.
      :ivar api_version: API version for the operation. Constant value: "2019-01-01-preview".
      """
  
      models = models
  
      def __init__(self, client, config, serializer, deserializer):
  
          self._client = client
          self._serialize = serializer
          self._deserialize = deserializer
  
          self.config = config
          self.api_version = "2019-01-01-preview"
  
      def query(
              self, resource_group_name, operational_insights_resource_provider, workspace_name, threat_intelligence_arm_stix_query, custom_headers=None, raw=False, **operation_config):
          """Query all threat intelligence.
  
          :param resource_group_name: The name of the resource group within the
           user's subscription. The name is case insensitive.
          :type resource_group_name: str
          :param operational_insights_resource_provider: The namespace of
           workspaces resource provider- Microsoft.OperationalInsights.
          :type operational_insights_resource_provider: str
          :param workspace_name: The name of the workspace.
          :type workspace_name: str
          :param threat_intelligence_arm_stix_query: The threat intelligence ARM
           STIX query
          :type threat_intelligence_arm_stix_query:
           ~securityinsights.models.ThreatIntelligenceArmStixQuery
          :param dict custom_headers: headers that will be added to the request
          :param bool raw: returns the direct response alongside the
           deserialized response
          :param operation_config: :ref:`Operation configuration
           overrides<msrest:optionsforoperations>`.
          :return: ThreatIntelligenceResourceList or ClientRawResponse if
           raw=true
          :rtype: ~securityinsights.models.ThreatIntelligenceResourceList or
           ~msrest.pipeline.ClientRawResponse
          :raises:
           :class:`CloudErrorException<securityinsights.models.CloudErrorException>`
          """
          # Construct URL
          url = self.query.metadata['url']
          path_format_arguments = {
              'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'),
              'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
              'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'),
              'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1)
          }
          url = self._client.format_url(url, **path_format_arguments)
  
          # Construct parameters
          query_parameters = {}
          query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
  
          # Construct headers
          header_parameters = {}
          header_parameters['Accept'] = 'application/json'
          header_parameters['Content-Type'] = 'application/json; charset=utf-8'
          if custom_headers:
              header_parameters.update(custom_headers)
  
          # Construct body
          body_content = self._serialize.body(threat_intelligence_arm_stix_query, 'ThreatIntelligenceArmStixQuery')
  
          # Construct and send request
          request = self._client.post(url, query_parameters, header_parameters, body_content)
          response = self._client.send(request, stream=False, **operation_config)
  
          if response.status_code not in [200]:
              raise models.CloudErrorException(self._deserialize, response)
  
          deserialized = None
  
          if response.status_code == 200:
              deserialized = self._deserialize('ThreatIntelligenceResourceList', response)
  
          if raw:
              client_raw_response = ClientRawResponse(deserialized, response)
              return client_raw_response
  
          return deserialized
      query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators'}
  