UNPKG

@umbraco/json-models-builders

Version:
44 lines 1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UserBuilder = void 0; class UserBuilder { email; kind; name; userGroupIds; userName; constructor() { this.userGroupIds = []; } withEmail(email) { this.email = email; return this; } withName(name) { this.name = name; return this; } withKind(kind) { this.kind = kind; return this; } addUserGroupId(userGroupId) { this.userGroupIds.push({ id: userGroupId }); return this; } withUsername(userName) { this.userName = userName; return this; } build() { return { email: this.email || '', name: this.name || this.email, kind: this.kind || 'Default', userGroupIds: this.userGroupIds, userName: this.email, }; } } exports.UserBuilder = UserBuilder; //# sourceMappingURL=userBuilder.js.map