// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Create as $Create } from "@wailsio/runtime";

/**
 * AvailableMiner represents an available miner for installation.
 */
export class AvailableMiner {
    "name": string;
    "description": string;

    /** Creates a new AvailableMiner instance. */
    constructor($$source: Partial<AvailableMiner> = {}) {
        if (!("name" in $$source)) {
            this["name"] = "";
        }
        if (!("description" in $$source)) {
            this["description"] = "";
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new AvailableMiner instance from a string or object.
     */
    static createFrom($$source: any = {}): AvailableMiner {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new AvailableMiner($$parsedSource as Partial<AvailableMiner>);
    }
}

/**
 * MinerInfo represents basic miner information for the frontend.
 */
export class MinerInfo {
    "name": string;
    "type": string;
    "isRunning": boolean;

    /** Creates a new MinerInfo instance. */
    constructor($$source: Partial<MinerInfo> = {}) {
        if (!("name" in $$source)) {
            this["name"] = "";
        }
        if (!("type" in $$source)) {
            this["type"] = "";
        }
        if (!("isRunning" in $$source)) {
            this["isRunning"] = false;
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new MinerInfo instance from a string or object.
     */
    static createFrom($$source: any = {}): MinerInfo {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new MinerInfo($$parsedSource as Partial<MinerInfo>);
    }
}

/**
 * MinerStats represents miner statistics for the frontend.
 */
export class MinerStats {
    "hashrate": number;
    "shares": number;
    "rejected": number;
    "uptime": number;
    "lastShare": number;
    "algorithm": string;

    /** Creates a new MinerStats instance. */
    constructor($$source: Partial<MinerStats> = {}) {
        if (!("hashrate" in $$source)) {
            this["hashrate"] = 0;
        }
        if (!("shares" in $$source)) {
            this["shares"] = 0;
        }
        if (!("rejected" in $$source)) {
            this["rejected"] = 0;
        }
        if (!("uptime" in $$source)) {
            this["uptime"] = 0;
        }
        if (!("lastShare" in $$source)) {
            this["lastShare"] = 0;
        }
        if (!("algorithm" in $$source)) {
            this["algorithm"] = "";
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new MinerStats instance from a string or object.
     */
    static createFrom($$source: any = {}): MinerStats {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new MinerStats($$parsedSource as Partial<MinerStats>);
    }
}
