import { SchemaModel } from '@verb/src/libs/shared/base/base.model'; import { SubSchema } from '@verb/src/libs/shared/json-schema-validator/schema-types'; export class StreamServersModel implements SchemaModel { public audioEndpoint = ''; public messagingEndpoint = ''; public rtmpEndpoint = ''; public streamingEndpoint = ''; public videoEndpoint = ''; public constructor(streamServersSchema?: StreamServersSchema) { if (streamServersSchema) { this.fromSchema(streamServersSchema); } } public fromSchema(streamServersSchema: StreamServersSchema): void { this.audioEndpoint = streamServersSchema.audio_endpoint; this.messagingEndpoint = streamServersSchema.messaging_endpoint; this.rtmpEndpoint = streamServersSchema.rtmp_endpoint; this.streamingEndpoint = streamServersSchema.streaming_endpoint; this.videoEndpoint = streamServersSchema.video_endpoint; } public toSchema(): StreamServersSchema { return { audio_endpoint: this.audioEndpoint, messaging_endpoint: this.messagingEndpoint, rtmp_endpoint: this.rtmpEndpoint, streaming_endpoint: this.streamingEndpoint, video_endpoint: this.videoEndpoint, }; } } export interface StreamServersSchema { audio_endpoint: string; messaging_endpoint: string; rtmp_endpoint: string; streaming_endpoint: string; video_endpoint: string; } export const streamServerValidationSchema: SubSchema = { additionalProperties: false, description: 'Stream server Schema Validation', properties: { audio_endpoint: { description: 'Audio endpoint', type: 'string', }, messaging_endpoint: { description: 'Messaging endpoint', type: 'string', }, rtmp_endpoint: { description: 'RTMP endpoint', type: 'string', }, streaming_endpoint: { description: 'Streaming endpoint', type: 'string', }, video_endpoint: { description: 'Video endpoint', type: 'string', }, }, required: [ 'audio_endpoint', 'messaging_endpoint', 'rtmp_endpoint', 'streaming_endpoint', 'video_endpoint', ], type: 'object', };