@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
65 lines • 3.24 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ODataFunctionImportRequestConfigV2 = exports.ODataFunctionImportRequestConfig = void 0;
var odata_common_1 = require("../../odata-common");
var ODataFunctionImportRequestConfig = /** @class */ (function (_super) {
__extends(ODataFunctionImportRequestConfig, _super);
/**
* Creates an instance of ODataFunctionImportRequestConfig.
* @param method - HTTP method for the request
* @param defaultServicePath - Default path of the service
* @param functionImportName - The name of the function import.
* @param parameters - Object containing the parameters with a value and additional meta information
* @param oDataUri - ODataUri conversion interface at runtime either v2 or v4
*/
function ODataFunctionImportRequestConfig(method, defaultServicePath, functionImportName, parameters, oDataUri) {
return _super.call(this, method, defaultServicePath, functionImportName, parameters, oDataUri) || this;
}
ODataFunctionImportRequestConfig.prototype.resourcePath = function () {
return this.functionImportName;
};
ODataFunctionImportRequestConfig.prototype.queryParameters = function () {
var _this = this;
return __assign(__assign({}, this.prependDollarToQueryParameters({
format: 'json'
})), Object.values(this.parameters)
.filter(function (parameter) {
return typeof parameter.value !== 'undefined';
})
.reduce(function (queryParams, parameter) {
queryParams[parameter.originalName] =
_this.oDataUri.convertToUriFormat(parameter.value, parameter.edmType);
return queryParams;
}, {}));
};
return ODataFunctionImportRequestConfig;
}(odata_common_1.ODataFunctionImportRequestConfig));
exports.ODataFunctionImportRequestConfig = ODataFunctionImportRequestConfig;
exports.ODataFunctionImportRequestConfigV2 = ODataFunctionImportRequestConfig;
//# sourceMappingURL=odata-function-import-request-config.js.map
;