reveal-sdk-node
Version:
RevealBI Node.js SDK
84 lines (83 loc) • 2.84 kB
JavaScript
"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._url = null;
this._entity = null;
this._startDate = null;
this._endDate = null;
if (arg instanceof RVMarketoDataSource_1.RVMarketoDataSource) {
this.url = arg.url;
}
else {
var props = arg.Properties;
let params = arg.Parameters;
this._url = props["Url"];
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['Url'] = this._url;
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;
}
/** URL to the Marketo endpoint. Must match the URL specified in the {@link RVMarketoDataSource} data source object. */
get url() {
return this._url;
}
set url(value) {
this._url = value;
}
/** 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";
}
/** @hidden */
_getWrapper() {
var wrapper = super._getWrapper();
wrapper.url(this.url);
wrapper.entity(this.entity);
wrapper.startDate($.ig.util.toNullable($.ig.Date.prototype.$type, this.startDate));
wrapper.endDate($.ig.util.toNullable($.ig.Date.prototype.$type, this.endDate));
return wrapper;
}
}
exports.RVMarketoDataSourceItem = RVMarketoDataSourceItem;