text: # coding: utf-8
  
  """
      Experimental Looker API 3.1 Preview
  
      This API 3.1 is in active development. Breaking changes are likely to occur to some API functions in future Looker releases until API 3.1 is officially launched and upgraded to beta status.  If you have time and interest to experiment with new or modified services exposed in this embryonic API 3.1, we welcome your participation and feedback!  For large development efforts or critical line-of-business projects, we strongly recommend you stick with the API 3.0 while API 3.1 is under construction.   # noqa: E501
  
      OpenAPI spec version: 3.1.0
      
      Generated by: https://github.com/swagger-api/swagger-codegen.git
  """
  
  
  from __future__ import absolute_import
  
  import re  # noqa: F401
  
  # python 2 and python 3 compatibility library
  import six
  
  from looker_client_31.api_client import ApiClient
  
  
  class RunningQueriesApi(object):
      """NOTE: This class is auto generated by the swagger code generator program.
  
      Do not edit the class manually.
      Ref: https://github.com/swagger-api/swagger-codegen
      """
  
      def __init__(self, api_client=None):
          if api_client is None:
              api_client = ApiClient()
          self.api_client = api_client
  
      def all_running_queries(self, **kwargs):  # noqa: E501
          """Get All Running Queries  # noqa: E501
  
          Get information about all running queries.   # noqa: E501
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async=True
          >>> thread = api.all_running_queries(async=True)
          >>> result = thread.get()
  
          :param async bool
          :return: list[RunningQueries]
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('async'):
              return self.all_running_queries_with_http_info(**kwargs)  # noqa: E501
          else:
              (data) = self.all_running_queries_with_http_info(**kwargs)  # noqa: E501
              return data
  
      def all_running_queries_with_http_info(self, **kwargs):  # noqa: E501
          """Get All Running Queries  # noqa: E501
  
          Get information about all running queries.   # noqa: E501
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async=True
          >>> thread = api.all_running_queries_with_http_info(async=True)
          >>> result = thread.get()
  
          :param async bool
          :return: list[RunningQueries]
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = []  # noqa: E501
          all_params.append('async')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in six.iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method all_running_queries" % key
                  )
              params[key] = val
          del params['kwargs']
  
          collection_formats = {}
  
          path_params = {}
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.select_header_accept(
              ['application/json'])  # noqa: E501
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
              ['application/json'])  # noqa: E501
  
          # Authentication setting
          auth_settings = []  # noqa: E501
  
          return self.api_client.call_api(
              '/running_queries', 'GET',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='list[RunningQueries]',  # noqa: E501
              auth_settings=auth_settings,
              async=params.get('async'),
              _return_http_data_only=params.get('_return_http_data_only'),
              _preload_content=params.get('_preload_content', True),
              _request_timeout=params.get('_request_timeout'),
              collection_formats=collection_formats)
  
      def kill_query(self, query_task_id, **kwargs):  # noqa: E501
          """Kill Running Query  # noqa: E501
  
          Kill a query with a specific query_task_id.   # noqa: E501
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async=True
          >>> thread = api.kill_query(query_task_id, async=True)
          >>> result = thread.get()
  
          :param async bool
          :param str query_task_id: Query task id. (required)
          :return: str
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('async'):
              return self.kill_query_with_http_info(query_task_id, **kwargs)  # noqa: E501
          else:
              (data) = self.kill_query_with_http_info(query_task_id, **kwargs)  # noqa: E501
              return data
  
      def kill_query_with_http_info(self, query_task_id, **kwargs):  # noqa: E501
          """Kill Running Query  # noqa: E501
  
          Kill a query with a specific query_task_id.   # noqa: E501
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async=True
          >>> thread = api.kill_query_with_http_info(query_task_id, async=True)
          >>> result = thread.get()
  
          :param async bool
          :param str query_task_id: Query task id. (required)
          :return: str
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['query_task_id']  # noqa: E501
          all_params.append('async')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in six.iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method kill_query" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'query_task_id' is set
          if ('query_task_id' not in params or
                  params['query_task_id'] is None):
              raise ValueError("Missing the required parameter `query_task_id` when calling `kill_query`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
          if 'query_task_id' in params:
              path_params['query_task_id'] = params['query_task_id']  # noqa: E501
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.select_header_accept(
              ['application/json'])  # noqa: E501
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
              ['application/json'])  # noqa: E501
  
          # Authentication setting
          auth_settings = []  # noqa: E501
  
          return self.api_client.call_api(
              '/running_queries/{query_task_id}', 'DELETE',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='str',  # noqa: E501
              auth_settings=auth_settings,
              async=params.get('async'),
              _return_http_data_only=params.get('_return_http_data_only'),
              _preload_content=params.get('_preload_content', True),
              _request_timeout=params.get('_request_timeout'),
              collection_formats=collection_formats)
  