import { SchemaModel } from '@verb/src/libs/shared/base/base.model'; import { SubSchema } from '@verb/src/libs/shared/json-schema-validator/schema-types'; export class StreamFlagsModel implements SchemaModel { public active = false; public connected = false; public recording = false; public constructor(streamFlagsSchema?: StreamFlagsSchema) { if (streamFlagsSchema) { this.fromSchema(streamFlagsSchema); } } public fromSchema(streamFlagsSchema: StreamFlagsSchema): void { this.active = streamFlagsSchema.active; this.connected = streamFlagsSchema.connected; this.recording = streamFlagsSchema.recording; } public toSchema(): StreamFlagsSchema { return { active: this.active, connected: this.connected, recording: this.recording, }; } } export interface StreamFlagsSchema { active: boolean; connected: boolean; recording: boolean; } export const streamFlagsValidationSchema: SubSchema = { additionalProperties: false, description: 'Stream Flags Schema Validation', properties: { active: { description: 'Active flag', type: 'boolean', }, connected: { description: 'Connected flag', type: 'boolean', }, recording: { description: 'Recording flag', type: 'boolean', }, }, required: ['active', 'connected', 'recording'], type: 'object', };