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

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as api$0 from "./internal/api/models.js";

/**
 * RenamePathRequest 重命名文件或目录请求结构体
 */
export class RenamePathRequest {
    "oldPath": string;
    "newPath": string;

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

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

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

/**
 * SaveAppConfigRequest 保存应用配置请求
 */
export class SaveAppConfigRequest {
    "tabs": api$0.AppTabDefinition[];
    "visibleTabs": string[];
    "defaultTab": string;

    /** Creates a new SaveAppConfigRequest instance. */
    constructor($$source: Partial<SaveAppConfigRequest> = {}) {
        if (!("tabs" in $$source)) {
            this["tabs"] = [];
        }
        if (!("visibleTabs" in $$source)) {
            this["visibleTabs"] = [];
        }
        if (!("defaultTab" in $$source)) {
            this["defaultTab"] = "";
        }

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

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

/**
 * SaveBase64FileRequest 保存 Base64 编码的二进制文件
 */
export class SaveBase64FileRequest {
    "path": string;

    /**
     * base64 编码的文件内容
     */
    "content": string;

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

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

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

/**
 * WriteFileRequest 写入文件请求结构体
 */
export class WriteFileRequest {
    "path": string;
    "content": string;

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

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

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

// Private type creation functions
const $$createType0 = api$0.AppTabDefinition.createFrom;
const $$createType1 = $Create.Array($$createType0);
const $$createType2 = $Create.Array($Create.Any);
