angular-odata
Version:
Client side OData typescript library for Angular
53 lines • 2.02 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.CsdlIncludeAnnotations = exports.CsdlInclude = exports.CsdlReference = void 0;
const csdl_annotation_1 = require("./csdl-annotation");
class CsdlReference extends csdl_annotation_1.CsdlAnnotable {
constructor({ Uri, Include, IncludeAnnotations, Annotation, }) {
super({ Annotation });
this.Uri = Uri;
this.Include = Include === null || Include === void 0 ? void 0 : Include.map((i) => new CsdlInclude(i));
this.IncludeAnnotations = IncludeAnnotations === null || IncludeAnnotations === void 0 ? void 0 : IncludeAnnotations.map((i) => new CsdlIncludeAnnotations(i));
}
toJson() {
const json = Object.assign(Object.assign({}, super.toJson()), { Uri: this.Uri });
if (Array.isArray(this.Include) && this.Include.length > 0) {
json['Include'] = this.Include.map((i) => i.toJson());
}
if (Array.isArray(this.IncludeAnnotations) &&
this.IncludeAnnotations.length > 0) {
json['IncludeAnnotations'] = this.IncludeAnnotations.map((i) => i.toJson());
}
return json;
}
}
exports.CsdlReference = CsdlReference;
class CsdlInclude {
constructor({ Namespace, Alias }) {
this.Namespace = Namespace;
this.Alias = Alias;
}
toJson() {
return {
Namespace: this.Namespace,
Alias: this.Alias,
};
}
}
exports.CsdlInclude = CsdlInclude;
class CsdlIncludeAnnotations {
constructor({ TermNamespace, Qualifier, TargetNamespace, }) {
this.TermNamespace = TermNamespace;
this.Qualifier = Qualifier;
this.TargetNamespace = TargetNamespace;
}
toJson() {
return {
TermNamespace: this.TermNamespace,
Qualifier: this.Qualifier,
TargetNamespace: this.TargetNamespace,
};
}
}
exports.CsdlIncludeAnnotations = CsdlIncludeAnnotations;
//# sourceMappingURL=csdl-reference.js.map
;