xi_sdk_resellers
Version:
Ingram Micro - Xvantage Integration (XI) Node.Js Server-side SDK.
416 lines (386 loc) • 21.8 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _QuoteDetailsResponseProductsInnerBillDetailsInner = _interopRequireDefault(require("./QuoteDetailsResponseProductsInnerBillDetailsInner"));
var _QuoteDetailsResponseProductsInnerPrice = _interopRequireDefault(require("./QuoteDetailsResponseProductsInnerPrice"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* XI Sdk Resellers
* For Resellers seeking to innovate with Ingram Micro's API solutions, automate your eCommerce experience with our array of API's and webhooks to craft a seamless journey for your customers.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
/**
* The QuoteDetailsResponseProductsInner model module.
* @module model/QuoteDetailsResponseProductsInner
* @version 1.0.0
*/
var QuoteDetailsResponseProductsInner = /*#__PURE__*/function () {
/**
* Constructs a new <code>QuoteDetailsResponseProductsInner</code>.
* @alias module:model/QuoteDetailsResponseProductsInner
*/
function QuoteDetailsResponseProductsInner() {
_classCallCheck(this, QuoteDetailsResponseProductsInner);
QuoteDetailsResponseProductsInner.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
return _createClass(QuoteDetailsResponseProductsInner, null, [{
key: "initialize",
value: function initialize(obj) {}
/**
* Constructs a <code>QuoteDetailsResponseProductsInner</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/QuoteDetailsResponseProductsInner} obj Optional instance to populate.
* @return {module:model/QuoteDetailsResponseProductsInner} The populated <code>QuoteDetailsResponseProductsInner</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new QuoteDetailsResponseProductsInner();
if (data.hasOwnProperty('quoteProductGuid')) {
obj['quoteProductGuid'] = _ApiClient["default"].convertToType(data['quoteProductGuid'], 'String');
}
if (data.hasOwnProperty('lineNumber')) {
obj['lineNumber'] = _ApiClient["default"].convertToType(data['lineNumber'], 'String');
}
if (data.hasOwnProperty('quantity')) {
obj['quantity'] = _ApiClient["default"].convertToType(data['quantity'], 'Number');
}
if (data.hasOwnProperty('remainingQuoteQty')) {
obj['remainingQuoteQty'] = _ApiClient["default"].convertToType(data['remainingQuoteQty'], 'Number');
}
if (data.hasOwnProperty('minimumOrderAllowedQty')) {
obj['minimumOrderAllowedQty'] = _ApiClient["default"].convertToType(data['minimumOrderAllowedQty'], 'Number');
}
if (data.hasOwnProperty('notes')) {
obj['notes'] = _ApiClient["default"].convertToType(data['notes'], 'String');
}
if (data.hasOwnProperty('ean')) {
obj['ean'] = _ApiClient["default"].convertToType(data['ean'], 'String');
}
if (data.hasOwnProperty('coo')) {
obj['coo'] = _ApiClient["default"].convertToType(data['coo'], 'String');
}
if (data.hasOwnProperty('ingramPartNumber')) {
obj['ingramPartNumber'] = _ApiClient["default"].convertToType(data['ingramPartNumber'], 'String');
}
if (data.hasOwnProperty('vendorPartNumber')) {
obj['vendorPartNumber'] = _ApiClient["default"].convertToType(data['vendorPartNumber'], 'String');
}
if (data.hasOwnProperty('description')) {
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
}
if (data.hasOwnProperty('weight')) {
obj['weight'] = _ApiClient["default"].convertToType(data['weight'], 'Number');
}
if (data.hasOwnProperty('weightUom')) {
obj['weightUom'] = _ApiClient["default"].convertToType(data['weightUom'], 'String');
}
if (data.hasOwnProperty('isSuggestionProduct')) {
obj['isSuggestionProduct'] = _ApiClient["default"].convertToType(data['isSuggestionProduct'], 'Boolean');
}
if (data.hasOwnProperty('vpnCategory')) {
obj['vpnCategory'] = _ApiClient["default"].convertToType(data['vpnCategory'], 'String');
}
if (data.hasOwnProperty('quoteProductsSupplierPartAuxiliaryId')) {
obj['quoteProductsSupplierPartAuxiliaryId'] = _ApiClient["default"].convertToType(data['quoteProductsSupplierPartAuxiliaryId'], 'String');
}
if (data.hasOwnProperty('vendorName')) {
obj['vendorName'] = _ApiClient["default"].convertToType(data['vendorName'], 'String');
}
if (data.hasOwnProperty('terms')) {
obj['terms'] = _ApiClient["default"].convertToType(data['terms'], 'String');
}
if (data.hasOwnProperty('planDescription')) {
obj['planDescription'] = _ApiClient["default"].convertToType(data['planDescription'], 'String');
}
if (data.hasOwnProperty('isSubscription')) {
obj['isSubscription'] = _ApiClient["default"].convertToType(data['isSubscription'], 'Boolean');
}
if (data.hasOwnProperty('resellerMargin')) {
obj['resellerMargin'] = _ApiClient["default"].convertToType(data['resellerMargin'], 'String');
}
if (data.hasOwnProperty('requestedStartDate')) {
obj['requestedStartDate'] = _ApiClient["default"].convertToType(data['requestedStartDate'], 'String');
}
if (data.hasOwnProperty('startDate')) {
obj['startDate'] = _ApiClient["default"].convertToType(data['startDate'], 'String');
}
if (data.hasOwnProperty('endDate')) {
obj['endDate'] = _ApiClient["default"].convertToType(data['endDate'], 'String');
}
if (data.hasOwnProperty('serialNumber')) {
obj['serialNumber'] = _ApiClient["default"].convertToType(data['serialNumber'], 'String');
}
if (data.hasOwnProperty('price')) {
obj['price'] = _QuoteDetailsResponseProductsInnerPrice["default"].constructFromObject(data['price']);
}
if (data.hasOwnProperty('billDetails')) {
obj['billDetails'] = _ApiClient["default"].convertToType(data['billDetails'], [_QuoteDetailsResponseProductsInnerBillDetailsInner["default"]]);
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>QuoteDetailsResponseProductsInner</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>QuoteDetailsResponseProductsInner</code>.
*/
}, {
key: "validateJSON",
value: function validateJSON(data) {
// ensure the json data is a string
if (data['quoteProductGuid'] && !(typeof data['quoteProductGuid'] === 'string' || data['quoteProductGuid'] instanceof String)) {
throw new Error("Expected the field `quoteProductGuid` to be a primitive type in the JSON string but got " + data['quoteProductGuid']);
}
// ensure the json data is a string
if (data['lineNumber'] && !(typeof data['lineNumber'] === 'string' || data['lineNumber'] instanceof String)) {
throw new Error("Expected the field `lineNumber` to be a primitive type in the JSON string but got " + data['lineNumber']);
}
// ensure the json data is a string
if (data['notes'] && !(typeof data['notes'] === 'string' || data['notes'] instanceof String)) {
throw new Error("Expected the field `notes` to be a primitive type in the JSON string but got " + data['notes']);
}
// ensure the json data is a string
if (data['ean'] && !(typeof data['ean'] === 'string' || data['ean'] instanceof String)) {
throw new Error("Expected the field `ean` to be a primitive type in the JSON string but got " + data['ean']);
}
// ensure the json data is a string
if (data['coo'] && !(typeof data['coo'] === 'string' || data['coo'] instanceof String)) {
throw new Error("Expected the field `coo` to be a primitive type in the JSON string but got " + data['coo']);
}
// ensure the json data is a string
if (data['ingramPartNumber'] && !(typeof data['ingramPartNumber'] === 'string' || data['ingramPartNumber'] instanceof String)) {
throw new Error("Expected the field `ingramPartNumber` to be a primitive type in the JSON string but got " + data['ingramPartNumber']);
}
// ensure the json data is a string
if (data['vendorPartNumber'] && !(typeof data['vendorPartNumber'] === 'string' || data['vendorPartNumber'] instanceof String)) {
throw new Error("Expected the field `vendorPartNumber` to be a primitive type in the JSON string but got " + data['vendorPartNumber']);
}
// ensure the json data is a string
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
}
// ensure the json data is a string
if (data['weightUom'] && !(typeof data['weightUom'] === 'string' || data['weightUom'] instanceof String)) {
throw new Error("Expected the field `weightUom` to be a primitive type in the JSON string but got " + data['weightUom']);
}
// ensure the json data is a string
if (data['vpnCategory'] && !(typeof data['vpnCategory'] === 'string' || data['vpnCategory'] instanceof String)) {
throw new Error("Expected the field `vpnCategory` to be a primitive type in the JSON string but got " + data['vpnCategory']);
}
// ensure the json data is a string
if (data['quoteProductsSupplierPartAuxiliaryId'] && !(typeof data['quoteProductsSupplierPartAuxiliaryId'] === 'string' || data['quoteProductsSupplierPartAuxiliaryId'] instanceof String)) {
throw new Error("Expected the field `quoteProductsSupplierPartAuxiliaryId` to be a primitive type in the JSON string but got " + data['quoteProductsSupplierPartAuxiliaryId']);
}
// ensure the json data is a string
if (data['vendorName'] && !(typeof data['vendorName'] === 'string' || data['vendorName'] instanceof String)) {
throw new Error("Expected the field `vendorName` to be a primitive type in the JSON string but got " + data['vendorName']);
}
// ensure the json data is a string
if (data['terms'] && !(typeof data['terms'] === 'string' || data['terms'] instanceof String)) {
throw new Error("Expected the field `terms` to be a primitive type in the JSON string but got " + data['terms']);
}
// ensure the json data is a string
if (data['planDescription'] && !(typeof data['planDescription'] === 'string' || data['planDescription'] instanceof String)) {
throw new Error("Expected the field `planDescription` to be a primitive type in the JSON string but got " + data['planDescription']);
}
// ensure the json data is a string
if (data['resellerMargin'] && !(typeof data['resellerMargin'] === 'string' || data['resellerMargin'] instanceof String)) {
throw new Error("Expected the field `resellerMargin` to be a primitive type in the JSON string but got " + data['resellerMargin']);
}
// ensure the json data is a string
if (data['requestedStartDate'] && !(typeof data['requestedStartDate'] === 'string' || data['requestedStartDate'] instanceof String)) {
throw new Error("Expected the field `requestedStartDate` to be a primitive type in the JSON string but got " + data['requestedStartDate']);
}
// ensure the json data is a string
if (data['startDate'] && !(typeof data['startDate'] === 'string' || data['startDate'] instanceof String)) {
throw new Error("Expected the field `startDate` to be a primitive type in the JSON string but got " + data['startDate']);
}
// ensure the json data is a string
if (data['endDate'] && !(typeof data['endDate'] === 'string' || data['endDate'] instanceof String)) {
throw new Error("Expected the field `endDate` to be a primitive type in the JSON string but got " + data['endDate']);
}
// ensure the json data is a string
if (data['serialNumber'] && !(typeof data['serialNumber'] === 'string' || data['serialNumber'] instanceof String)) {
throw new Error("Expected the field `serialNumber` to be a primitive type in the JSON string but got " + data['serialNumber']);
}
// validate the optional field `price`
if (data['price']) {
// data not null
_QuoteDetailsResponseProductsInnerPrice["default"].validateJSON(data['price']);
}
if (data['billDetails']) {
// data not null
// ensure the json data is an array
if (!Array.isArray(data['billDetails'])) {
throw new Error("Expected the field `billDetails` to be an array in the JSON data but got " + data['billDetails']);
}
// validate the optional field `billDetails` (array)
var _iterator = _createForOfIteratorHelper(data['billDetails']),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var item = _step.value;
_QuoteDetailsResponseProductsInnerBillDetailsInner["default"].validateJSON(item);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
;
}
return true;
}
}]);
}();
/**
* Quote Product GUID is the primary quote key in Ingram Micro's CRM - needed to retrieve quote details.
* @member {String} quoteProductGuid
*/
QuoteDetailsResponseProductsInner.prototype['quoteProductGuid'] = undefined;
/**
* Line number which the product will appear in the quote. Line number is manditory when unique configurations are included in a quote and mainting the item line order is required.
* @member {String} lineNumber
*/
QuoteDetailsResponseProductsInner.prototype['lineNumber'] = undefined;
/**
* Quantity of product line item quoted.
* @member {Number} quantity
*/
QuoteDetailsResponseProductsInner.prototype['quantity'] = undefined;
/**
* @member {Number} remainingQuoteQty
*/
QuoteDetailsResponseProductsInner.prototype['remainingQuoteQty'] = undefined;
/**
* @member {Number} minimumOrderAllowedQty
*/
QuoteDetailsResponseProductsInner.prototype['minimumOrderAllowedQty'] = undefined;
/**
* Product line item comments.
* @member {String} notes
*/
QuoteDetailsResponseProductsInner.prototype['notes'] = undefined;
/**
* EANUPC
* @member {String} ean
*/
QuoteDetailsResponseProductsInner.prototype['ean'] = undefined;
/**
* Country of Origin.
* @member {String} coo
*/
QuoteDetailsResponseProductsInner.prototype['coo'] = undefined;
/**
* Ingram Micro SKU (stock keeping unit). An identification, usually alphanumeric, of a particular product that allows it to be tracked for inventory purposes
* @member {String} ingramPartNumber
*/
QuoteDetailsResponseProductsInner.prototype['ingramPartNumber'] = undefined;
/**
* Vendor Part Number
* @member {String} vendorPartNumber
*/
QuoteDetailsResponseProductsInner.prototype['vendorPartNumber'] = undefined;
/**
* Product description. Note - The quote view api returns only the product short description as maintained in Ingram Micro's crm system. For long descriptions, please refer to alternative information sources.
* @member {String} description
*/
QuoteDetailsResponseProductsInner.prototype['description'] = undefined;
/**
* Weight is provided based on country standard. For countries following Imperial standards - weight is presented as pounds with decimal. In countries following metric standards, weight is provided as kilograms with decimal.
* @member {Number} weight
*/
QuoteDetailsResponseProductsInner.prototype['weight'] = undefined;
/**
* Unit of measure
* @member {String} weightUom
*/
QuoteDetailsResponseProductsInner.prototype['weightUom'] = undefined;
/**
* Flag to indicate if a product line item is a suggested product. The suggested product is provided in addition to the requested quoted products and a suggested option. Suggested products are grouped together for subtotal and total calculations.
* @member {Boolean} isSuggestionProduct
*/
QuoteDetailsResponseProductsInner.prototype['isSuggestionProduct'] = undefined;
/**
* Vendor product category specific to Cisco. HWDW (hardware) or service.
* @member {String} vpnCategory
*/
QuoteDetailsResponseProductsInner.prototype['vpnCategory'] = undefined;
/**
* Vendor product configuration ID specific to Cisco.
* @member {String} quoteProductsSupplierPartAuxiliaryId
*/
QuoteDetailsResponseProductsInner.prototype['quoteProductsSupplierPartAuxiliaryId'] = undefined;
/**
* Vendor name of the product
* @member {String} vendorName
*/
QuoteDetailsResponseProductsInner.prototype['vendorName'] = undefined;
/**
* Terms of the quote
* @member {String} terms
*/
QuoteDetailsResponseProductsInner.prototype['terms'] = undefined;
/**
* @member {String} planDescription
*/
QuoteDetailsResponseProductsInner.prototype['planDescription'] = undefined;
/**
* @member {Boolean} isSubscription
*/
QuoteDetailsResponseProductsInner.prototype['isSubscription'] = undefined;
/**
* @member {String} resellerMargin
*/
QuoteDetailsResponseProductsInner.prototype['resellerMargin'] = undefined;
/**
* @member {String} requestedStartDate
*/
QuoteDetailsResponseProductsInner.prototype['requestedStartDate'] = undefined;
/**
* @member {String} startDate
*/
QuoteDetailsResponseProductsInner.prototype['startDate'] = undefined;
/**
* @member {String} endDate
*/
QuoteDetailsResponseProductsInner.prototype['endDate'] = undefined;
/**
* @member {String} serialNumber
*/
QuoteDetailsResponseProductsInner.prototype['serialNumber'] = undefined;
/**
* @member {module:model/QuoteDetailsResponseProductsInnerPrice} price
*/
QuoteDetailsResponseProductsInner.prototype['price'] = undefined;
/**
* @member {Array.<module:model/QuoteDetailsResponseProductsInnerBillDetailsInner>} billDetails
*/
QuoteDetailsResponseProductsInner.prototype['billDetails'] = undefined;
var _default = exports["default"] = QuoteDetailsResponseProductsInner;