UNPKG

angular-odata

Version:

Client side OData typescript library for Angular

50 lines 1.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CsdlMember = exports.CsdlEnumType = void 0; const csdl_annotation_1 = require("./csdl-annotation"); class CsdlEnumType extends csdl_annotation_1.CsdlAnnotable { constructor(schema, { Name, Member, UnderlyingType, IsFlags, Annotation, }) { super({ Annotation }); this.schema = schema; this.Name = Name; this.Member = Member.map((m) => new CsdlMember(m)); this.UnderlyingType = UnderlyingType; this.IsFlags = IsFlags; } toJson() { const json = Object.assign(Object.assign({}, super.toJson()), { Name: this.Name, Member: this.Member.map((m) => m.toJson()) }); if (this.UnderlyingType !== undefined) { json['UnderlyingType'] = this.UnderlyingType; } if (this.IsFlags !== undefined) { json['IsFlags'] = this.IsFlags; } return json; } name() { return `${this.Name}`; } namespace() { return `${this.schema.Namespace}`; } fullName() { return `${this.schema.Namespace}.${this.Name}`; } } exports.CsdlEnumType = CsdlEnumType; class CsdlMember extends csdl_annotation_1.CsdlAnnotable { constructor({ Name, Value, Annotation, }) { super({ Annotation }); this.Name = Name; this.Value = Value; } toJson() { const json = Object.assign(Object.assign({}, super.toJson()), { Name: this.Name }); if (this.Value !== undefined) { json['Value'] = this.Value; } return json; } } exports.CsdlMember = CsdlMember; //# sourceMappingURL=csdl-enum-type.js.map