xi_sdk_resellers
Version:
Ingram Micro - Xvantage Integration (XI) Node.Js Server-side SDK.
251 lines (244 loc) • 16.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
var _GetResellerV6ValidateQuote400Response = _interopRequireDefault(require("../model/GetResellerV6ValidateQuote400Response"));
var _PostCreateorderV7500Response = _interopRequireDefault(require("../model/PostCreateorderV7500Response"));
var _QuoteDetailsResponse = _interopRequireDefault(require("../model/QuoteDetailsResponse"));
var _QuoteSearchResponse = _interopRequireDefault(require("../model/QuoteSearchResponse"));
var _ValidateQuoteResponse = _interopRequireDefault(require("../model/ValidateQuoteResponse"));
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.
*
*/
/**
* Quotes service.
* @module api/QuotesApi
* @version 1.0.0
*/
var QuotesApi = exports["default"] = /*#__PURE__*/function () {
/**
* Constructs a new QuotesApi.
* @alias module:api/QuotesApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
function QuotesApi(apiClient) {
_classCallCheck(this, QuotesApi);
this.apiClient = apiClient || _ApiClient["default"].instance;
}
/**
* Callback function to receive the result of the getQuotessearchV6 operation.
* @callback module:api/QuotesApi~getQuotessearchV6Callback
* @param {String} error Error message, if any.
* @param {module:model/QuoteSearchResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Quote Search
* The Quote Search API, by default, will retrieve quotes modified or created within the last 30 days. Quotes older than 365 days are excluded by default. The date filters enable the retrieval of quotes older than 30 days and up to 365 days when using date range criteria. The Quote Search API enables the retrieval and filtering of relevant quote list key criteria data such as Quote Number, Special Bid Numbers, End User Name, Quote Status, and Date Ranges from Ingram Micros CRM system. Only Active quotes are avaiable through the API. Draft and Closed quotes are excluded and are not accessable through the Quote List Search API.
* @param {String} iMCustomerNumber Your unique Ingram Micro customer number.
* @param {String} iMCountryCode Two-character ISO country code.
* @param {String} iMCustomerContact Logged in Users email address contact.
* @param {String} iMCorrelationID Unique transaction number to identify each transaction across all the systems.
* @param {Object} opts Optional parameters
* @param {Array.<String>} [ingramOrderDateBt] Search with start and end date(only 2 entries allowed).
* @param {String} [quoteNumber] Unique identifier generated by Ingram Micros CRM specific to each quote. When applying a filter to the quoteNumber and including a partial quote number in the filter, all quotes containing any information included in the filter can be retrieved as a subset of all available customer quotes.
* @param {String} [specialBidNumber] Special Pricing Bid Number, also referred to as a Dart Number by some vendors, is a unique identifier associated with vendor specific products and discounts.
* @param {String} [endUserContact] End User Name is the end customer name that is associated with a quote in Ingram Micros CRM.
* @param {String} [sortingOrder] Sort applies to the selected column (sortingColumnName) and may be specified in Ascending (asc) or Descending (desc) order. The default sort is Descending (desc) - most recent first.
* @param {String} [sortBy] Refers to the column selected to apply the sorting criteria. The default column is dateCreated and will sort by the most recently created quote first with the following in descending order. The default filter retrieves quotes created within the last 30 days. Filtering allows user to select a specific column to sort: quoteNumber, createdDate, lastModifiedDate and expiryDate.
* @param {Number} [pageSize] Number of records (quotes) to display per page in the quote list. The default is 25, but may be decreased using the filter .
* @param {Number} [pageNumber = 1)] Page index or page number for the list of quotes being returned.
* @param {String} [vendorName] The name of the vendor.
* @param {String} [quoteName] The quote name was given by the customer while creating quote.
* @param {String} [status] The status of the quote.
* @param {String} [quoteCreateDateBt] Search with start and end date(only 2 entries allowed).
* @param {String} [iMSenderID] Unique value used to identify the sender of the transaction. Example: MyCompany
* @param {module:api/QuotesApi~getQuotessearchV6Callback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/QuoteSearchResponse}
*/
return _createClass(QuotesApi, [{
key: "getQuotessearchV6",
value: function getQuotessearchV6(iMCustomerNumber, iMCountryCode, iMCustomerContact, iMCorrelationID, opts, callback) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'iMCustomerNumber' is set
if (iMCustomerNumber === undefined || iMCustomerNumber === null) {
throw new Error("Missing the required parameter 'iMCustomerNumber' when calling getQuotessearchV6");
}
// verify the required parameter 'iMCountryCode' is set
if (iMCountryCode === undefined || iMCountryCode === null) {
throw new Error("Missing the required parameter 'iMCountryCode' when calling getQuotessearchV6");
}
// verify the required parameter 'iMCustomerContact' is set
if (iMCustomerContact === undefined || iMCustomerContact === null) {
throw new Error("Missing the required parameter 'iMCustomerContact' when calling getQuotessearchV6");
}
// verify the required parameter 'iMCorrelationID' is set
if (iMCorrelationID === undefined || iMCorrelationID === null) {
throw new Error("Missing the required parameter 'iMCorrelationID' when calling getQuotessearchV6");
}
var pathParams = {};
var queryParams = {
'ingramOrderDate-bt': this.apiClient.buildCollectionParam(opts['ingramOrderDateBt'], 'multi'),
'quoteNumber': opts['quoteNumber'],
'specialBidNumber': opts['specialBidNumber'],
'endUserContact': opts['endUserContact'],
'sortingOrder': opts['sortingOrder'],
'sortBy': opts['sortBy'],
'pageSize': opts['pageSize'],
'pageNumber': opts['pageNumber'],
'vendorName': opts['vendorName'],
'quoteName': opts['quoteName'],
'status': opts['status'],
'quoteCreateDate-bt': opts['quoteCreateDateBt']
};
var headerParams = {
'IM-CustomerNumber': iMCustomerNumber,
'IM-CountryCode': iMCountryCode,
'IM-CustomerContact': iMCustomerContact,
'IM-CorrelationID': iMCorrelationID,
'IM-SenderID': opts['iMSenderID']
};
var formParams = {};
var authNames = ['application'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = _QuoteSearchResponse["default"];
return this.apiClient.callApi('/resellers/v6/quotes/search', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the getResellerV6ValidateQuote operation.
* @callback module:api/QuotesApi~getResellerV6ValidateQuoteCallback
* @param {String} error Error message, if any.
* @param {module:model/ValidateQuoteResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Validate Quote
* The validate quote helps the customer validate the quote created in Ingram Micro's system. Apart from validating the quote, the endpoint also identifies all the mandatory fields that are required by the vendor at the header and line levels.
* @param {String} quoteNumber A unique identifier generated by Ingram Micro's CRM specific to each quote.
* @param {String} iMCustomerNumber Your Ingram Micro unique customer number.
* @param {String} iMCountryCode Two-character ISO country code.
* @param {String} iMCorrelationID Unique transaction number to identify each transaction accross all the systems.
* @param {Object} opts Optional parameters
* @param {String} [iMSenderID] Unique identifier used to identify the third party source accessing the services.
* @param {module:api/QuotesApi~getResellerV6ValidateQuoteCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/ValidateQuoteResponse}
*/
}, {
key: "getResellerV6ValidateQuote",
value: function getResellerV6ValidateQuote(quoteNumber, iMCustomerNumber, iMCountryCode, iMCorrelationID, opts, callback) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'quoteNumber' is set
if (quoteNumber === undefined || quoteNumber === null) {
throw new Error("Missing the required parameter 'quoteNumber' when calling getResellerV6ValidateQuote");
}
// verify the required parameter 'iMCustomerNumber' is set
if (iMCustomerNumber === undefined || iMCustomerNumber === null) {
throw new Error("Missing the required parameter 'iMCustomerNumber' when calling getResellerV6ValidateQuote");
}
// verify the required parameter 'iMCountryCode' is set
if (iMCountryCode === undefined || iMCountryCode === null) {
throw new Error("Missing the required parameter 'iMCountryCode' when calling getResellerV6ValidateQuote");
}
// verify the required parameter 'iMCorrelationID' is set
if (iMCorrelationID === undefined || iMCorrelationID === null) {
throw new Error("Missing the required parameter 'iMCorrelationID' when calling getResellerV6ValidateQuote");
}
var pathParams = {};
var queryParams = {
'quoteNumber': quoteNumber
};
var headerParams = {
'IM-CustomerNumber': iMCustomerNumber,
'IM-CountryCode': iMCountryCode,
'IM-SenderID': opts['iMSenderID'],
'IM-CorrelationID': iMCorrelationID
};
var formParams = {};
var authNames = ['application'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = _ValidateQuoteResponse["default"];
return this.apiClient.callApi('/resellers/v6/q2o/validatequote', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the getResellersV6Quotes operation.
* @callback module:api/QuotesApi~getResellersV6QuotesCallback
* @param {String} error Error message, if any.
* @param {module:model/QuoteDetailsResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get Quote Details
* The quote details API provides all quote details associated with the quote number provided. The **“quoteNumber”**, **“isoCountryCode”** and **“customerNumber”** parameters are required.
* @param {String} iMCustomerNumber Your Ingram Micro unique customer number
* @param {String} iMCountryCode Two-character ISO country code.
* @param {String} iMCorrelationID Unique transaction number to identify each transaction accross all the systems.
* @param {String} quoteNumber Unique identifier generated by Ingram Micro's CRM specific to each quote. When applying a filter to the quoteNumber and including a partial quote number in the filter, all quotes containing any information included in the filter can be retrieved as a subset of all available customer quotes.
* @param {Object} opts Optional parameters
* @param {String} [iMSenderID] Unique identifier used to identify the third party source accessing the services.
* @param {module:api/QuotesApi~getResellersV6QuotesCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/QuoteDetailsResponse}
*/
}, {
key: "getResellersV6Quotes",
value: function getResellersV6Quotes(iMCustomerNumber, iMCountryCode, iMCorrelationID, quoteNumber, opts, callback) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'iMCustomerNumber' is set
if (iMCustomerNumber === undefined || iMCustomerNumber === null) {
throw new Error("Missing the required parameter 'iMCustomerNumber' when calling getResellersV6Quotes");
}
// verify the required parameter 'iMCountryCode' is set
if (iMCountryCode === undefined || iMCountryCode === null) {
throw new Error("Missing the required parameter 'iMCountryCode' when calling getResellersV6Quotes");
}
// verify the required parameter 'iMCorrelationID' is set
if (iMCorrelationID === undefined || iMCorrelationID === null) {
throw new Error("Missing the required parameter 'iMCorrelationID' when calling getResellersV6Quotes");
}
// verify the required parameter 'quoteNumber' is set
if (quoteNumber === undefined || quoteNumber === null) {
throw new Error("Missing the required parameter 'quoteNumber' when calling getResellersV6Quotes");
}
var pathParams = {
'quoteNumber': quoteNumber
};
var queryParams = {};
var headerParams = {
'IM-CustomerNumber': iMCustomerNumber,
'IM-CountryCode': iMCountryCode,
'IM-SenderID': opts['iMSenderID'],
'IM-CorrelationID': iMCorrelationID
};
var formParams = {};
var authNames = ['application'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = _QuoteDetailsResponse["default"];
return this.apiClient.callApi('/resellers/v6/quotes/{quoteNumber}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
}]);
}();