=begin
#CoinAPI Indexes REST API

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

The version of the OpenAPI document: v1
Contact: support@apibricks.io
Generated by: https://openapi-generator.tech
Generator version: 7.14.0

=end

require 'cgi'

module OpenapiClient
  class IndexesApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Returns all data inputs for a specific index definition
    # @param index_definition_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<IndexesIndexDefinitionInputData>]
    def v1_indexdef_input_data_index_definition_id_all_get(index_definition_id, opts = {})
      data, _status_code, _headers = v1_indexdef_input_data_index_definition_id_all_get_with_http_info(index_definition_id, opts)
      data
    end

    # Returns all data inputs for a specific index definition
    # @param index_definition_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<IndexesIndexDefinitionInputData>, Integer, Hash)>] Array<IndexesIndexDefinitionInputData> data, response status code and response headers
    def v1_indexdef_input_data_index_definition_id_all_get_with_http_info(index_definition_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexdef_input_data_index_definition_id_all_get ...'
      end
      # verify the required parameter 'index_definition_id' is set
      if @api_client.config.client_side_validation && index_definition_id.nil?
        fail ArgumentError, "Missing the required parameter 'index_definition_id' when calling IndexesApi.v1_indexdef_input_data_index_definition_id_all_get"
      end
      # resource path
      local_var_path = '/v1/indexdef/input-data/{index_definition_id}/all'.sub('{' + 'index_definition_id' + '}', CGI.escape(index_definition_id.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(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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<IndexesIndexDefinitionInputData>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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

    # Returns data inputs for certain index definition and time
    # @param index_definition_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :time 
    # @option opts [Boolean] :enabled_only  (default to false)
    # @option opts [Boolean] :pending_only  (default to false)
    # @option opts [String] :filter_asset_id 
    # @option opts [Boolean] :with_status_info  (default to false)
    # @return [Array<IndexesIndexDefinitionSnapshotEntry>]
    def v1_indexdef_input_data_index_definition_id_get(index_definition_id, opts = {})
      data, _status_code, _headers = v1_indexdef_input_data_index_definition_id_get_with_http_info(index_definition_id, opts)
      data
    end

    # Returns data inputs for certain index definition and time
    # @param index_definition_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :time 
    # @option opts [Boolean] :enabled_only  (default to false)
    # @option opts [Boolean] :pending_only  (default to false)
    # @option opts [String] :filter_asset_id 
    # @option opts [Boolean] :with_status_info  (default to false)
    # @return [Array<(Array<IndexesIndexDefinitionSnapshotEntry>, Integer, Hash)>] Array<IndexesIndexDefinitionSnapshotEntry> data, response status code and response headers
    def v1_indexdef_input_data_index_definition_id_get_with_http_info(index_definition_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexdef_input_data_index_definition_id_get ...'
      end
      # verify the required parameter 'index_definition_id' is set
      if @api_client.config.client_side_validation && index_definition_id.nil?
        fail ArgumentError, "Missing the required parameter 'index_definition_id' when calling IndexesApi.v1_indexdef_input_data_index_definition_id_get"
      end
      # resource path
      local_var_path = '/v1/indexdef/input-data/{index_definition_id}'.sub('{' + 'index_definition_id' + '}', CGI.escape(index_definition_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'time'] = opts[:'time'] if !opts[:'time'].nil?
      query_params[:'enabled_only'] = opts[:'enabled_only'] if !opts[:'enabled_only'].nil?
      query_params[:'pending_only'] = opts[:'pending_only'] if !opts[:'pending_only'].nil?
      query_params[:'filter_asset_id'] = opts[:'filter_asset_id'] if !opts[:'filter_asset_id'].nil?
      query_params[:'with_status_info'] = opts[:'with_status_info'] if !opts[:'with_status_info'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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<IndexesIndexDefinitionSnapshotEntry>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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

    # Get all multi-asset weights
    # @param [Hash] opts the optional parameters
    # @return [Array<IndexesIndexMultiAssetWeight>]
    def v1_indexdef_multiasset_get(opts = {})
      data, _status_code, _headers = v1_indexdef_multiasset_get_with_http_info(opts)
      data
    end

    # Get all multi-asset weights
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<IndexesIndexMultiAssetWeight>, Integer, Hash)>] Array<IndexesIndexMultiAssetWeight> data, response status code and response headers
    def v1_indexdef_multiasset_get_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexdef_multiasset_get ...'
      end
      # resource path
      local_var_path = '/v1/indexdef/multiasset'

      # 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(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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<IndexesIndexMultiAssetWeight>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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

    # Get multi-asset weights for specific index
    # @param index_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<IndexesIndexMultiAssetWeight>]
    def v1_indexdef_multiasset_index_id_get(index_id, opts = {})
      data, _status_code, _headers = v1_indexdef_multiasset_index_id_get_with_http_info(index_id, opts)
      data
    end

    # Get multi-asset weights for specific index
    # @param index_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<IndexesIndexMultiAssetWeight>, Integer, Hash)>] Array<IndexesIndexMultiAssetWeight> data, response status code and response headers
    def v1_indexdef_multiasset_index_id_get_with_http_info(index_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexdef_multiasset_index_id_get ...'
      end
      # verify the required parameter 'index_id' is set
      if @api_client.config.client_side_validation && index_id.nil?
        fail ArgumentError, "Missing the required parameter 'index_id' when calling IndexesApi.v1_indexdef_multiasset_index_id_get"
      end
      # resource path
      local_var_path = '/v1/indexdef/multiasset/{index_id}'.sub('{' + 'index_id' + '}', CGI.escape(index_id.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(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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<IndexesIndexMultiAssetWeight>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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

    # List indexes
    # @param [Hash] opts the optional parameters
    # @return [Array<IndexesIndexIdentifier>]
    def v1_indexes_get(opts = {})
      data, _status_code, _headers = v1_indexes_get_with_http_info(opts)
      data
    end

    # List indexes
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<IndexesIndexIdentifier>, Integer, Hash)>] Array<IndexesIndexIdentifier> data, response status code and response headers
    def v1_indexes_get_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexes_get ...'
      end
      # resource path
      local_var_path = '/v1/indexes'

      # 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(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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<IndexesIndexIdentifier>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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

    # Current Index Values for index definition
    # @param index_definition_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<IndexesIndexDefinitionSnapshotEntry>]
    def v1_indexes_index_definition_id_current_snapshot_get(index_definition_id, opts = {})
      data, _status_code, _headers = v1_indexes_index_definition_id_current_snapshot_get_with_http_info(index_definition_id, opts)
      data
    end

    # Current Index Values for index definition
    # @param index_definition_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<IndexesIndexDefinitionSnapshotEntry>, Integer, Hash)>] Array<IndexesIndexDefinitionSnapshotEntry> data, response status code and response headers
    def v1_indexes_index_definition_id_current_snapshot_get_with_http_info(index_definition_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexes_index_definition_id_current_snapshot_get ...'
      end
      # verify the required parameter 'index_definition_id' is set
      if @api_client.config.client_side_validation && index_definition_id.nil?
        fail ArgumentError, "Missing the required parameter 'index_definition_id' when calling IndexesApi.v1_indexes_index_definition_id_current_snapshot_get"
      end
      # resource path
      local_var_path = '/v1/indexes/{index_definition_id}/currentSnapshot'.sub('{' + 'index_definition_id' + '}', CGI.escape(index_definition_id.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(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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<IndexesIndexDefinitionSnapshotEntry>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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

    # Historical Index Values for index definition
    # @param index_definition_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :time 
    # @return [Array<IndexesIndexDefinitionSnapshotEntry>]
    def v1_indexes_index_definition_id_history_snapshot_get(index_definition_id, opts = {})
      data, _status_code, _headers = v1_indexes_index_definition_id_history_snapshot_get_with_http_info(index_definition_id, opts)
      data
    end

    # Historical Index Values for index definition
    # @param index_definition_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :time 
    # @return [Array<(Array<IndexesIndexDefinitionSnapshotEntry>, Integer, Hash)>] Array<IndexesIndexDefinitionSnapshotEntry> data, response status code and response headers
    def v1_indexes_index_definition_id_history_snapshot_get_with_http_info(index_definition_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexes_index_definition_id_history_snapshot_get ...'
      end
      # verify the required parameter 'index_definition_id' is set
      if @api_client.config.client_side_validation && index_definition_id.nil?
        fail ArgumentError, "Missing the required parameter 'index_definition_id' when calling IndexesApi.v1_indexes_index_definition_id_history_snapshot_get"
      end
      # resource path
      local_var_path = '/v1/indexes/{index_definition_id}/historySnapshot'.sub('{' + 'index_definition_id' + '}', CGI.escape(index_definition_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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<IndexesIndexDefinitionSnapshotEntry>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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

    # Current Index Value
    # @param index_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [IndexesIndexValue]
    def v1_indexes_index_id_current_get(index_id, opts = {})
      data, _status_code, _headers = v1_indexes_index_id_current_get_with_http_info(index_id, opts)
      data
    end

    # Current Index Value
    # @param index_id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(IndexesIndexValue, Integer, Hash)>] IndexesIndexValue data, response status code and response headers
    def v1_indexes_index_id_current_get_with_http_info(index_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexes_index_id_current_get ...'
      end
      # verify the required parameter 'index_id' is set
      if @api_client.config.client_side_validation && index_id.nil?
        fail ArgumentError, "Missing the required parameter 'index_id' when calling IndexesApi.v1_indexes_index_id_current_get"
      end
      # resource path
      local_var_path = '/v1/indexes/{index_id}/current'.sub('{' + 'index_id' + '}', CGI.escape(index_id.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(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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] || 'IndexesIndexValue'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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

    # Historical Index Value w/Composition
    # @param index_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :time_start 
    # @option opts [Time] :time_end 
    # @option opts [Integer] :limit  (default to 100)
    # @return [Array<IndexesIndexValue>]
    def v1_indexes_index_id_history_get(index_id, opts = {})
      data, _status_code, _headers = v1_indexes_index_id_history_get_with_http_info(index_id, opts)
      data
    end

    # Historical Index Value w/Composition
    # @param index_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [Time] :time_start 
    # @option opts [Time] :time_end 
    # @option opts [Integer] :limit  (default to 100)
    # @return [Array<(Array<IndexesIndexValue>, Integer, Hash)>] Array<IndexesIndexValue> data, response status code and response headers
    def v1_indexes_index_id_history_get_with_http_info(index_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexes_index_id_history_get ...'
      end
      # verify the required parameter 'index_id' is set
      if @api_client.config.client_side_validation && index_id.nil?
        fail ArgumentError, "Missing the required parameter 'index_id' when calling IndexesApi.v1_indexes_index_id_history_get"
      end
      # resource path
      local_var_path = '/v1/indexes/{index_id}/history'.sub('{' + 'index_id' + '}', CGI.escape(index_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'time_start'] = opts[:'time_start'] if !opts[:'time_start'].nil?
      query_params[:'time_end'] = opts[:'time_end'] if !opts[:'time_end'].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(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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<IndexesIndexValue>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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

    # Timeseries Index Value
    # @param index_id [String] 
    # @param period_id [String] Identifier of requested timeseries period (e.g. &#x60;5SEC&#x60; or &#x60;1DAY&#x60;)
    # @param time_start [String] Timeseries starting time in ISO 8601
    # @param time_end [String] Timeseries ending time in ISO 8601
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :limit Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request) (default to 100)
    # @return [Array<IndexesIndexTimeseriesItem>]
    def v1_indexes_index_id_timeseries_get(index_id, period_id, time_start, time_end, opts = {})
      data, _status_code, _headers = v1_indexes_index_id_timeseries_get_with_http_info(index_id, period_id, time_start, time_end, opts)
      data
    end

    # Timeseries Index Value
    # @param index_id [String] 
    # @param period_id [String] Identifier of requested timeseries period (e.g. &#x60;5SEC&#x60; or &#x60;1DAY&#x60;)
    # @param time_start [String] Timeseries starting time in ISO 8601
    # @param time_end [String] Timeseries ending time in ISO 8601
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :limit Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request) (default to 100)
    # @return [Array<(Array<IndexesIndexTimeseriesItem>, Integer, Hash)>] Array<IndexesIndexTimeseriesItem> data, response status code and response headers
    def v1_indexes_index_id_timeseries_get_with_http_info(index_id, period_id, time_start, time_end, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: IndexesApi.v1_indexes_index_id_timeseries_get ...'
      end
      # verify the required parameter 'index_id' is set
      if @api_client.config.client_side_validation && index_id.nil?
        fail ArgumentError, "Missing the required parameter 'index_id' when calling IndexesApi.v1_indexes_index_id_timeseries_get"
      end
      # verify the required parameter 'period_id' is set
      if @api_client.config.client_side_validation && period_id.nil?
        fail ArgumentError, "Missing the required parameter 'period_id' when calling IndexesApi.v1_indexes_index_id_timeseries_get"
      end
      # verify the required parameter 'time_start' is set
      if @api_client.config.client_side_validation && time_start.nil?
        fail ArgumentError, "Missing the required parameter 'time_start' when calling IndexesApi.v1_indexes_index_id_timeseries_get"
      end
      # verify the required parameter 'time_end' is set
      if @api_client.config.client_side_validation && time_end.nil?
        fail ArgumentError, "Missing the required parameter 'time_end' when calling IndexesApi.v1_indexes_index_id_timeseries_get"
      end
      # resource path
      local_var_path = '/v1/indexes/{index_id}/timeseries'.sub('{' + 'index_id' + '}', CGI.escape(index_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'period_id'] = period_id
      query_params[:'time_start'] = time_start
      query_params[:'time_end'] = time_end
      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(['text/plain', 'application/json', 'text/json', 'application/x-msgpack']) 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<IndexesIndexTimeseriesItem>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['APIKey', 'JWT']

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