1 | "use strict";
|
2 | var __extends = (this && this.__extends) || (function () {
|
3 | var extendStatics = function (d, b) {
|
4 | extendStatics = Object.setPrototypeOf ||
|
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7 | return extendStatics(d, b);
|
8 | };
|
9 | return function (d, b) {
|
10 | if (typeof b !== "function" && b !== null)
|
11 | throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12 | extendStatics(d, b);
|
13 | function __() { this.constructor = d; }
|
14 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15 | };
|
16 | })();
|
17 | var __assign = (this && this.__assign) || function () {
|
18 | __assign = Object.assign || function(t) {
|
19 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
20 | s = arguments[i];
|
21 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
22 | t[p] = s[p];
|
23 | }
|
24 | return t;
|
25 | };
|
26 | return __assign.apply(this, arguments);
|
27 | };
|
28 | Object.defineProperty(exports, "__esModule", { value: true });
|
29 | exports.ODataActionImportRequestConfig = void 0;
|
30 | var odata_common_1 = require("../../odata-common");
|
31 | var ODataActionImportRequestConfig = (function (_super) {
|
32 | __extends(ODataActionImportRequestConfig, _super);
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | function ODataActionImportRequestConfig(defaultServicePath, actionImportName, parameters) {
|
40 | var _this = _super.call(this, 'post', defaultServicePath) || this;
|
41 | _this.actionImportName = actionImportName;
|
42 | _this.payload = _this.buildHttpPayload(parameters);
|
43 | return _this;
|
44 | }
|
45 | ODataActionImportRequestConfig.prototype.resourcePath = function () {
|
46 | return this.actionImportName;
|
47 | };
|
48 | ODataActionImportRequestConfig.prototype.queryParameters = function () {
|
49 | return __assign({}, this.prependDollarToQueryParameters({
|
50 | format: 'json'
|
51 | }));
|
52 | };
|
53 | ODataActionImportRequestConfig.prototype.buildHttpPayload = function (parameters) {
|
54 | var payload = Object.keys(parameters).reduce(function (all, key) {
|
55 | var payloadElement = parameters[key];
|
56 | if (typeof payloadElement.value !== 'undefined') {
|
57 | all[payloadElement.originalName] = payloadElement.value;
|
58 | }
|
59 | return all;
|
60 | }, {});
|
61 | return payload;
|
62 | };
|
63 | return ODataActionImportRequestConfig;
|
64 | }(odata_common_1.ODataRequestConfig));
|
65 | exports.ODataActionImportRequestConfig = ODataActionImportRequestConfig;
|
66 |
|
\ | No newline at end of file |