=begin
#Hatchet API

#The Hatchet API

The version of the OpenAPI document: 1.0.0

Generated by: https://openapi-generator.tech
Generator version: 7.14.0

=end

require 'cgi'

module HatchetSdkRest
  class TaskApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # List tasks
    # Lists all tasks that belong a specific list of dags
    # @param dag_ids [Array<String>] The external id of the DAG
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [Array<V1DagChildren>]
    def v1_dag_list_tasks(dag_ids, tenant, opts = {})
      data, _status_code, _headers = v1_dag_list_tasks_with_http_info(dag_ids, tenant, opts)
      data
    end

    # List tasks
    # Lists all tasks that belong a specific list of dags
    # @param dag_ids [Array<String>] The external id of the DAG
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<V1DagChildren>, Integer, Hash)>] Array<V1DagChildren> data, response status code and response headers
    def v1_dag_list_tasks_with_http_info(dag_ids, tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TaskApi.v1_dag_list_tasks ...'
      end
      # verify the required parameter 'dag_ids' is set
      if @api_client.config.client_side_validation && dag_ids.nil?
        fail ArgumentError, "Missing the required parameter 'dag_ids' when calling TaskApi.v1_dag_list_tasks"
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TaskApi.v1_dag_list_tasks"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_dag_list_tasks, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_dag_list_tasks, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/stable/dags/tasks'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'dag_ids'] = @api_client.build_collection_param(dag_ids, :multi)
      query_params[:'tenant'] = tenant

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Array<V1DagChildren>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TaskApi.v1_dag_list_tasks",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TaskApi#v1_dag_list_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Cancel tasks
    # Cancel tasks
    # @param tenant [String] The tenant id
    # @param v1_cancel_task_request [V1CancelTaskRequest] The tasks to cancel
    # @param [Hash] opts the optional parameters
    # @return [V1CancelledTasks]
    def v1_task_cancel(tenant, v1_cancel_task_request, opts = {})
      data, _status_code, _headers = v1_task_cancel_with_http_info(tenant, v1_cancel_task_request, opts)
      data
    end

    # Cancel tasks
    # Cancel tasks
    # @param tenant [String] The tenant id
    # @param v1_cancel_task_request [V1CancelTaskRequest] The tasks to cancel
    # @param [Hash] opts the optional parameters
    # @return [Array<(V1CancelledTasks, Integer, Hash)>] V1CancelledTasks data, response status code and response headers
    def v1_task_cancel_with_http_info(tenant, v1_cancel_task_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TaskApi.v1_task_cancel ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TaskApi.v1_task_cancel"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_task_cancel, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_task_cancel, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'v1_cancel_task_request' is set
      if @api_client.config.client_side_validation && v1_cancel_task_request.nil?
        fail ArgumentError, "Missing the required parameter 'v1_cancel_task_request' when calling TaskApi.v1_task_cancel"
      end
      # resource path
      local_var_path = '/api/v1/stable/tenants/{tenant}/tasks/cancel'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(v1_cancel_task_request)

      # return_type
      return_type = opts[:debug_return_type] || 'V1CancelledTasks'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TaskApi.v1_task_cancel",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TaskApi#v1_task_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List events for a task
    # List events for a task
    # @param task [String] The task id
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :offset The number to skip
    # @option opts [Integer] :limit The number to limit by
    # @return [V1TaskEventList]
    def v1_task_event_list(task, opts = {})
      data, _status_code, _headers = v1_task_event_list_with_http_info(task, opts)
      data
    end

    # List events for a task
    # List events for a task
    # @param task [String] The task id
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :offset The number to skip
    # @option opts [Integer] :limit The number to limit by
    # @return [Array<(V1TaskEventList, Integer, Hash)>] V1TaskEventList data, response status code and response headers
    def v1_task_event_list_with_http_info(task, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TaskApi.v1_task_event_list ...'
      end
      # verify the required parameter 'task' is set
      if @api_client.config.client_side_validation && task.nil?
        fail ArgumentError, "Missing the required parameter 'task' when calling TaskApi.v1_task_event_list"
      end
      if @api_client.config.client_side_validation && task.to_s.length > 36
        fail ArgumentError, 'invalid value for "task" when calling TaskApi.v1_task_event_list, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && task.to_s.length < 36
        fail ArgumentError, 'invalid value for "task" when calling TaskApi.v1_task_event_list, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/stable/tasks/{task}/task-events'.sub('{' + 'task' + '}', CGI.escape(task.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
      query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'V1TaskEventList'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TaskApi.v1_task_event_list",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TaskApi#v1_task_event_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get a task
    # Get a task by id
    # @param task [String] The task id
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :attempt The attempt number
    # @return [V1TaskSummary]
    def v1_task_get(task, opts = {})
      data, _status_code, _headers = v1_task_get_with_http_info(task, opts)
      data
    end

    # Get a task
    # Get a task by id
    # @param task [String] The task id
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :attempt The attempt number
    # @return [Array<(V1TaskSummary, Integer, Hash)>] V1TaskSummary data, response status code and response headers
    def v1_task_get_with_http_info(task, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TaskApi.v1_task_get ...'
      end
      # verify the required parameter 'task' is set
      if @api_client.config.client_side_validation && task.nil?
        fail ArgumentError, "Missing the required parameter 'task' when calling TaskApi.v1_task_get"
      end
      if @api_client.config.client_side_validation && task.to_s.length > 36
        fail ArgumentError, 'invalid value for "task" when calling TaskApi.v1_task_get, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && task.to_s.length < 36
        fail ArgumentError, 'invalid value for "task" when calling TaskApi.v1_task_get, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/stable/tasks/{task}'.sub('{' + 'task' + '}', CGI.escape(task.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'attempt'] = opts[:'attempt'] if !opts[:'attempt'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'V1TaskSummary'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TaskApi.v1_task_get",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TaskApi#v1_task_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get task point metrics
    # Get a minute by minute breakdown of task metrics for a tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :created_after The time after the task was created
    # @option opts [Time] :finished_before The time before the task was completed
    # @return [V1TaskPointMetrics]
    def v1_task_get_point_metrics(tenant, opts = {})
      data, _status_code, _headers = v1_task_get_point_metrics_with_http_info(tenant, opts)
      data
    end

    # Get task point metrics
    # Get a minute by minute breakdown of task metrics for a tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :created_after The time after the task was created
    # @option opts [Time] :finished_before The time before the task was completed
    # @return [Array<(V1TaskPointMetrics, Integer, Hash)>] V1TaskPointMetrics data, response status code and response headers
    def v1_task_get_point_metrics_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TaskApi.v1_task_get_point_metrics ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TaskApi.v1_task_get_point_metrics"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_task_get_point_metrics, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_task_get_point_metrics, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/stable/tenants/{tenant}/task-point-metrics'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
      query_params[:'finishedBefore'] = opts[:'finished_before'] if !opts[:'finished_before'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'V1TaskPointMetrics'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TaskApi.v1_task_get_point_metrics",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TaskApi#v1_task_get_point_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get task metrics
    # Get a summary of task run metrics for a tenant
    # @param tenant [String] The tenant id
    # @param since [Time] The start time to get metrics for
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :_until The end time to get metrics for
    # @option opts [Array<String>] :workflow_ids The workflow id to find runs for
    # @option opts [String] :parent_task_external_id The parent task&#39;s external id
    # @option opts [String] :triggering_event_external_id The id of the event that triggered the task
    # @option opts [Array<String>] :additional_metadata Additional metadata k-v pairs to filter by
    # @return [Array<V1TaskRunMetric>]
    def v1_task_list_status_metrics(tenant, since, opts = {})
      data, _status_code, _headers = v1_task_list_status_metrics_with_http_info(tenant, since, opts)
      data
    end

    # Get task metrics
    # Get a summary of task run metrics for a tenant
    # @param tenant [String] The tenant id
    # @param since [Time] The start time to get metrics for
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :_until The end time to get metrics for
    # @option opts [Array<String>] :workflow_ids The workflow id to find runs for
    # @option opts [String] :parent_task_external_id The parent task&#39;s external id
    # @option opts [String] :triggering_event_external_id The id of the event that triggered the task
    # @option opts [Array<String>] :additional_metadata Additional metadata k-v pairs to filter by
    # @return [Array<(Array<V1TaskRunMetric>, Integer, Hash)>] Array<V1TaskRunMetric> data, response status code and response headers
    def v1_task_list_status_metrics_with_http_info(tenant, since, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TaskApi.v1_task_list_status_metrics ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TaskApi.v1_task_list_status_metrics"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_task_list_status_metrics, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_task_list_status_metrics, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'since' is set
      if @api_client.config.client_side_validation && since.nil?
        fail ArgumentError, "Missing the required parameter 'since' when calling TaskApi.v1_task_list_status_metrics"
      end
      if @api_client.config.client_side_validation && !opts[:'parent_task_external_id'].nil? && opts[:'parent_task_external_id'].to_s.length > 36
        fail ArgumentError, 'invalid value for "opts[:"parent_task_external_id"]" when calling TaskApi.v1_task_list_status_metrics, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && !opts[:'parent_task_external_id'].nil? && opts[:'parent_task_external_id'].to_s.length < 36
        fail ArgumentError, 'invalid value for "opts[:"parent_task_external_id"]" when calling TaskApi.v1_task_list_status_metrics, the character length must be greater than or equal to 36.'
      end

      if @api_client.config.client_side_validation && !opts[:'triggering_event_external_id'].nil? && opts[:'triggering_event_external_id'].to_s.length > 36
        fail ArgumentError, 'invalid value for "opts[:"triggering_event_external_id"]" when calling TaskApi.v1_task_list_status_metrics, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && !opts[:'triggering_event_external_id'].nil? && opts[:'triggering_event_external_id'].to_s.length < 36
        fail ArgumentError, 'invalid value for "opts[:"triggering_event_external_id"]" when calling TaskApi.v1_task_list_status_metrics, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/stable/tenants/{tenant}/task-metrics'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'since'] = since
      query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
      query_params[:'workflow_ids'] = @api_client.build_collection_param(opts[:'workflow_ids'], :multi) if !opts[:'workflow_ids'].nil?
      query_params[:'parent_task_external_id'] = opts[:'parent_task_external_id'] if !opts[:'parent_task_external_id'].nil?
      query_params[:'triggering_event_external_id'] = opts[:'triggering_event_external_id'] if !opts[:'triggering_event_external_id'].nil?
      query_params[:'additional_metadata'] = @api_client.build_collection_param(opts[:'additional_metadata'], :multi) if !opts[:'additional_metadata'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Array<V1TaskRunMetric>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TaskApi.v1_task_list_status_metrics",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TaskApi#v1_task_list_status_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Replay tasks
    # Replay tasks
    # @param tenant [String] The tenant id
    # @param v1_replay_task_request [V1ReplayTaskRequest] The tasks to replay
    # @param [Hash] opts the optional parameters
    # @return [V1ReplayedTasks]
    def v1_task_replay(tenant, v1_replay_task_request, opts = {})
      data, _status_code, _headers = v1_task_replay_with_http_info(tenant, v1_replay_task_request, opts)
      data
    end

    # Replay tasks
    # Replay tasks
    # @param tenant [String] The tenant id
    # @param v1_replay_task_request [V1ReplayTaskRequest] The tasks to replay
    # @param [Hash] opts the optional parameters
    # @return [Array<(V1ReplayedTasks, Integer, Hash)>] V1ReplayedTasks data, response status code and response headers
    def v1_task_replay_with_http_info(tenant, v1_replay_task_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TaskApi.v1_task_replay ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TaskApi.v1_task_replay"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_task_replay, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TaskApi.v1_task_replay, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'v1_replay_task_request' is set
      if @api_client.config.client_side_validation && v1_replay_task_request.nil?
        fail ArgumentError, "Missing the required parameter 'v1_replay_task_request' when calling TaskApi.v1_task_replay"
      end
      # resource path
      local_var_path = '/api/v1/stable/tenants/{tenant}/tasks/replay'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(v1_replay_task_request)

      # return_type
      return_type = opts[:debug_return_type] || 'V1ReplayedTasks'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TaskApi.v1_task_replay",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TaskApi#v1_task_replay\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
