import { SchemaModel } from '@verb/src/libs/shared/base/base.model'; import { SubSchema } from '@verb/src/libs/shared/json-schema-validator/schema-types'; export class StreamAttendeeFlagsModel implements SchemaModel { public active = false; public banned = false; public connected = false; public isHost = false; public loginAttempts = 0; public constructor(streamAttendeeFlagsSchema?: StreamAttendeeFlagsSchema) { if (streamAttendeeFlagsSchema) { this.fromSchema(streamAttendeeFlagsSchema); } } public fromSchema(streamAttendeeFlagsSchema: StreamAttendeeFlagsSchema) { this.active = streamAttendeeFlagsSchema.active; this.banned = streamAttendeeFlagsSchema.banned; this.connected = streamAttendeeFlagsSchema.connected; this.isHost = streamAttendeeFlagsSchema.is_host; this.loginAttempts = streamAttendeeFlagsSchema.login_attempts; } public toSchema(): StreamAttendeeFlagsSchema { return { active: this.active, banned: this.banned, connected: this.connected, is_host: this.isHost, login_attempts: this.loginAttempts, }; } } export interface StreamAttendeeFlagsSchema { active: boolean; banned: boolean; connected: boolean; is_host: boolean; login_attempts: number; } export const streamAttendeeFlagsValidationSchema: SubSchema = { additionalProperties: false, description: 'Attendee Flags Schema Validation', properties: { active: { description: 'Active flag', type: 'boolean', }, banned: { description: 'Banned flag', type: 'boolean', }, connected: { description: 'Connected flag', type: 'boolean', }, isHost: { description: 'Is Host flag', type: 'boolean', }, }, required: ['active', 'banned', 'connected', 'isHost'], type: 'object', };