UNPKG

xi_sdk_resellers

Version:

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

218 lines (213 loc) 12.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _ApiClient = _interopRequireDefault(require("../ApiClient")); var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse")); var _InvoiceDetailsv61Response = _interopRequireDefault(require("../model/InvoiceDetailsv61Response")); var _InvoiceSearchResponse = _interopRequireDefault(require("../model/InvoiceSearchResponse")); 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. * */ /** * Invoices service. * @module api/InvoicesApi * @version 1.0.0 */ var InvoicesApi = exports["default"] = /*#__PURE__*/function () { /** * Constructs a new InvoicesApi. * @alias module:api/InvoicesApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ function InvoicesApi(apiClient) { _classCallCheck(this, InvoicesApi); this.apiClient = apiClient || _ApiClient["default"].instance; } /** * Callback function to receive the result of the getInvoicedetailsV61 operation. * @callback module:api/InvoicesApi~getInvoicedetailsV61Callback * @param {String} error Error message, if any. * @param {module:model/InvoiceDetailsv61Response} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get Invoice Details v6.1 * Use your Ingram Micro invoice number to search for existing invoices or retrieve existing invoice details. The invoice number, IM-CustomerNumber, IM-CountryCode, IM-ApplicationId and IM-CorrelationID are required parameters. . * @param {String} invoiceNumber The Ingram Micro invoice number. * @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} iMApplicationID Unique value used to identify the sender of the transaction. Example: MyCompany. * @param {Object} opts Optional parameters * @param {String} [customerType] it should be invoice or order * @param {Boolean} [includeSerialNumbers] if serial in the response send as true or else false * @param {module:api/InvoicesApi~getInvoicedetailsV61Callback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/InvoiceDetailsv61Response} */ return _createClass(InvoicesApi, [{ key: "getInvoicedetailsV61", value: function getInvoicedetailsV61(invoiceNumber, iMCustomerNumber, iMCountryCode, iMCorrelationID, iMApplicationID, opts, callback) { opts = opts || {}; var postBody = null; // verify the required parameter 'invoiceNumber' is set if (invoiceNumber === undefined || invoiceNumber === null) { throw new Error("Missing the required parameter 'invoiceNumber' when calling getInvoicedetailsV61"); } // verify the required parameter 'iMCustomerNumber' is set if (iMCustomerNumber === undefined || iMCustomerNumber === null) { throw new Error("Missing the required parameter 'iMCustomerNumber' when calling getInvoicedetailsV61"); } // verify the required parameter 'iMCountryCode' is set if (iMCountryCode === undefined || iMCountryCode === null) { throw new Error("Missing the required parameter 'iMCountryCode' when calling getInvoicedetailsV61"); } // verify the required parameter 'iMCorrelationID' is set if (iMCorrelationID === undefined || iMCorrelationID === null) { throw new Error("Missing the required parameter 'iMCorrelationID' when calling getInvoicedetailsV61"); } // verify the required parameter 'iMApplicationID' is set if (iMApplicationID === undefined || iMApplicationID === null) { throw new Error("Missing the required parameter 'iMApplicationID' when calling getInvoicedetailsV61"); } var pathParams = { 'invoiceNumber': invoiceNumber }; var queryParams = { 'customerType': opts['customerType'], 'includeSerialNumbers': opts['includeSerialNumbers'] }; var headerParams = { 'IM-CustomerNumber': iMCustomerNumber, 'IM-CountryCode': iMCountryCode, 'IM-CorrelationID': iMCorrelationID, 'IM-ApplicationID': iMApplicationID }; var formParams = {}; var authNames = ['application']; var contentTypes = []; var accepts = ['application/json']; var returnType = _InvoiceDetailsv61Response["default"]; return this.apiClient.callApi('/resellers/v6.1/invoices/{invoiceNumber}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback); } /** * Callback function to receive the result of the getResellersV6Invoicesearch operation. * @callback module:api/InvoicesApi~getResellersV6InvoicesearchCallback * @param {String} error Error message, if any. * @param {module:model/InvoiceSearchResponse} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Search your invoice * Search your Ingram Micro invoices. This endpoint searches by multiple invoice parameters and supports pagination of results. * @param {String} iMApplicationID Unique value used to identify the sender of the transaction. Example: MyCompany * @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 {Object} opts Optional parameters * @param {String} [paymentTermsNetDate] Search by payment terms net date(yyyy-MM-dd). * @param {String} [invoiceDate] Search by invoice date(yyyy-MM-dd). * @param {String} [invoiceDueDate] Search by invoice date from(yyyy-MM-dd). * @param {String} [orderDate] Search by OrderDate date(yyyy-MM-dd). * @param {String} [orderFromDate] Search by OrderFromDate date(yyyy-MM-dd). * @param {String} [orderToDate] Search by OrderToDate date(yyyy-MM-dd). * @param {String} [orderNumber] Search by order number * @param {String} [deliveryNumber] Search by delivery number. * @param {String} [invoiceNumber] The Ingram Micro invoice number. * @param {String} [invoiceStatus] Ingram Micro invoice status. * @param {String} [invoiceType] Ingram Micro InvoiceType. * @param {String} [customerOrderNumber] Ingram Micro CustomerOrderNumber. * @param {String} [endCustomerOrderNumber] Ingram Micro EndCustomerOrderNumber. * @param {String} [specialBidNumber] Ingram Micro SpecialBidNumber. * @param {String} [invoiceFromDueDate] Search by invoice due date from(yyyy-MM-dd). * @param {String} [invoiceToDueDate] Search by invoice due date to(yyyy-MM-dd). * @param {Array.<String>} [invoiceFromDate] Search by invoice date from(yyyy-MM-dd). * @param {Array.<String>} [invoiceToDate] Search by invoice date To(yyyy-MM-dd). * @param {Number} [pageSize] Number of records required in the call - max records 100 per page. * @param {Number} [pageNumber] The page number reference. * @param {String} [orderby] Column name with which we want to sort. * @param {String} [direction] asc or desc , along with orderby column result set will be sorted. * @param {String} [serialNumber] Serial number of the product. * @param {module:api/InvoicesApi~getResellersV6InvoicesearchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/InvoiceSearchResponse} */ }, { key: "getResellersV6Invoicesearch", value: function getResellersV6Invoicesearch(iMApplicationID, iMCustomerNumber, iMCountryCode, iMCorrelationID, opts, callback) { opts = opts || {}; var postBody = null; // verify the required parameter 'iMApplicationID' is set if (iMApplicationID === undefined || iMApplicationID === null) { throw new Error("Missing the required parameter 'iMApplicationID' when calling getResellersV6Invoicesearch"); } // verify the required parameter 'iMCustomerNumber' is set if (iMCustomerNumber === undefined || iMCustomerNumber === null) { throw new Error("Missing the required parameter 'iMCustomerNumber' when calling getResellersV6Invoicesearch"); } // verify the required parameter 'iMCountryCode' is set if (iMCountryCode === undefined || iMCountryCode === null) { throw new Error("Missing the required parameter 'iMCountryCode' when calling getResellersV6Invoicesearch"); } // verify the required parameter 'iMCorrelationID' is set if (iMCorrelationID === undefined || iMCorrelationID === null) { throw new Error("Missing the required parameter 'iMCorrelationID' when calling getResellersV6Invoicesearch"); } var pathParams = {}; var queryParams = { 'paymentTermsNetDate': opts['paymentTermsNetDate'], 'invoiceDate': opts['invoiceDate'], 'invoiceDueDate': opts['invoiceDueDate'], 'orderDate': opts['orderDate'], 'orderFromDate': opts['orderFromDate'], 'orderToDate': opts['orderToDate'], 'orderNumber': opts['orderNumber'], 'DeliveryNumber': opts['deliveryNumber'], 'invoiceNumber': opts['invoiceNumber'], 'invoiceStatus': opts['invoiceStatus'], 'invoiceType': opts['invoiceType'], 'customerOrderNumber': opts['customerOrderNumber'], 'endCustomerOrderNumber': opts['endCustomerOrderNumber'], 'specialBidNumber': opts['specialBidNumber'], 'invoiceFromDueDate': opts['invoiceFromDueDate'], 'invoiceToDueDate': opts['invoiceToDueDate'], 'invoiceFromDate': this.apiClient.buildCollectionParam(opts['invoiceFromDate'], 'multi'), 'invoiceToDate': this.apiClient.buildCollectionParam(opts['invoiceToDate'], 'multi'), 'pageSize': opts['pageSize'], 'pageNumber': opts['pageNumber'], 'orderby': opts['orderby'], 'direction': opts['direction'], 'serialNumber': opts['serialNumber'] }; var headerParams = { 'IM-ApplicationID': iMApplicationID, 'IM-CustomerNumber': iMCustomerNumber, 'IM-CountryCode': iMCountryCode, 'IM-CorrelationID': iMCorrelationID }; var formParams = {}; var authNames = ['application']; var contentTypes = []; var accepts = ['application/json']; var returnType = _InvoiceSearchResponse["default"]; return this.apiClient.callApi('/resellers/v6/invoices', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback); } }]); }();