UNPKG

xi_sdk_resellers

Version:

Ingram Micro - Xvantage Integration (XI) Node.Js Server-side SDK.

107 lines (104 loc) 6.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _ApiClient = _interopRequireDefault(require("../ApiClient")); var _FreightRequest = _interopRequireDefault(require("../model/FreightRequest")); var _FreightResponse = _interopRequireDefault(require("../model/FreightResponse")); var _PostCreateorderV7500Response = _interopRequireDefault(require("../model/PostCreateorderV7500Response")); var _PostRenewalssearch400Response = _interopRequireDefault(require("../model/PostRenewalssearch400Response")); 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 _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. * */ /** * FreightEstimate service. * @module api/FreightEstimateApi * @version 1.0.0 */ var FreightEstimateApi = exports["default"] = /*#__PURE__*/function () { /** * Constructs a new FreightEstimateApi. * @alias module:api/FreightEstimateApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ function FreightEstimateApi(apiClient) { _classCallCheck(this, FreightEstimateApi); this.apiClient = apiClient || _ApiClient["default"].instance; } /** * Callback function to receive the result of the postFreightestimate operation. * @callback module:api/FreightEstimateApi~postFreightestimateCallback * @param {String} error Error message, if any. * @param {module:model/FreightResponse} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Freight Estimate * The freight estimator endpoint will allow customers to understand the freight cost for an order. * @param {String} iMCustomerNumber Your unique Ingram Micro customer number. * @param {String} iMCountryCode Two-character ISO country code. * @param {String} iMCorrelationID Unique transaction number to identify each transaction across all the systems. * @param {String} iMCustomerContact Logged in Users email address contact. * @param {Object} opts Optional parameters * @param {String} [iMSenderID] Unique value used to identify the sender of the transaction. * @param {module:model/FreightRequest} [freightRequest] * @param {module:api/FreightEstimateApi~postFreightestimateCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/FreightResponse} */ return _createClass(FreightEstimateApi, [{ key: "postFreightestimate", value: function postFreightestimate(iMCustomerNumber, iMCountryCode, iMCorrelationID, iMCustomerContact, opts, callback) { opts = opts || {}; var postBody = opts['freightRequest']; // verify the required parameter 'iMCustomerNumber' is set if (iMCustomerNumber === undefined || iMCustomerNumber === null) { throw new Error("Missing the required parameter 'iMCustomerNumber' when calling postFreightestimate"); } // verify the required parameter 'iMCountryCode' is set if (iMCountryCode === undefined || iMCountryCode === null) { throw new Error("Missing the required parameter 'iMCountryCode' when calling postFreightestimate"); } // verify the required parameter 'iMCorrelationID' is set if (iMCorrelationID === undefined || iMCorrelationID === null) { throw new Error("Missing the required parameter 'iMCorrelationID' when calling postFreightestimate"); } // verify the required parameter 'iMCustomerContact' is set if (iMCustomerContact === undefined || iMCustomerContact === null) { throw new Error("Missing the required parameter 'iMCustomerContact' when calling postFreightestimate"); } var pathParams = {}; var queryParams = {}; var headerParams = { 'IM-CustomerNumber': iMCustomerNumber, 'IM-CountryCode': iMCountryCode, 'IM-CorrelationID': iMCorrelationID, 'IM-CustomerContact': iMCustomerContact, 'IM-SenderID': opts['iMSenderID'] }; var formParams = {}; var authNames = ['application']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = _FreightResponse["default"]; return this.apiClient.callApi('/resellers/v6/freightestimate', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback); } }]); }();