import BaseGetterApiConsumer from '../base-getter-api-consumer/base-getter-api-consumer';
export default class SdkGetterApiConsumer extends BaseGetterApiConsumer {
    constructor(SDKMethod, params) {
        super(params);
        this.SDKMethod = SDKMethod;
    }
    getItem({ itemId }) {
        return this._getItem([itemId]);
    }
    getNestedItem({ parentId, itemId }) {
        return this._getItem([parentId, itemId]);
    }
    async _getItem(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-getter-api-consumer.js.map