import { SchemaModel } from '@verb/src/libs/shared/base/base.model'; import { SubSchema } from '@verb/src/libs/shared/json-schema-validator/schema-types'; export class StreamInteractionLibraryModel implements SchemaModel { public groupId = ''; public groupName: string | null = null; public metadata: object[] = []; public constructor(streamInteractionLibrarySchema?: StreamInteractionLibrarySchema) { if (streamInteractionLibrarySchema) { this.fromSchema(streamInteractionLibrarySchema); } } public fromSchema(streamInteractionLibrarySchema: StreamInteractionLibrarySchema) { this.groupId = streamInteractionLibrarySchema.group_id; this.groupName = streamInteractionLibrarySchema.group_name; this.metadata = streamInteractionLibrarySchema.metadata; } public toSchema(): StreamInteractionLibrarySchema { return { group_id: this.groupId, group_name: this.groupName, metadata: this.metadata, }; } } export interface StreamInteractionLibrarySchema { group_id: string; group_name: string | null; metadata: object[]; } export const streamInteractionLibraryValidationSchema: SubSchema = { additionalProperties: false, description: 'Stream Interaction Library Schema', properties: { group_id: { description: 'Stream Interaction Library group id', minLength: 1, type: 'string', }, group_name: { description: 'Stream Interaction Library group name', type: 'string', }, metadata: { description: 'Stream Interaction Library', items: { type: 'string', }, type: 'array', }, }, required: ['group_id', 'group_name', 'metadata'], type: 'object', };