@umbraco/json-models-builders
Version:
Builders and models for Umbraco Sites
104 lines • 2.76 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MediaTypePropertyBuilder = void 0;
const BuilderUtils_1 = require("../../helpers/BuilderUtils");
class MediaTypePropertyBuilder {
parentBuilder;
id;
containerId;
sortOrder;
alias;
name;
description;
dataTypeId;
variesByCulture;
variesBySegment;
mandatory;
mandatoryMessage;
regEx;
regExMessage;
labelOnTop;
constructor(parentBuilder) {
this.parentBuilder = parentBuilder;
}
withId(id) {
this.id = id;
return this;
}
withContainerId(containerId) {
this.containerId = containerId;
return this;
}
withSortOrder(sortOrder) {
this.sortOrder = sortOrder;
return this;
}
withAlias(alias) {
this.alias = alias;
return this;
}
withName(name) {
this.name = name;
return this;
}
withDescription(description) {
this.description = description;
return this;
}
withDataTypeId(dataTypeId) {
this.dataTypeId = dataTypeId;
return this;
}
withVariesByCulture(variesByCulture) {
this.variesByCulture = variesByCulture;
return this;
}
withVariesBySegment(variesBySegment) {
this.variesBySegment = variesBySegment;
return this;
}
withMandatory(mandatory) {
this.mandatory = mandatory;
return this;
}
withMandatoryMessage(mandatoryMessage) {
this.mandatoryMessage = mandatoryMessage;
return this;
}
withRegEx(regEx) {
this.regEx = regEx;
return this;
}
withRegExMessage(regExMessage) {
this.regExMessage = regExMessage;
return this;
}
withLabelOnTop(labelOnTop) {
this.labelOnTop = labelOnTop;
return this;
}
done() {
return this.parentBuilder;
}
build() {
this.id = (0, BuilderUtils_1.ensureIdExists)(this.id);
return (0, BuilderUtils_1.buildProperty)({
id: this.id,
containerId: this.containerId,
sortOrder: this.sortOrder,
alias: this.alias,
name: this.name,
description: this.description,
dataTypeId: this.dataTypeId,
variesByCulture: this.variesByCulture,
variesBySegment: this.variesBySegment,
mandatory: this.mandatory,
mandatoryMessage: this.mandatoryMessage,
regEx: this.regEx,
regExMessage: this.regExMessage,
labelOnTop: this.labelOnTop
});
}
}
exports.MediaTypePropertyBuilder = MediaTypePropertyBuilder;
//# sourceMappingURL=mediaTypePropertyBuilder.js.map