UNPKG

merchantapi

Version:
44 lines (38 loc) 1.09 kB
/* * (c) Miva Inc <https://www.miva.com/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ const util = require('./../util'); const models = require('./../models'); const { Response } = require('./../abstract'); /** * API Response for Attribute_Load_Code. * @see https://docs.miva.com/json-api/functions/attribute_load_code * @class */ class AttributeLoadCode extends Response { /** * AttributeLoadCode Constructor. * @param {Request} request * @param {http.IncomingMessage} httpResponse * @param {Object} data */ constructor(request, httpResponse, data = {}) { super(request, httpResponse, data); if (!this.isSuccess()) { return; } this.data['data'] = new models.ProductAttribute(this.data['data']); } /** * Get productAttribute. * @returns {?ProductAttribute} */ getProductAttribute() { return util.isNullOrUndefined(this.data['data']) ? {} : this.data['data']; } } module.exports.AttributeLoadCode = AttributeLoadCode;