"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Plugin = void 0;
class Plugin {
    constructor(values) {
        Object.assign(this, values);
    }
    pluginDevice(webhooks) {
        return webhooks.find((w) => w.id === this.plugin);
    }
    onTransferDevice(deviceList) {
        return deviceList.find((d) => d.id === this.onTransfer);
    }
    onErrorDevice(deviceList) {
        return deviceList.find((d) => d.id === this.onError);
    }
    onCompleteDevice(deviceList) {
        return deviceList.find((d) => d.id === this.onComplete);
    }
    onFailDevice(deviceList) {
        return deviceList.find((d) => d.id === this.onFail);
    }
    onNoAnswerDevice(deviceList) {
        return deviceList.find((d) => d.id === this.onNoAnswer);
    }
    onBusyDevice(deviceList) {
        return deviceList.find((d) => d.id === this.onBusy);
    }
}
exports.Plugin = Plugin;
