import BaseListGetterApiConsumer from '../base-list-getter-api-consumer/base-list-getter-api-consumer';
export default class SdkListGetterApiConsumer extends BaseListGetterApiConsumer {
    constructor(SDKMethod, params) {
        super(params);
        this.SDKMethod = SDKMethod;
    }
    getList({ page = 1, size = 10, search, sort, fields, id, }) {
        return this._getList([page, size, search, sort, fields, id]);
    }
    getNestedList({ parentId, page = 1, size = 10, search, sort, fields, id, }) {
        return this._getList([parentId, page, size, search, sort, fields, id]);
    }
    async _getList(args) {
        try {
            // @ts-ignore
            let response = await this.SDKMethod(...args);
            response = this.responseHandler(response);
            if (this.userResponseHandler) {
                response = this.userResponseHandler(response);
            }
            return response;
        }
        catch (err) {
            throw err;
        }
    }
}
//# sourceMappingURL=sdk-list-getter-api-consumer.js.map