# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

=begin
#Nomad

#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: 1.1.4
Contact: support@hashicorp.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.2.0

=end

require 'cgi'

module NomadClient
  class JobsApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @option opts [Boolean] :purge Boolean flag indicating whether to purge allocations of the job after deleting.
    # @option opts [Boolean] :global Boolean flag indicating whether the operation should apply to all instances of the job globally.
    # @return [JobDeregisterResponse]
    def delete_job(job_name, opts = {})
      data, _status_code, _headers = delete_job_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @option opts [Boolean] :purge Boolean flag indicating whether to purge allocations of the job after deleting.
    # @option opts [Boolean] :global Boolean flag indicating whether the operation should apply to all instances of the job globally.
    # @return [Array<(JobDeregisterResponse, Integer, Hash)>] JobDeregisterResponse data, response status code and response headers
    def delete_job_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.delete_job ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.delete_job"
      end
      # resource path
      local_var_path = '/job/{jobName}'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'idempotency_token'] = opts[:'idempotency_token'] if !opts[:'idempotency_token'].nil?
      query_params[:'purge'] = opts[:'purge'] if !opts[:'purge'].nil?
      query_params[:'global'] = opts[:'global'] if !opts[:'global'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.delete_job",
        :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(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: JobsApi#delete_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Job]
    def get_job(job_name, opts = {})
      data, _status_code, _headers = get_job_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
    def get_job_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.get_job ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.get_job"
      end
      # resource path
      local_var_path = '/job/{jobName}'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
      query_params[:'stale'] = opts[:'stale'] if !opts[:'stale'].nil?
      query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
      query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
      query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.get_job",
        :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: JobsApi#get_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @option opts [Boolean] :all Specifies whether the list of allocations should include allocations from a previously registered job with the same ID. This is possible if the job is deregistered and reregistered.
    # @return [Array<AllocationListStub>]
    def get_job_allocations(job_name, opts = {})
      data, _status_code, _headers = get_job_allocations_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @option opts [Boolean] :all Specifies whether the list of allocations should include allocations from a previously registered job with the same ID. This is possible if the job is deregistered and reregistered.
    # @return [Array<(Array<AllocationListStub>, Integer, Hash)>] Array<AllocationListStub> data, response status code and response headers
    def get_job_allocations_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.get_job_allocations ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.get_job_allocations"
      end
      # resource path
      local_var_path = '/job/{jobName}/allocations'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
      query_params[:'stale'] = opts[:'stale'] if !opts[:'stale'].nil?
      query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
      query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
      query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?
      query_params[:'all'] = opts[:'all'] if !opts[:'all'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.get_job_allocations",
        :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: JobsApi#get_job_allocations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Deployment]
    def get_job_deployment(job_name, opts = {})
      data, _status_code, _headers = get_job_deployment_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Array<(Deployment, Integer, Hash)>] Deployment data, response status code and response headers
    def get_job_deployment_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.get_job_deployment ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.get_job_deployment"
      end
      # resource path
      local_var_path = '/job/{jobName}/deployment'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
      query_params[:'stale'] = opts[:'stale'] if !opts[:'stale'].nil?
      query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
      query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
      query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.get_job_deployment",
        :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: JobsApi#get_job_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @option opts [Integer] :all Flag indicating whether to constrain by job creation index or not.
    # @return [Array<Deployment>]
    def get_job_deployments(job_name, opts = {})
      data, _status_code, _headers = get_job_deployments_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @option opts [Integer] :all Flag indicating whether to constrain by job creation index or not.
    # @return [Array<(Array<Deployment>, Integer, Hash)>] Array<Deployment> data, response status code and response headers
    def get_job_deployments_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.get_job_deployments ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.get_job_deployments"
      end
      # resource path
      local_var_path = '/job/{jobName}/deployments'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
      query_params[:'stale'] = opts[:'stale'] if !opts[:'stale'].nil?
      query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
      query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
      query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?
      query_params[:'all'] = opts[:'all'] if !opts[:'all'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.get_job_deployments",
        :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: JobsApi#get_job_deployments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Array<Evaluation>]
    def get_job_evaluations(job_name, opts = {})
      data, _status_code, _headers = get_job_evaluations_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Array<(Array<Evaluation>, Integer, Hash)>] Array<Evaluation> data, response status code and response headers
    def get_job_evaluations_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.get_job_evaluations ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.get_job_evaluations"
      end
      # resource path
      local_var_path = '/job/{jobName}/evaluations'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
      query_params[:'stale'] = opts[:'stale'] if !opts[:'stale'].nil?
      query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
      query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
      query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.get_job_evaluations",
        :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: JobsApi#get_job_evaluations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [JobScaleStatusResponse]
    def get_job_scale_status(job_name, opts = {})
      data, _status_code, _headers = get_job_scale_status_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Array<(JobScaleStatusResponse, Integer, Hash)>] JobScaleStatusResponse data, response status code and response headers
    def get_job_scale_status_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.get_job_scale_status ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.get_job_scale_status"
      end
      # resource path
      local_var_path = '/job/{jobName}/scale'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
      query_params[:'stale'] = opts[:'stale'] if !opts[:'stale'].nil?
      query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
      query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
      query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.get_job_scale_status",
        :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: JobsApi#get_job_scale_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [JobSummary]
    def get_job_summary(job_name, opts = {})
      data, _status_code, _headers = get_job_summary_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Array<(JobSummary, Integer, Hash)>] JobSummary data, response status code and response headers
    def get_job_summary_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.get_job_summary ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.get_job_summary"
      end
      # resource path
      local_var_path = '/job/{jobName}/summary'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
      query_params[:'stale'] = opts[:'stale'] if !opts[:'stale'].nil?
      query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
      query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
      query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.get_job_summary",
        :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: JobsApi#get_job_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @option opts [Boolean] :diffs Boolean flag indicating whether to compute job diffs.
    # @return [JobVersionsResponse]
    def get_job_versions(job_name, opts = {})
      data, _status_code, _headers = get_job_versions_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @option opts [Boolean] :diffs Boolean flag indicating whether to compute job diffs.
    # @return [Array<(JobVersionsResponse, Integer, Hash)>] JobVersionsResponse data, response status code and response headers
    def get_job_versions_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.get_job_versions ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.get_job_versions"
      end
      # resource path
      local_var_path = '/job/{jobName}/versions'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
      query_params[:'stale'] = opts[:'stale'] if !opts[:'stale'].nil?
      query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
      query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
      query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?
      query_params[:'diffs'] = opts[:'diffs'] if !opts[:'diffs'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.get_job_versions",
        :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: JobsApi#get_job_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Array<JobListStub>]
    def get_jobs(opts = {})
      data, _status_code, _headers = get_jobs_with_http_info(opts)
      data
    end

    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [Integer] :index If set, wait until query exceeds given index. Must be provided with WaitParam.
    # @option opts [String] :wait Provided with IndexParam to wait for change.
    # @option opts [String] :stale If present, results will include stale reads.
    # @option opts [String] :prefix Constrains results to jobs that start with the defined prefix
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [Integer] :per_page Maximum number of results to return.
    # @option opts [String] :next_token Indicates where to start paging for queries that support pagination.
    # @return [Array<(Array<JobListStub>, Integer, Hash)>] Array<JobListStub> data, response status code and response headers
    def get_jobs_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.get_jobs ...'
      end
      # resource path
      local_var_path = '/jobs'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
      query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
      query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil?
      query_params[:'stale'] = opts[:'stale'] if !opts[:'stale'].nil?
      query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
      query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
      query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.get_jobs",
        :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: JobsApi#get_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param job_register_request [JobRegisterRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [JobRegisterResponse]
    def post_job(job_name, job_register_request, opts = {})
      data, _status_code, _headers = post_job_with_http_info(job_name, job_register_request, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param job_register_request [JobRegisterRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(JobRegisterResponse, Integer, Hash)>] JobRegisterResponse data, response status code and response headers
    def post_job_with_http_info(job_name, job_register_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.post_job"
      end
      # verify the required parameter 'job_register_request' is set
      if @api_client.config.client_side_validation && job_register_request.nil?
        fail ArgumentError, "Missing the required parameter 'job_register_request' when calling JobsApi.post_job"
      end
      # resource path
      local_var_path = '/job/{jobName}'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

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

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

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job",
        :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: JobsApi#post_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param job_dispatch_request [JobDispatchRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [JobDispatchResponse]
    def post_job_dispatch(job_name, job_dispatch_request, opts = {})
      data, _status_code, _headers = post_job_dispatch_with_http_info(job_name, job_dispatch_request, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param job_dispatch_request [JobDispatchRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(JobDispatchResponse, Integer, Hash)>] JobDispatchResponse data, response status code and response headers
    def post_job_dispatch_with_http_info(job_name, job_dispatch_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job_dispatch ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.post_job_dispatch"
      end
      # verify the required parameter 'job_dispatch_request' is set
      if @api_client.config.client_side_validation && job_dispatch_request.nil?
        fail ArgumentError, "Missing the required parameter 'job_dispatch_request' when calling JobsApi.post_job_dispatch"
      end
      # resource path
      local_var_path = '/job/{jobName}/dispatch'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

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

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

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job_dispatch",
        :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: JobsApi#post_job_dispatch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param job_evaluate_request [JobEvaluateRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [JobRegisterResponse]
    def post_job_evaluate(job_name, job_evaluate_request, opts = {})
      data, _status_code, _headers = post_job_evaluate_with_http_info(job_name, job_evaluate_request, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param job_evaluate_request [JobEvaluateRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(JobRegisterResponse, Integer, Hash)>] JobRegisterResponse data, response status code and response headers
    def post_job_evaluate_with_http_info(job_name, job_evaluate_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job_evaluate ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.post_job_evaluate"
      end
      # verify the required parameter 'job_evaluate_request' is set
      if @api_client.config.client_side_validation && job_evaluate_request.nil?
        fail ArgumentError, "Missing the required parameter 'job_evaluate_request' when calling JobsApi.post_job_evaluate"
      end
      # resource path
      local_var_path = '/job/{jobName}/evaluate'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

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

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

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job_evaluate",
        :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: JobsApi#post_job_evaluate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param jobs_parse_request [JobsParseRequest] 
    # @param [Hash] opts the optional parameters
    # @return [Job]
    def post_job_parse(jobs_parse_request, opts = {})
      data, _status_code, _headers = post_job_parse_with_http_info(jobs_parse_request, opts)
      data
    end

    # @param jobs_parse_request [JobsParseRequest] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
    def post_job_parse_with_http_info(jobs_parse_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job_parse ...'
      end
      # verify the required parameter 'jobs_parse_request' is set
      if @api_client.config.client_side_validation && jobs_parse_request.nil?
        fail ArgumentError, "Missing the required parameter 'jobs_parse_request' when calling JobsApi.post_job_parse"
      end
      # resource path
      local_var_path = '/jobs/parse'

      # 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'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job_parse",
        :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: JobsApi#post_job_parse\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [PeriodicForceResponse]
    def post_job_periodic_force(job_name, opts = {})
      data, _status_code, _headers = post_job_periodic_force_with_http_info(job_name, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(PeriodicForceResponse, Integer, Hash)>] PeriodicForceResponse data, response status code and response headers
    def post_job_periodic_force_with_http_info(job_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job_periodic_force ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.post_job_periodic_force"
      end
      # resource path
      local_var_path = '/job/{jobName}/periodic/force'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params[:'X-Nomad-Token'] = opts[:'x_nomad_token'] if !opts[:'x_nomad_token'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job_periodic_force",
        :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: JobsApi#post_job_periodic_force\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param job_plan_request [JobPlanRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [JobPlanResponse]
    def post_job_plan(job_name, job_plan_request, opts = {})
      data, _status_code, _headers = post_job_plan_with_http_info(job_name, job_plan_request, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param job_plan_request [JobPlanRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(JobPlanResponse, Integer, Hash)>] JobPlanResponse data, response status code and response headers
    def post_job_plan_with_http_info(job_name, job_plan_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job_plan ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.post_job_plan"
      end
      # verify the required parameter 'job_plan_request' is set
      if @api_client.config.client_side_validation && job_plan_request.nil?
        fail ArgumentError, "Missing the required parameter 'job_plan_request' when calling JobsApi.post_job_plan"
      end
      # resource path
      local_var_path = '/job/{jobName}/plan'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

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

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

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job_plan",
        :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: JobsApi#post_job_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param job_revert_request [JobRevertRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [JobRegisterResponse]
    def post_job_revert(job_name, job_revert_request, opts = {})
      data, _status_code, _headers = post_job_revert_with_http_info(job_name, job_revert_request, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param job_revert_request [JobRevertRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(JobRegisterResponse, Integer, Hash)>] JobRegisterResponse data, response status code and response headers
    def post_job_revert_with_http_info(job_name, job_revert_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job_revert ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.post_job_revert"
      end
      # verify the required parameter 'job_revert_request' is set
      if @api_client.config.client_side_validation && job_revert_request.nil?
        fail ArgumentError, "Missing the required parameter 'job_revert_request' when calling JobsApi.post_job_revert"
      end
      # resource path
      local_var_path = '/job/{jobName}/revert'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

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

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

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job_revert",
        :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: JobsApi#post_job_revert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param scaling_request [ScalingRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [JobRegisterResponse]
    def post_job_scaling_request(job_name, scaling_request, opts = {})
      data, _status_code, _headers = post_job_scaling_request_with_http_info(job_name, scaling_request, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param scaling_request [ScalingRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(JobRegisterResponse, Integer, Hash)>] JobRegisterResponse data, response status code and response headers
    def post_job_scaling_request_with_http_info(job_name, scaling_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job_scaling_request ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.post_job_scaling_request"
      end
      # verify the required parameter 'scaling_request' is set
      if @api_client.config.client_side_validation && scaling_request.nil?
        fail ArgumentError, "Missing the required parameter 'scaling_request' when calling JobsApi.post_job_scaling_request"
      end
      # resource path
      local_var_path = '/job/{jobName}/scale'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

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

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

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job_scaling_request",
        :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: JobsApi#post_job_scaling_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_name [String] The job identifier.
    # @param job_stability_request [JobStabilityRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [JobStabilityResponse]
    def post_job_stability(job_name, job_stability_request, opts = {})
      data, _status_code, _headers = post_job_stability_with_http_info(job_name, job_stability_request, opts)
      data
    end

    # @param job_name [String] The job identifier.
    # @param job_stability_request [JobStabilityRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(JobStabilityResponse, Integer, Hash)>] JobStabilityResponse data, response status code and response headers
    def post_job_stability_with_http_info(job_name, job_stability_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job_stability ...'
      end
      # verify the required parameter 'job_name' is set
      if @api_client.config.client_side_validation && job_name.nil?
        fail ArgumentError, "Missing the required parameter 'job_name' when calling JobsApi.post_job_stability"
      end
      # verify the required parameter 'job_stability_request' is set
      if @api_client.config.client_side_validation && job_stability_request.nil?
        fail ArgumentError, "Missing the required parameter 'job_stability_request' when calling JobsApi.post_job_stability"
      end
      # resource path
      local_var_path = '/job/{jobName}/stable'.sub('{' + 'jobName' + '}', CGI.escape(job_name.to_s))

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

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

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job_stability",
        :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: JobsApi#post_job_stability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_validate_request [JobValidateRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [JobValidateResponse]
    def post_job_validate_request(job_validate_request, opts = {})
      data, _status_code, _headers = post_job_validate_request_with_http_info(job_validate_request, opts)
      data
    end

    # @param job_validate_request [JobValidateRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(JobValidateResponse, Integer, Hash)>] JobValidateResponse data, response status code and response headers
    def post_job_validate_request_with_http_info(job_validate_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.post_job_validate_request ...'
      end
      # verify the required parameter 'job_validate_request' is set
      if @api_client.config.client_side_validation && job_validate_request.nil?
        fail ArgumentError, "Missing the required parameter 'job_validate_request' when calling JobsApi.post_job_validate_request"
      end
      # resource path
      local_var_path = '/validate/job'

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

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

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.post_job_validate_request",
        :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: JobsApi#post_job_validate_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # @param job_register_request [JobRegisterRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [JobRegisterResponse]
    def register_job(job_register_request, opts = {})
      data, _status_code, _headers = register_job_with_http_info(job_register_request, opts)
      data
    end

    # @param job_register_request [JobRegisterRequest] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :region Filters results based on the specified region.
    # @option opts [String] :namespace Filters results based on the specified namespace.
    # @option opts [String] :x_nomad_token A Nomad ACL token.
    # @option opts [String] :idempotency_token Can be used to ensure operations are only run once.
    # @return [Array<(JobRegisterResponse, Integer, Hash)>] JobRegisterResponse data, response status code and response headers
    def register_job_with_http_info(job_register_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: JobsApi.register_job ...'
      end
      # verify the required parameter 'job_register_request' is set
      if @api_client.config.client_side_validation && job_register_request.nil?
        fail ArgumentError, "Missing the required parameter 'job_register_request' when calling JobsApi.register_job"
      end
      # resource path
      local_var_path = '/jobs'

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

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

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['X-Nomad-Token']

      new_options = opts.merge(
        :operation => :"JobsApi.register_job",
        :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: JobsApi#register_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
