docs: def request(
          self,
          method,
          url,
          query_params=None,
          headers=None,
          body=None,
          post_params=None,
          _preload_content=True,
          _request_timeout=None,
      ):
          """
          :param method: http request method
          :param url: http request url
          :param query_params: query parameters in the url
          :param headers: http request headers
          :param body: request json body, for `application/json`
          :param post_params: request post parameters,
                              `application/x-www-form-urlencoded`
                              and `multipart/form-data`
          :param _preload_content: if False, the response object will be returned without
                                   reading/decoding response data. Default is True.
          :param _request_timeout: timeout setting for this request. If one number provided, it will be total request
                                   timeout. It can also be a pair (tuple) of (connection, read) timeouts.
          """
          # Based on the RESTClientObject class generated by Swagger
          method = method.upper()
          assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"]
  
          post_params = post_params or {}
          headers = headers or {}
  
          if "Content-Type" not in headers:
              headers["Content-Type"] = "application/json"
  
          request_kwargs = {}
  
          if query_params:
              url += "?" + urlencode(query_params)
  
          if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]:
              if re.search("json", headers["Content-Type"], re.IGNORECASE):
                  request_body = None
                  if body:
                      request_body = json.dumps(body)
                  request_kwargs["data"] = request_body
              elif headers["Content-Type"] == "application/x-www-form-urlencoded":
                  request_kwargs["data"] = post_params
              elif headers["Content-Type"] == "multipart/form-data":
                  del headers["Content-Type"]
                  request_kwargs["data"] = post_params
              elif isinstance(body, str):
                  request_kwargs["data"] = body
              else:
                  # Cannot generate the request from given parameters
                  msg = """Cannot prepare a request message for provided arguments.
                           Please check that your arguments match declared content type."""
                  raise ApiException(status=0, reason=msg)
  
          try:
              resp = self.session.request(
                  method,
                  url,
                  timeout=_request_timeout,
                  stream=not _preload_content,
                  headers=headers,
                  **request_kwargs
              )
          except requests.exceptions.RequestException as exc:
              msg = "{0}\n{1}".format(type(exc).__name__, str(exc))
              raise ApiException(status=0, reason=msg)
  
          resp.encoding = resp.apparent_encoding or "utf-8"
          rest_resp = RestResponse(resp)
  
          if _preload_content:
              logger.debug("response body: %s", rest_resp.data)
  
          if not 200 <= rest_resp.status <= 299:
              raise ApiException(http_resp=rest_resp)
  
          return rest_resp