'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * Licensed Materials - Property of IBM
 * IBM Business Analytics (C) Copyright IBM Corp. 2018, 2019
 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 */

/**
 * @class QueryServiceAPI
 * @hideconstructor
 * @classdesc API class that is used to run queries.
 */
define([], function () {
	var QueryServiceAPI = function () {
		function QueryServiceAPI() {
			_classCallCheck(this, QueryServiceAPI);
		}

		/**
   * @function QueryServiceAPI#executeQuery
   * @description Execute query with query spec.
   * @public
   * @async
   *
   * @param {String} sourceId The data source Id
   * @param {Object} querySpec The query specification.
   * @param {String} senderId (optional) The unique string identifier of the the query sender
   * @return {Promise<QueryResultAPI>} Returns a promise that will be resolved with a {@link QueryResultAPI} object
   */
		QueryServiceAPI.prototype.executeQuery = function executeQuery() {};

		/**
   * @function QueryServiceAPI#createQuery
   * @description Creates and returns a QueryAPI object to construct and run queries
   * @public
   *
   * @param {String} type The query type. E.g: 'minmax'
   * @return {QueryAPI} Returns a QueryAPI object
   */


		QueryServiceAPI.prototype.createQuery = function createQuery() {};

		/**
   * @function QueryServiceAPI#getDataItemValues
   * @description Get values of a column.
   * @public
   * @async
   *
   * @param {String} sourceId The data source Id
   * @param {String[]} [itemIdList=[]] An array of column ids
   * @param {Object} [filterList=[]] List of filter specs
   * @param {String} [sort] The sort option. 'asc', 'desc' or 'none'
   * @param {String} [searchTermList=[]] List of search terms
   * @param {String} [aggregationList] An array of aggregation types parallel to the itemIdList
   * @return {Promise<QueryResultAPI>} Returns a promise that will be resolved with a {@link QueryResultAPI} object
   */


		QueryServiceAPI.prototype.getColumnValues = function getColumnValues() {};

		/**
   * @function QueryServiceAPI#getColumnMinMaxValues
   * @description Get min max values of a column.
   * @public
   * @async
   *
   * @param {String} sourceId The data source Id
   * @param {String} itemId The column id
   * @param {Object} [filters] The filter spec
   * @return {Promise<QueryResultAPI>} Returns a promise that will be resolved with a {@link QueryResultAPI} object
   */


		QueryServiceAPI.prototype.getColumnMinMaxValues = function getColumnMinMaxValues() {};

		/**
   * @function QueryServiceAPI#getDataItemsMinMaxValues
   * @description Get min max values of given dataItems and projections.
   * @public
   * @async
   *
   * @param {String} sourceId The data source Id
   * @param {Object} dataItems The data items spec
   * @param {String[]} projections The array of projected data item unique IDs
   * @param {Object} [filters] The filter spec
   * @return {Promise<QueryResultAPI>} Returns a promise that will be resolved with a {@link QueryResultAPI} object
   * @example
   * getDataItemsMinMaxValues(
   * 'dataSourceId',
   * [{
   * 	'id': 'Sheet1.Product_line',
   * 	'itemId': 'Sheet1.Product_line',
   * 	'itemLabel': 'Product line'
   * 	},{
   * 	'id': 'Sheet1.Quantity',
   * 	'itemId': 'Sheet1.Quantity',
   * 	'itemLabel': 'Quantity',
   * 	'aggregate': 'sum'
   * 	},{
   * 	'id': 'Sheet1.Unit_cost',
   * 	'itemId': 'Quantity',
   * 	'itemLabel': 'Unit cost',
   * 	'aggregate': 'sum'
   * 	}],
   * [
   * 	'Sheet1.Quantity',
   * 	'Sheet1.Unit_cost'
   * ]).then(queryResultData => {});
   * The minmax query result will have 2 sets of minmax values, one for Sheet1.Quantity, and one for Sheet1.Unit_cost
   */


		QueryServiceAPI.prototype.getDataItemsMinMaxValues = function getDataItemsMinMaxValues() {};

		/**
   * @function QueryServiceAPI#getRootMembers
   * @description Get root members of a hierarchy.
   * @public
   * @async
   *
   * @param {String} sourceId The data source Id
   * @param {String|String[]} itemIds The hierarchy id or a list of hierarchy ids
   * @param {Object} [filters=[]] A list of filter specs
   * @param {Number} [rowLimit = 51] The number of rows to return
   * @return {Promise<QueryResultAPI>} Returns a promise that will be resolved with a {@link QueryResultAPI} object
   */


		QueryServiceAPI.prototype.getRootMembers = function getRootMembers() {};

		/**
   * @function QueryServiceAPI#getChildren
   * @description Get children of a member.
   * @public
   * @async
   *
   * @param {String} sourceId The data source Id
   * @param {String|String[]} [itemIds=[]] The hierarchy id or a list of hierarchy ids
   * @param {String} memberId The member id to get children
   * @param {Object} [filters] The filter spec
   * @param {Number} [rowLimit = 51] The number of rows to return
   * @param {Number} [offset = 0] The index to start from when fetching rows
   * @return {Promise<QueryResultAPI>} Returns a promise that will be resolved with a {@link QueryResultAPI} object
   */


		QueryServiceAPI.prototype.getChildren = function getChildren() {};

		/**
   * @function QueryServiceAPI#getChildren
   * @description Get siblings of a member.
   * @public
   * @async
   *
   * @param {String} sourceId The data source Id
   * @param {String|String[]} [itemId=[]] The hierarchy id or a list of hierarchy ids
   * @param {String} memberId The member id to get siblings
   * @param {Object} [filters=[]] The filter spec
   * @param {Number} [rowLimit = 51] The number of rows to return
   * @return {Promise<QueryResultAPI>} Returns a promise that will be resolved with a {@link QueryResultAPI} object
   */


		QueryServiceAPI.prototype.getSiblings = function getSiblings() {};

		/**
   * @function QueryServiceAPI#getAscendants
   * @description Get ascendants of an array of members.
   * @public
   * @async
   *
   * @param {String} sourceId The data source Id
   * @param {String|String[]} [itemIds=[]] The hierarchy id or a list of hierarchy ids
   * @param {String[]} memberIds An array of member IDs to get ascendants
   * @param {Object} [filters=[]] The filter spec
   * @return {Promise<QueryResultAPI>} Returns a promise that will be resolved with a {@link QueryResultAPI} object
   */


		QueryServiceAPI.prototype.getAscendants = function getAscendants() {};

		_createClass(QueryServiceAPI, null, [{
			key: 'TYPE',


			/**
    * @public
    * @readonly
    * @description Enumeration of Query type
    * @enum {String}
    * @memberof QueryServiceAPI
    */
			get: function get() {
				return {
					/** default */
					DEFAULT: undefined,
					/** min / max query */
					MINMAX: 'minmax',
					/** unaggregated detail query */
					DETAIL: 'detail'
				};
			}
		}]);

		return QueryServiceAPI;
	}();

	return QueryServiceAPI;
});
//# sourceMappingURL=QueryServiceAPI.js.map