tcx-builder
Version:
45 lines (44 loc) • 1.89 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 (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var _common_1 = require("../_common");
var lodash_1 = require("lodash");
var MultiSportSession = /** @class */ (function (_super) {
__extends(MultiSportSession, _super);
function MultiSportSession(options) {
var _this = _super.call(this) || this;
_this.Id = options.id;
_this.FirstSport = options.firstSport;
_this.NextSport = options.nextSport;
_this.Notes = options.notes;
return _this;
}
MultiSportSession.prototype.toXml = function () {
var xmlElement = '';
xmlElement += _common_1.BaseObject.buildXmlNode('Id', this.Id.toISOString());
xmlElement += _common_1.BaseObject.buildXmlNode('FirstSport', this.FirstSport.toXml());
if (!lodash_1.isNil(this.NextSport)) {
xmlElement += this.NextSport
.map(function (_sport) { return _common_1.BaseObject.buildXmlNode('NextSport', _sport.toXml()); })
.join('\n');
}
if (!lodash_1.isNil(this.Notes)) {
xmlElement += _common_1.BaseObject.buildXmlNode('Notes', this.Notes);
}
return xmlElement;
};
return MultiSportSession;
}(_common_1.BaseObject));
exports.MultiSportSession = MultiSportSession;