text: # coding: utf-8
  
  """
      Looker API 3.0 Reference
  
      ### Authorization  The Looker API uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page. Pass API3 credentials to the **/login** endpoint to obtain a temporary access_token. Include that access_token in the Authorization header of Looker API requests. For details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization)  ### Client SDKs  The Looker API is a RESTful system that should be usable by any programming language capable of making HTTPS requests. Client SDKs for a variety of programming languages can be generated from the Looker API's Swagger JSON metadata to streamline use of the Looker API in your applications. A client SDK for Ruby is available as an example. For more information, see [Looker API Client SDKs](https://looker.com/docs/r/api/client_sdks)  ### Try It Out!  The 'api-docs' page served by the Looker instance includes 'Try It Out!' buttons for each API method. After logging in with API3 credentials, you can use the \"Try It Out!\" buttons to call the API directly from the documentation page to interactively explore API features and responses.  ### Versioning  Future releases of Looker will expand this API release-by-release to securely expose more and more of the core power of Looker to API client applications. API endpoints marked as \"beta\" may receive breaking changes without warning. Stable (non-beta) API endpoints should not receive breaking changes in future releases. For more information, see [Looker API Versioning](https://looker.com/docs/r/api/versioning)   # noqa: E501
  
      OpenAPI spec version: 3.0.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_30.api_client import ApiClient
  
  
  class DataActionApi(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 fetch_remote_data_action_form(self, body, **kwargs):  # noqa: E501
          """Fetch Remote Data Action Form  # noqa: E501
  
          For some data actions, the remote server may supply a form requesting further user input. This endpoint takes a data action, asks the remote server to generate a form for it, and returns that form to you for presentation to the user.  # noqa: E501
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async=True
          >>> thread = api.fetch_remote_data_action_form(body, async=True)
          >>> result = thread.get()
  
          :param async bool
          :param object body: Data Action Request (required)
          :return: DataActionForm
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('async'):
              return self.fetch_remote_data_action_form_with_http_info(body, **kwargs)  # noqa: E501
          else:
              (data) = self.fetch_remote_data_action_form_with_http_info(body, **kwargs)  # noqa: E501
              return data
  
      def fetch_remote_data_action_form_with_http_info(self, body, **kwargs):  # noqa: E501
          """Fetch Remote Data Action Form  # noqa: E501
  
          For some data actions, the remote server may supply a form requesting further user input. This endpoint takes a data action, asks the remote server to generate a form for it, and returns that form to you for presentation to the user.  # noqa: E501
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async=True
          >>> thread = api.fetch_remote_data_action_form_with_http_info(body, async=True)
          >>> result = thread.get()
  
          :param async bool
          :param object body: Data Action Request (required)
          :return: DataActionForm
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['body']  # 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 fetch_remote_data_action_form" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'body' is set
          if ('body' not in params or
                  params['body'] is None):
              raise ValueError("Missing the required parameter `body` when calling `fetch_remote_data_action_form`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'body' in params:
              body_params = params['body']
          # 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(
              '/data_actions/form', 'POST',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='DataActionForm',  # 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 perform_data_action(self, body, **kwargs):  # noqa: E501
          """Send a Data Action  # noqa: E501
  
          Perform a data action. The data action object can be obtained from query results, and used to perform an arbitrary action.  # noqa: E501
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async=True
          >>> thread = api.perform_data_action(body, async=True)
          >>> result = thread.get()
  
          :param async bool
          :param DataActionRequest body: Data Action Request (required)
          :return: DataActionResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('async'):
              return self.perform_data_action_with_http_info(body, **kwargs)  # noqa: E501
          else:
              (data) = self.perform_data_action_with_http_info(body, **kwargs)  # noqa: E501
              return data
  
      def perform_data_action_with_http_info(self, body, **kwargs):  # noqa: E501
          """Send a Data Action  # noqa: E501
  
          Perform a data action. The data action object can be obtained from query results, and used to perform an arbitrary action.  # noqa: E501
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async=True
          >>> thread = api.perform_data_action_with_http_info(body, async=True)
          >>> result = thread.get()
  
          :param async bool
          :param DataActionRequest body: Data Action Request (required)
          :return: DataActionResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['body']  # 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 perform_data_action" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'body' is set
          if ('body' not in params or
                  params['body'] is None):
              raise ValueError("Missing the required parameter `body` when calling `perform_data_action`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'body' in params:
              body_params = params['body']
          # 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(
              '/data_actions', 'POST',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='DataActionResponse',  # 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)
  