// 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";

/**
 * NotificationAction represents an action button for a notification.
 */
export class NotificationAction {
    "id"?: string;
    "title"?: string;

    /**
     * (macOS-specific)
     */
    "destructive"?: boolean;

    /** Creates a new NotificationAction instance. */
    constructor($$source: Partial<NotificationAction> = {}) {

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

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

/**
 * NotificationCategory groups actions for notifications.
 */
export class NotificationCategory {
    "id"?: string;
    "actions"?: NotificationAction[];
    "hasReplyField"?: boolean;
    "replyPlaceholder"?: string;
    "replyButtonTitle"?: string;

    /** Creates a new NotificationCategory instance. */
    constructor($$source: Partial<NotificationCategory> = {}) {

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

    /**
     * Creates a new NotificationCategory instance from a string or object.
     */
    static createFrom($$source: any = {}): NotificationCategory {
        const $$createField1_0 = $$createType1;
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        if ("actions" in $$parsedSource) {
            $$parsedSource["actions"] = $$createField1_0($$parsedSource["actions"]);
        }
        return new NotificationCategory($$parsedSource as Partial<NotificationCategory>);
    }
}

/**
 * NotificationOptions contains configuration for a notification
 */
export class NotificationOptions {
    "id": string;
    "title": string;

    /**
     * (macOS and Linux only)
     */
    "subtitle"?: string;
    "body"?: string;
    "categoryId"?: string;
    "data"?: { [_: string]: any };

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

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

    /**
     * Creates a new NotificationOptions instance from a string or object.
     */
    static createFrom($$source: any = {}): NotificationOptions {
        const $$createField5_0 = $$createType2;
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        if ("data" in $$parsedSource) {
            $$parsedSource["data"] = $$createField5_0($$parsedSource["data"]);
        }
        return new NotificationOptions($$parsedSource as Partial<NotificationOptions>);
    }
}

/**
 * Service represents the notifications service
 */
export class NotificationService {

    /** Creates a new NotificationService instance. */
    constructor($$source: Partial<NotificationService> = {}) {

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

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

// Private type creation functions
const $$createType0 = NotificationAction.createFrom;
const $$createType1 = $Create.Array($$createType0);
const $$createType2 = $Create.Map($Create.Any, $Create.Any);
