UNPKG

reveal-sdk-node

Version:

RevealBI Node.js SDK

110 lines (109 loc) 4.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RVRedshiftDataSourceItem = void 0; const RVSqlBasedDataSourceItem_1 = require("../AbstractClasses/RVSqlBasedDataSourceItem"); const RVRedshiftDataSource_1 = require("./RVRedshiftDataSource"); /** Amazon Redshift data source item */ class RVRedshiftDataSourceItem extends RVSqlBasedDataSourceItem_1.RVSqlBasedDataSourceItem { /** @hidden */ constructor(arg) { super(arg); this._schema = null; this._functionName = null; this._functionParameters = null; this._procedure = null; this._procedureParameters = null; // @if SERVER_SDK this._customQuery = null; this._customQueryParameters = null; if (!(arg instanceof RVRedshiftDataSource_1.RVRedshiftDataSource)) { var props = arg.Properties; this._schema = props["Schema"]; //function properties this._functionName = props["Function"]; if (this._functionName) { this._functionParameters = arg["Parameters"]; } //procedure properties this._procedure = props["Procedure"]; if (this._procedure) { this._procedureParameters = arg["Parameters"]; } // @if SERVER_SDK this.deserializeCustomQuerySupport(arg, true); // @endif } } /** @hidden */ toJson() { var json = super.toJson(); var props = json['Properties']; props['Schema'] = this._schema; props['Function'] = this._functionName; props['Procedure'] = this._procedure; // @if SERVER_SDK this.serializeCustomQuerySupport(json, true); // @endif //copy functionParameters values to parameters if (this._functionParameters && this._functionName) { Object.assign(json['Parameters'], this._functionParameters); } //copy procedureParameters values to parameters if (this._procedureParameters && this._procedure) { Object.assign(json['Parameters'], this._procedureParameters); } return json; } /** Name of the schema the referenced table belongs to */ get schema() { return this._schema; } set schema(value) { this._schema = value; } /** (Optional) name of the function to get data from, the function is expected to return a result set and might have multiple parameters. */ get functionName() { return this._functionName; } set functionName(value) { this._functionName = value; } /** Parameters to be passed to the function, if there is such specified in {@link RVPostgresDataSourceItem.functionName}.*/ get functionParameters() { return this._functionParameters; } set functionParameters(value) { this._functionParameters = value; } /** (Optional) name of the stored procedure to get data from. The procedure is expected to have a REFCURSOR inout parameter and might have additional input parameters. */ get procedure() { return this._procedure; } set procedure(value) { this._procedure = value; } /** Parameters to be passed to the stored procedure, if there is such specified in {@link RVRedshiftDataSourceItem.procedure}.*/ get procedureParameters() { return this._procedureParameters; } set procedureParameters(value) { this._procedureParameters = value; } /** @hidden */ getType() { return "RVRedshiftDataSourceItem"; } get customQuery() { return this._customQuery; } set customQuery(value) { this._customQuery = value; } get customQueryParameters() { return this._customQueryParameters; } set customQueryParameters(value) { this._customQueryParameters = value; } } exports.RVRedshiftDataSourceItem = RVRedshiftDataSourceItem;