export class MonitoringCollection
{
    constructor (
        public id: string,
        public name: string,
        public configs: MonitoringConfig[]
    ) {}

    static get(onSuccess: (collections: MonitoringCollection[]) => void) 
    {
        axios.get<MonitoringCollection[]>(ApiConfig.getHttpBase() + '/monitoring-collections')
        .then((response) => {
            onSuccess(response.data);
        });
    }

    static getById(id: string, onSuccess: (collection: MonitoringCollection) => void) 
    {
        axios.get<MonitoringCollection>(ApiConfig.getHttpBase() + '/monitoring-collections/' + id)
        .then((response) => {
            onSuccess(response.data);
        });
    }
}

import axios from "axios";
import type { MonitoringConfig } from "./MonitoringConfig";
