xi_sdk_resellers
Version:
Ingram Micro - Xvantage Integration (XI) Node.Js Server-side SDK.
172 lines (167 loc) • 9.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _DealsDetailsResponse = _interopRequireDefault(require("../model/DealsDetailsResponse"));
var _DealsSearchResponse = _interopRequireDefault(require("../model/DealsSearchResponse"));
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.
*
*/
/**
* Deals service.
* @module api/DealsApi
* @version 1.0.0
*/
var DealsApi = exports["default"] = /*#__PURE__*/function () {
/**
* Constructs a new DealsApi.
* @alias module:api/DealsApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
function DealsApi(apiClient) {
_classCallCheck(this, DealsApi);
this.apiClient = apiClient || _ApiClient["default"].instance;
}
/**
* Callback function to receive the result of the getResellersV6Dealsdetails operation.
* @callback module:api/DealsApi~getResellersV6DealsdetailsCallback
* @param {String} error Error message, if any.
* @param {module:model/DealsDetailsResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Deals Details
* The Deals Details API will retrieve all the details related to the specific deal id.
* @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 {String} dealId Unique deal ID.
* @param {module:api/DealsApi~getResellersV6DealsdetailsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/DealsDetailsResponse}
*/
return _createClass(DealsApi, [{
key: "getResellersV6Dealsdetails",
value: function getResellersV6Dealsdetails(iMCustomerNumber, iMCountryCode, iMCorrelationID, iMApplicationId, dealId, callback) {
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 getResellersV6Dealsdetails");
}
// verify the required parameter 'iMCountryCode' is set
if (iMCountryCode === undefined || iMCountryCode === null) {
throw new Error("Missing the required parameter 'iMCountryCode' when calling getResellersV6Dealsdetails");
}
// verify the required parameter 'iMCorrelationID' is set
if (iMCorrelationID === undefined || iMCorrelationID === null) {
throw new Error("Missing the required parameter 'iMCorrelationID' when calling getResellersV6Dealsdetails");
}
// verify the required parameter 'iMApplicationId' is set
if (iMApplicationId === undefined || iMApplicationId === null) {
throw new Error("Missing the required parameter 'iMApplicationId' when calling getResellersV6Dealsdetails");
}
// verify the required parameter 'dealId' is set
if (dealId === undefined || dealId === null) {
throw new Error("Missing the required parameter 'dealId' when calling getResellersV6Dealsdetails");
}
var pathParams = {
'dealId': dealId
};
var queryParams = {};
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 = _DealsDetailsResponse["default"];
return this.apiClient.callApi('/resellers/v6/deals/{dealId}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the getResellersV6Dealssearch operation.
* @callback module:api/DealsApi~getResellersV6DealssearchCallback
* @param {String} error Error message, if any.
* @param {module:model/DealsSearchResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Deals Search
* The Deals Search API, by default, will retrieve all the deals that are associated with the customer’s account. The customer will be able to search deals using the End-user name, Vendor name, or DealID.
* @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} [iMSenderID] Unique value used to identify the sender of the transaction. Example: MyCompany
* @param {String} [endUser] The end user/customer's name.
* @param {String} [vendor] The vendor's name.
* @param {String} [dealId] Deal/Special bid number.
* @param {Number} [size] The number of records required in the call - max records 100 per page.
* @param {Number} [page] The page number reference.
* @param {module:api/DealsApi~getResellersV6DealssearchCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/DealsSearchResponse}
*/
}, {
key: "getResellersV6Dealssearch",
value: function getResellersV6Dealssearch(iMCustomerNumber, iMCountryCode, 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 getResellersV6Dealssearch");
}
// verify the required parameter 'iMCountryCode' is set
if (iMCountryCode === undefined || iMCountryCode === null) {
throw new Error("Missing the required parameter 'iMCountryCode' when calling getResellersV6Dealssearch");
}
// verify the required parameter 'iMCorrelationID' is set
if (iMCorrelationID === undefined || iMCorrelationID === null) {
throw new Error("Missing the required parameter 'iMCorrelationID' when calling getResellersV6Dealssearch");
}
var pathParams = {};
var queryParams = {
'endUser': opts['endUser'],
'vendor': opts['vendor'],
'dealId': opts['dealId'],
'Size': opts['size'],
'Page': opts['page']
};
var headerParams = {
'IM-CustomerNumber': iMCustomerNumber,
'IM-CountryCode': iMCountryCode,
'IM-CorrelationID': iMCorrelationID,
'IM-SenderID': opts['iMSenderID']
};
var formParams = {};
var authNames = ['application'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = _DealsSearchResponse["default"];
return this.apiClient.callApi('/resellers/v6/deals/search', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
}]);
}();