import { SchemaModel } from '@verb/src/libs/shared/base/base.model'; import { SubSchema } from '@verb/src/libs/shared/json-schema-validator/schema-types'; export class StreamLimitsModel implements SchemaModel { public maximumAttendees: number | null = 0; public maximumStreamsPerDay: number | null = 0; public maximumTimePerStream: number | null = 0; public constructor(streamLimitsSchema?: StreamLimitsSchema) { if (streamLimitsSchema) { this.fromSchema(streamLimitsSchema); } } public fromSchema(streamLimitsSchema: StreamLimitsSchema) { this.maximumAttendees = streamLimitsSchema.maximum_attendees; this.maximumStreamsPerDay = streamLimitsSchema.maximum_streams_per_day; this.maximumTimePerStream = streamLimitsSchema.maximum_time_per_stream; } public toSchema(): StreamLimitsSchema { return { maximum_attendees: this.maximumAttendees, maximum_streams_per_day: this.maximumStreamsPerDay, maximum_time_per_stream: this.maximumTimePerStream, }; } } export interface StreamLimitsSchema { maximum_attendees: number | null; maximum_streams_per_day: number | null; maximum_time_per_stream: number | null; } export const streamLimitsValidationSchema: SubSchema = { additionalProperties: false, description: 'Stream Limits object property', properties: { maximum_attendees: { description: 'Maximum attendees per stream', type: 'number', }, maximum_streams_per_day: { description: 'Maximum streams per day', type: 'number', }, maximum_time_per_stream: { description: 'Maximum time per stream', type: 'number', }, }, required: ['maximum_attendees', 'maximum_streams_per_day', 'maximum_time_per_stream'], type: 'object', };