UNPKG

reveal-sdk-node

Version:

RevealBI Node.js SDK

62 lines (61 loc) 2.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RVMarketoDataSourceItem = void 0; const RVDataSourceItem_1 = require("../AbstractClasses/RVDataSourceItem"); const RVMarketoDataSource_1 = require("./RVMarketoDataSource"); const types_1 = require("../types"); /** Marketo data source item, see {@link RVMarketoDataSource} for more information. */ class RVMarketoDataSourceItem extends RVDataSourceItem_1.RVDataSourceItem { /** @hidden */ constructor(arg) { super(arg); this._entity = null; this._startDate = null; this._endDate = null; if (!(arg instanceof RVMarketoDataSource_1.RVMarketoDataSource)) { var props = arg.Properties; let params = arg.Parameters; this._entity = props['Entity']; this._startDate = (0, types_1.dateFromJson)(params['From']); this._endDate = (0, types_1.dateFromJson)(params['To']); } } /** @hidden */ toJson() { var json = super.toJson(); var props = json['Properties']; var params = json['Parameters']; props['Entity'] = this._entity; if (this._startDate) params['From'] = (0, types_1.dateToJson)(this._startDate); if (this._endDate) params['To'] = (0, types_1.dateToJson)(this._endDate); return json; } /** Entity to retrieve data from */ get entity() { return this._entity; } set entity(value) { this._entity = value; } /** Start date to use when requesting data. */ get startDate() { return this._startDate; } set startDate(value) { this._startDate = value; } /** End date to use when requesting data. */ get endDate() { return this._endDate; } set endDate(value) { this._endDate = value; } /** @hidden */ getType() { return "RVMarketoDataSourceItem"; } } exports.RVMarketoDataSourceItem = RVMarketoDataSourceItem;